You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A number of warnings and errors follow, starting with:
%Warning-LITENDIAN: t/t_param_module.v:42: Little bit endian vector: MSB < LSB of bit range: -17:0
Verilator appears to mis-evaluate the localparam @width@ as -16 (rather than 16) when used in the test module to set the value of @msb@. The problem appears to be with using a typed localparam declaration. If this is replaced with
localparam WID = 16;
everything works fine. Looking at the code, I have so far traced to the problem to @visit(AstVarRef* nodep, AstNUser*)@ in @V3Const.cpp@. I'm working on a fix, but in the meantime, please pull a test case from branch param-module at git@github.com:jeremybennett/verilator.git
The text was updated successfully, but these errors were encountered:
Original Redmine Comment
Author Name: Jeremy Bennett (@jeremybennett)
Original Date: 2013-01-18T16:20:15Z
OK - I'm homing in on the problem. Looks like Verilator treats logic as signed by default, whereas it should be unsigned (IEEE 1800-2009 section 6.9.1). So in a 5-bit parameter decimal 16 is actually decimal -16. Watch this space for the fix...
Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-01-19T02:38:41Z
This is a fun case because the parent module has a 5 bit unsigned parameter, which type mismatches with the child's parameter. While that's very interesting it turns out to have nothing to do with the bug - it's simply that dtypeChgWidthSigned had a bool third parameter which should have been V3Numeric, this caused some unsigned numbers to become signed; I had to add several prints before I noticed as C++ simply did implied type conversion on it.
Author Name: Jeremy Bennett (@jeremybennett)
Original Redmine Issue: 606 from https://www.veripool.org
Original Date: 2013-01-18
Original Assignee: Wilson Snyder (@wsnyder)
The following code has a module parameterized with a typed localparam and triggers a compilation error.
A number of warnings and errors follow, starting with:
Verilator appears to mis-evaluate the localparam @width@ as -16 (rather than 16) when used in the test module to set the value of @msb@. The problem appears to be with using a typed localparam declaration. If this is replaced with
localparam WID = 16;
everything works fine. Looking at the code, I have so far traced to the problem to @visit(AstVarRef* nodep, AstNUser*)@ in @V3Const.cpp@. I'm working on a fix, but in the meantime, please pull a test case from branch param-module at git@github.com:jeremybennett/verilator.git
The text was updated successfully, but these errors were encountered: