R
rookie
Guest
Hi,
I'm wondering if following verilog function declaration is valid or
not, since it can be compiled succesfully in Modelsim & Synplify, but
failed in NC-verilog and VCS .
function reg [1:0] myfunc(input wire [1:0] data);
begin
if(data==2'b00)
myfunc = 2'b00;
else if(data==2'b01)
myfunc = 2'b01;
else if(data==2'b10)
myfunc = 2'b11;
else
myfunc = 2'b10;
end
endfunction
Thanks
I'm wondering if following verilog function declaration is valid or
not, since it can be compiled succesfully in Modelsim & Synplify, but
failed in NC-verilog and VCS .
function reg [1:0] myfunc(input wire [1:0] data);
begin
if(data==2'b00)
myfunc = 2'b00;
else if(data==2'b01)
myfunc = 2'b01;
else if(data==2'b10)
myfunc = 2'b11;
else
myfunc = 2'b10;
end
endfunction
Thanks