开发者

ModelSim doesn't recognize the parameter data type?

开发者 https://www.devze.com 2023-02-17 23:40 出处:网络
Here is some Verilog code that I\'m trying to run in Modelsim. parameter Data_width = 8; //DATA SIZE input CLK, RST;

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号