in VHDL, I can easily do this:
constant cmdbytes : bytearray(0 to Total) := (x"05", x"00", x...};
I want synthesizable constants so that when the FPGA starts, this array has the data I supplied. These registers are wired to VCC or ground to represent 1 or 0. I can then use them to generate a waveform. Also I would like to have 2D byte array which is 3D in verilog world.
If you're just using the array to pull out one value at a time, how about using a
case
statement? Granted, it's a long-winded way of doing it, but you could always write a script to write the RTL for you.Another way is to use an
initial
statement. As far as I'm aware, FPGA synthesis tools will allow you to set initial values for arrays in the following manner. Again, a script to write this may be the way to go.And if your FGPA synthesis tools support some SystemVerilog, you'll be able to initialise the array like so:
Verilog 2005 doesn't allow array initialization. Though your FPGA vendor should have a means to generate a ROM.
Does this work?
or