Continue to Site

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.

Questions with Conditional compilation Commands in Verilog

Status
Not open for further replies.

walkon

Junior Member level 1
Joined
Oct 21, 2004
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
165
verilog conditional compilation

I have 3 sub-blocks and a top module load them with the conditioanl compilation command, here is parts of the top module.

`define N45TT;

`ifdef N45TT
N45TT N0TT1 (.in(output1), .out(OUTTT1));
//--------------------------------------------------------------

`elsif N50TT
N50TT N0TT1 (.in(output1), .out(OUTTT1));
//--------------------------------------------------------------
`elsif N55TT
N55TT N0TT1 (.in(output1), .out(OUTTT1));

The only way I know to switch compiling between different blocks is to change the `define parameters from 'N45TT' to 'N50TT' or 'N55TT' so the top module could load the needed block with conditional compilation command.

Now I need to have the simulation run automatically from N45TT to N50TT to N55TT after some condition is met such like a counter is set to some value, say if i=1 run N45TT, i=2 run N50TT, i=3 run N55TT. How could I do this? Many thanks.
 

verilog conditional compile

Maybe you can use a utility like make?
 

veilog conditional compilation

Would you please explain more on that?
 

verilog conditional compilation ifdef

With 'make' you can use conditional compilation to only build the verilog files you want.
So you can say:
$ make n45tt
and then have a rule in the makefile that's like
n45tt:
vlog n45tt.v
Or something. Read the documentation on 'make'. I think it can do it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top