$signed ignored under generate block #999
Labels
area: wrong runtime result
Issue involves an incorrect runtine result from Verilated model
resolution: fixed
Closed; fixed
Author Name: Clifford Wolf (@cliffordwolf)
Original Redmine Issue: 999 from https://www.veripool.org
Original Date: 2015-11-12
Original Assignee: Wilson Snyder (@wsnyder)
A PicoRV32 user reported problems with simulating the PicoRV32 CPU with Verilator. So I investigated and found the following bug in Verilator. Sorry for not positing a minimalist test case. I've tried to create one from scratch, but was unable to reproduce the problem this way.
Here is the problem: http://i.imgur.com/evkRLNx.png
alu_lts clearly should be high when reg_op1 is -1 and reg_op2 is 0. But it seems like Verilator incorrectly merges the alu_lts and alu_ltu signal.
Using current git head of verilator (4e4bc7b):
Interestingly, in the larger test bench that includes PicoRV32, the signals alu_lts and alu_ltu are not merged, but are still assigned the same expressions. Looking at the generated c++ code:
In this case, manually changing the assignment for alu_lts fixes the problem and the testbench runs successfully:
The text was updated successfully, but these errors were encountered: