Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you initialize a parameter array in Verilog

Tags:

verilog

This gives me an error saying that I can't assign a packed type to an unpacked type. I agree that the right side is an array of packed types, but why is the left side of the expression an unpacked type?

parameter [7:0] lsfr_taps [0 : 7]   = {8'd9, 8'd5, 8'd3, 8'h21, 8'd9, 8'd9, 8'd5, 8'd9};

Regardless the more important question is how do I inialize a two-dimensional array of multi-bit parameters in Verilog?

like image 655
James Joshua Street Avatar asked Oct 11 '25 07:10

James Joshua Street


1 Answers

Your initialisation is fine. You just need to add a ' before {:

parameter [7:0] lsfr_taps [0 : 7]   = '{8'd9, 8'd5, 8'd3, 8'h21, 8'd9, 8'd9, 8'd5, 8'd9};
like image 119
0xMB Avatar answered Oct 15 '25 04:10

0xMB