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.

Diff b/w if statement & 'ifdef directive

Status
Not open for further replies.

dinesh.4126

Member level 5
Joined
Feb 27, 2008
Messages
83
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,841
hi,
can somebody tell me difference b/w if statement and 'ifdef.
When should we go for 'ifdef compile directive.
 

Hi Dinesh,
if-else satement is used to implement a sequential or combinatorial logic within a begin-end block

`ifdef compiler directive is used to specify the simulator to compile certain lines of code b/n `ifdef and `endif statements.

Hope you have got the required answer.
Thanks.
 

It means if statement is synthesize into gate level but 'ifdef is used in test bench.
 

`ifdef directive not only specifies the simulator tool it also specifies the synthesis tool to synthesize the code b/n `ifdef and `endif if the particular Macro is defined.
So we can implement `ifdef compiler directive in the design code.
it may be utilized for the testbench code too...
 

Hi,

Go to below topic and see my reply, also take a look at TOP.v file, you will get your answer.



HTH
--
Shitansh Vaghela
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top