SpinalHDL / SpinalHDL/SpinalHDL

SpinalHDL does not support Verilator 5.0

Open
#1,919 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
2k
Forks
391
Avg merge
1d 22h
Merged PRs (30d)
5

Description

Hello, I have noticed that SpinalHDL does not support Verilator 5.0; using Verilator 5.0 results in an error.

[info] [Progress] Verilator compilation started
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:80:5: error: ‘WData’ does not name a type; did you mean ‘SData’?
[info]    80 |     WData *raw;
[info]       |     ^~~~~
[info]       |     SData
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:85:28: error: expected ‘)’ before ‘*’ token
[info]    85 |     WDataSignalAccess(WData *raw, uint32_t width, bool sint) :
[info]       |                      ~     ^~
[info]       |                            )
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp: In member function ‘virtual uint64_t WDataSignalAccess::getU64_mem(size_t)’:
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:89:7: error: ‘WData’ was not declared in this scope; did you mean ‘SData’?
[info]    89 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |       ^~~~~
[info]       |       SData
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:89:14: error: ‘mem_el’ was not declared in this scope; did you mean ‘memset’?
[info]    89 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |              ^~~~~~
[info]       |              memset
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:89:25: error: ‘raw’ was not declared in this scope
[info]    89 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |                         ^~~
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp: In member function ‘virtual void WDataSignalAccess::setU64_mem(uint64_t, size_t)’:
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:96:7: error: ‘WData’ was not declared in this scope; did you mean ‘SData’?
[info]    96 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |       ^~~~~
[info]       |       SData
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:96:14: error: ‘mem_el’ was not declared in this scope; did you mean ‘memset’?
[info]    96 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |              ^~~~~~
[info]       |              memset
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:96:25: error: ‘raw’ was not declared in this scope
[info]    96 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |                         ^~~
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp: In member function ‘virtual void WDataSignalAccess::getAU8_mem(JNIEnv*, jbyteArray, size_t)’:
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:112:7: error: ‘WData’ was not declared in this scope; did you mean ‘SData’?
[info]   112 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |       ^~~~~
[info]       |       SData
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:112:14: error: ‘mem_el’ was not declared in this scope; did you mean ‘memset’?
[info]   112 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |              ^~~~~~
[info]       |              memset
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:112:25: error: ‘raw’ was not declared in this scope
[info]   112 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |                         ^~~
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp: In member function ‘virtual void WDataSignalAccess::setAU8_mem(JNIEnv*, jbyteArray, int, size_t)’:
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:130:7: error: ‘WData’ was not declared in this scope; did you mean ‘SData’?
[info]   130 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |       ^~~~~
[info]       |       SData
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:130:14: error: ‘mem_el’ was not declared in this scope; did you mean ‘memset’?
[info]   130 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |              ^~~~~~
[info]       |              memset
[info] ../verilator/VMyTopLevel__spinalWrapper.cpp:130:25: error: ‘raw’ was not declared in this scope
[info]   130 |       WData *mem_el = &(raw[index*wordsCount]);
[info]       |                         ^~~
[info] make: *** [VMyTopLevel.mk:79: VMyTopLevel__spinalWrapper.o] Error 1
[info] make: *** Waiting for unfinished jobs....
[error] Exception in thread "main" java.lang.AssertionError: assertion failed: Verilator C++ model compilation failed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using Verilator 5.0 and inspect the generated VMyTopLevel__spinalWrapper.cpp, where the missing WData type is reported during compilation. Compare the generated wrapper and Verilator 5.0 expectations, then verify that the C++ model compiles successfully without the reported assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, scala
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.