ModelSim doesn't recognize the parameter data type?
Here is some Verilog code that I'm trying to run in Modelsim.
parameter Data_width = 8; //DATA SIZE
input CLK, RST;
input [Data _width-1:0] D;
When I try to compile it, the compiler complains about Data_width in the last line, saying that it expects an identifier. I could hardcode the number in there to get rid of the problem, but I would prefer to use a variable in case开发者_高级运维 I want to change it so I don't have to change it. How can this be fixed?
The code you posted has a space between Data
and _width
in the last line. Change it to:
input [Data_width-1:0] D;
精彩评论