Dsim: Syntax error when using macro in system verilog simulation

alyee_tan920
alyee_tan920 Altair Community Member

When compiling using Dsim, the compilation failed when it tried to compile this line.

`define width 4
`define init 0 … count <= `width'd`init;

By my understanding, the defined macro should be preprocessed before the compilation stage, so it should resolve to this:

count <= 4'd0; 

It will be helpful if I can get away with using this way of coding as we are managing IP models running on multiple simulators from various vendors and currently other vendor simulator is able to support this code. I have attached a simple counter example on this error.

Tagged:

Welcome!

It looks like you're new here. Sign in or register to get started.

Best Answer

Answers

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.