LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameterize FPGA Design

Solved!
Go to solution

Hi everyone,

 

I'm working on an FPGA project where I need to generate a number of signals and output using a DAC.  Since I don't have access to the final PXI multifunction card that I'm deploying to, I'm using an older model of the card to develop with which has a lower output sampling rate.  Since I use the sampling rate in my calculations for generating the signals I need a way to access this value.  Is there a good way to parameterize this value in my design so that the correct value is set at compile time?

 

Right now I'm using a numeric constant in my design, but I need this value in multiple locations, so I need to update in every location if I want to change this value.  Also, some of the filters I'm using have sampling rate as a configurable parameter instead of an input.

 

The only other way I thought about doing this was to define a register to hold this value with an appropriate initialization VI.  This adds the overhead of the register though, and since this value never needs to change past compile time this seems unnecessary.

 

Is there any better way to do this?  I'm used to using parameters in verilog to be able to change my design easily.

Message 1 of 3
(2,871 Views)
Solution
Accepted by topic author mbremer

You could use a conditional disable structure to define what code to compile for which FPGA target using the FPGA_Target_Class symbol.

 

https://www.ni.com/docs/en-US/bundle/labview/page/configuring-conditions-for-conditional-disable-str...

 

If you would be creating the same conditional code everywhere you could probably wrap that up in a subVI and set that to inline.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 3
(2,822 Views)

What Matt said!

 

Things like sample rate can become variables or registers which the host can set on start (or with the conditional structure)

 

Filters are harder because as you say they have an assumption of sample rate. Sometimes they work on a ratio of sample rate and it works anyway (e.g. anti aliasing) but you need to either update the filter parameters or swap them out with a conditional disable in most cases. Conditional disable is probably easiest if it is just a couple of cases.

James Mc
========
Ask me about Rust & NI Hardware
My writings are at https://www.wiresmithtech.com/devs/
0 Kudos
Message 3 of 3
(2,809 Views)