Skip to content

Instantly share code, notes, and snippets.

@yodalee
Created February 23, 2023 14:52
Show Gist options
  • Save yodalee/7b2d96216f98f50870bc7577d6aca28c to your computer and use it in GitHub Desktop.
Save yodalee/7b2d96216f98f50870bc7577d6aca28c to your computer and use it in GitHub Desktop.
Compiler Error of Generated code.
In file included from Vtest__ALL.cpp:6:
Vtest___024unit__DepSet_h9b08f7a8__0.cpp: In function 'std::string VL_TO_STRING(const Vtest_StructType__struct1&)':
Vtest___024unit__DepSet_h9b08f7a8__0.cpp:13:42: error: invalid user-defined conversion from 'const VlWide<8>' to 'int' [-fpermissive]
13 | out += "'{msg:" + VL_TO_STRING_W(obj.msg);
| ~~~~^~~
In file included from /home/yodalee/local/share/verilator/include/verilated.h:930,
from Vtest.h:11,
from Vtest.cpp:4,
from Vtest__ALL.cpp:3:
/home/yodalee/local/share/verilator/include/verilated_types.h:217:5: note: candidate is: 'VlWide<T_Words>::operator WDataInP() const [with long unsigned int T_Words = 8; WDataInP = const unsigned int*]' (near match)
217 | operator WDataInP() const VL_PURE { return &m_storage[0]; } // This also allows []
| ^~~~~~~~
/home/yodalee/local/share/verilator/include/verilated_types.h:217:5: note: no known conversion from 'WDataInP' {aka 'const unsigned int*'} to 'int'
In file included from Vtest__ALL.cpp:6:
Vtest___024unit__DepSet_h9b08f7a8__0.cpp:13:37: error: too few arguments to function 'std::string VL_TO_STRING_W(int, WDataInP)'
13 | out += "'{msg:" + VL_TO_STRING_W(obj.msg);
| ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /home/yodalee/local/share/verilator/include/verilated.h:930,
from Vtest.h:11,
from Vtest.cpp:4,
from Vtest__ALL.cpp:3:
/home/yodalee/local/share/verilator/include/verilated_types.h:50:20: note: declared here
50 | extern std::string VL_TO_STRING_W(int words, const WDataInP obj);
| ^~~~~~~~~~~~~~
In file included from Vtest__ALL.cpp:8:
Vtest___024root__DepSet_hc07518e4__0__Slow.cpp: In function 'void Vtest___024root___ctor_var_reset(Vtest___024root*)':
Vtest___024root__DepSet_hc07518e4__0__Slow.cpp:63:37: error: request for member 'msg' in 'vlSelf->Vtest___024root::in', which is of non-class type 'CData' {aka 'unsigned char'}
63 | VL_RAND_RESET_W(256, vlSelf->in.msg);
| ^~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment