ifdef in xst

  • Thread starter Matthew E Rosenthal
  • Start date
M

Matthew E Rosenthal

Guest
hi,
can someone give me a short example or point me to an example of how to
use ifdef and in particular ifdef in xilinx xst.
I want to write some code that should act differently when I compile it
for 1 particular board and differently for another board.
So i would just like to have one define in my top level and then have the
code change itself depending on the ifdef. is this possible?

thanks

Matt
 
create a separate file that contains global compiler directives - I
called mine "commands.v". Then use the `include directive. Here's an
example:

---------------------
commands.v ->

`define compileIt
---------------------

---------------------
top.v ->

module top (anIn, anOut);
input anIn;
output anOut;

lower lower(
.anIn (anIn),
.anOut (anOut) );


----------------------
lower.v ->

`include "commands.v"
module lower (anIn, anOut);
input anIn;
output anOut;
`ifdef compileIt
thisLineGeneratesAnError
`else
assign anOut = anIn;
`endif

endmodule
--------------------------


regards,

gene
 

Welcome to EDABoard.com

Sponsor

Back
Top