viju
Member level 4
Hi,
here is my pseudo code...
"
`timescale 1ns/1ns
module test();
reg a;
reg b;
parameter text1 = 1'b0;
generate
if(text1 === 1'b1)
begin
`define ONE1
initial
$display("\n\n%m : LOOP ONE....\n\n ");
end
endgenerate
generate
if(text1 === 1'b0)
begin
`define ZERO1
initial
$display("\n\n%m : LOOP ZERO...\n\n ");
end
endgenerate
always @(posedge a)
begin
`ifdef ONE1
$display(" ONE IS DEFINED by module %m ");
`endif
end
always @(posedge b)
begin
`ifdef ZERO1
$display(" ZERO IS DEFINED by module %m ");
`endif
end
initial
begin
a = 1'b0;
b = 1'b0;
#5;
a =1'b1;
b =1'b1;
#50 $finish;
end
endmodule
"
and here is its output in vcs and ncverilog
"
test : LOOP ZERO...
ONE IS DEFINED by module test
ZERO IS DEFINED by module test
"
Also clubbed a generate blocks.. but it gives the same result... also clubbed a always block but same result...
can any one help me how to solve this problem? If during generate statement only one generate condition is encountered, the why both the `defines are declared ?
Shouldn't be only one `define should be present in the simulation?
Pl help... looks very strange to me?
Am i missing any thing?
here is my pseudo code...
"
`timescale 1ns/1ns
module test();
reg a;
reg b;
parameter text1 = 1'b0;
generate
if(text1 === 1'b1)
begin
`define ONE1
initial
$display("\n\n%m : LOOP ONE....\n\n ");
end
endgenerate
generate
if(text1 === 1'b0)
begin
`define ZERO1
initial
$display("\n\n%m : LOOP ZERO...\n\n ");
end
endgenerate
always @(posedge a)
begin
`ifdef ONE1
$display(" ONE IS DEFINED by module %m ");
`endif
end
always @(posedge b)
begin
`ifdef ZERO1
$display(" ZERO IS DEFINED by module %m ");
`endif
end
initial
begin
a = 1'b0;
b = 1'b0;
#5;
a =1'b1;
b =1'b1;
#50 $finish;
end
endmodule
"
and here is its output in vcs and ncverilog
"
test : LOOP ZERO...
ONE IS DEFINED by module test
ZERO IS DEFINED by module test
"
Also clubbed a generate blocks.. but it gives the same result... also clubbed a always block but same result...
can any one help me how to solve this problem? If during generate statement only one generate condition is encountered, the why both the `defines are declared ?
Shouldn't be only one `define should be present in the simulation?
Pl help... looks very strange to me?
Am i missing any thing?