Hi All,
code sample:
//////////////////////////////////////////////////
module ex;
int res;
initial begin
for (int i=0; i<=1; i++) begin
`ifndef MODULE1
`define MODULE1
if (!res)begin
$display("MODULE First Time");
res = 1;
end
else begin
$display("MODULE Second Time");
end
`endif
end
end
endmodule
//compile options: How to run two times?
///////////////////////////////////////////////////
As a compilation argument, I am not passing +MODULE1. So default, it is enabled and I get the "MODULE First Time Display". Now for the second run, since MODULE1 is already defined, code should not run and no display should come out.
How to make code runs two times in eda playground?
For the first run, MODULE1 should be defined and for the next run, it should not be enabled. How to do this?
Thank You,
Mahesh