Verilog if statement with a signed signal
This feels like it should be a stupid question but does quartus do something strange when compiling if statements using signed signals? As an example, I have some code in the following form:
typedef logic signed [ 3:0] Int4_t;
Int4_t testValue;
...
if (testValue <= 0)
//Do the negative branch
else
//Do the positive branch
Modelsim behaves as I'd expect with this but then the design behaves as if the testValue is always unsigned in hardware so does the wrong thing. Obviously the work around is to just manually do a check of bit 3 but this seems like a weird behaviour to me...
Thanks,
Andy
So after digging through the LRM, it looks like Quartus is actually doing the correct thing per the spec (however I maintain that Modelsim is doing the correct thing per common sense). File it away as a nasty gotcha I guess....