Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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
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.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,277
Helped
14,226
Reputation
28,713
Reaction score
12,920
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,569
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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top