Hi all,
I’d like to be able to pass parameters into a verilog block. I see plenty of examples for passing into C++, but I REALLY need to use Verilog.
So far, everything I have tried in verilog seems to be ignored: When I run QSPICE I get
Warning: Ignoring unknown instance parameter “GAINB” of device X2, this implies that whatever I have done in verilog does not result in verilator seeing that there is a parameter.
Does anyone have a verilog code example that works?
I do not believe there is a built in example that uses verilog and passes in parameters.
I have looked. If you can point me at one, it would be greatly appreciated.
There are multiple ways of specifying parameters in Verilog, I have tried several of them, in case one works and another does not.
Here’s the current ( non working ) version:
GAINB needs a valid data type, i.e., “double GAINB=2.2”. (ROUT doesn’t need a data type because it isn’t a parameter passed to the code.) See “Ø-Device” topic in Help for valid data types.
Yeah, Dave, you’ll probably need to regenerate the default templates and add code back. Not being a Verilog guy, I’m not entirely sure of the process. However, this is an issue even for C-Block/non-Verilog stuff.
Please do report back what you find for the benefit of other Verilog users.
Then the verilog template adds an input to the verilog, which is not what I would have expected, nor what want…but it’s what it does ( see input real gaina in code below ).
Strings are supported as a bit of a hack in basic verilog, you can define a very wide register ( 8 bits * number of characters ) and then assign it with a string in quotes, e.g.