gEDA-dev: iverilog: problems with constant expr in conditional

Evan Lavelle sa212+geda at cyconix.com
Thu Nov 23 06:59:32 EST 2006


Icarus 0.8.3 seems to have problems with a literal expression in a 
conditional statement:

module test;
   initial
     main;
   task main;
     begin
       if(2)
         $write("taken 'if' branch\n");
       else
         $write("taken 'else' branch\n");
     end
   endtask
endmodule

This (machine-generated) code takes the else branch, and not the if 
branch. iverilog seems to be checking just the bottom bit of the 
conditional; 'if(3)' works Ok.

This code segfaults on compilation:

module test;
    initial
      main;
    task main;
       begin
	 if(1)
	   ;
       end
    endtask
endmodule

--
Evan


More information about the geda-dev mailing list