uable to define in verilog(Model Sim)

Status
Not open for further replies.

Kiran Sahu

Newbie level 1
Joined
May 25, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,288
sir,
There is problem in defining macros in verilog(compiled in Model Sim)
like Here I used n in program as

module test();
`define n 8
wire i;
assign i = n;
endmodule

then it shows an error as "Undefined variable: n"
kindly, help me out of this error. As I would like to define n in the global scope so that I can use it in another program.
 

As I would like to define n in the global scope so that I can use it in another program.
`define is a preprocessor feature, it's not exported to other design entities respectively has no "scope". It's not clear what you exactly want to achieve, but you should think about using either module parameters or project wide include files.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…