Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

Issue #1592

$value_plusargs compile error for [1..16]-bit signals

Added by Garrett Smith about 1 month ago. Updated 2 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
% Done:

0%


Description

Passing signals of length <= 16 bits to $value$plusargs results in compiler errors due to missing overloads for CData and SData. The variable of type vluint8_t or vluint16_t will not bind to a vluint32_t reference:

VsimTop.cpp: In static member function _static void VsimTop::_initial__TOP__5(VsimTop__Syms*)_:
VsimTop.cpp:3537:16: error: invalid initialization of non-const reference of type _IData& {aka unsigned int&}_ from an rvalue of type _IData {aka unsigned int}_
        vlTOPp->simTop__DOT__test);}
                ^
In file included from VsimTop.h:11:0,
                 from VsimTop.cpp:5,
                 from VsimTop__ALLcls.cpp:3:
/path/to/verilator-4.012/share/verilator/include/verilated_heavy.h:77:14: note:   initializing argument 3 of _IData VL_VALUEPLUSARGS_INI(int, const string&, IData&)_
 inline IData VL_VALUEPLUSARGS_INI(int rbits, const std::string& ld, IData& rdr) VL_MT_SAFE {

This was resolved by overloading VL_VALUEPLUSARGS_INI for CData and SData: https://github.com/gcsmith/verilator/commit/b1ad0b2551079ec892369211a6381a038b3b5cf4

History

#1 Updated by Wilson Snyder about 1 month ago

  • Status changed from New to Confirmed
  • Assignee set to Garrett Smith

Great, love getting bugs with fixes included!

Two minor things to add to your patch so I can merge it and make sure it stays fixed. First, please add your name to docs/CONTRIBUTORS, see docs/CONTRIBUTING.adoc for more info. 2. Please update one of the tests, e.g. t_sys_plusargs.v to show the problem.

Thanks again.

#2 Updated by Wilson Snyder 8 days ago

Would you be willing to make the changes suggested earlier (test & add your name to contributors) so this can get in the next release? Thanks.

#3 Updated by Garrett Smith 7 days ago

Sorry for the delay. I was waiting to hear back from my company's legal department regarding open source contributions.

I'll submit the requested changes shortly.

#4 Updated by Garrett Smith 7 days ago

Pull request: https://github.com/verilator/verilator/pull/6

#5 Updated by Wilson Snyder 7 days ago

  • Status changed from Confirmed to Resolved

Fixed in git towards eventual 4.024 release.

#6 Updated by Wilson Snyder 2 days ago

  • Status changed from Resolved to Closed

In 4.024.

Also available in: Atom