We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Author Name: Ralf Karge Original Redmine Issue: 44 from https://www.veripool.org Original Date: 2008-11-19 Original Assignee: Wilson Snyder (@wsnyder)
I received new RTL code that causes Verilator to generate illegal C-code. Attached a small test case triggering the same problem.
$ perl $VERILATOR_ROOT/bin/verilator --cc -x-assign 0 --stats -Wno-WIDTH tb_ip_shell.v
$ cd obj_dir
$ make -f Vtb_ip_shell.mk
g++ -I. -MMD -I/cygdrive/c/Projects/Verilator-3.681/include -DVL_PRINTF=printf -DVM_TRACE=0 -DVM_COVERAGE=0 -c -o Vtb_ip_shell__ALLcls.o Vtb_ip_shell__ALLcls.cpp In file included from Vtb_ip_shell__ALLcls.cpp:1: Vtb_ip_shell.cpp: In static member function static void Vtb_ip_shell::_sequent__TOP__1(Vtb_ip_shell__Syms*)': Vtb_ip_shell.cpp:127: error: invalid types SData[int]' for array subscript Vtb_ip_shell.cpp:128: error: invalid types SData[int]' for array subscript Vtb_ip_shell.cpp:129: error: invalid types SData[int]' for array subscript Vtb_ip_shell.cpp:130: error: invalid types `SData[int]' for array subscript make: *** [Vtb_ip_shell__ALLcls.o] Error 1
static void Vtb_ip_shell::_sequent__TOP__1(Vtb_ip_shell__Syms*)': Vtb_ip_shell.cpp:127: error: invalid types
SData[int]' for array subscript Vtb_ip_shell.cpp:129: error: invalid types
The text was updated successfully, but these errors were encountered:
Original Redmine Comment Author Name: Wilson Snyder (@wsnyder) Original Date: 2008-11-19T14:43:19Z
The workaround for this is to move the "reg [9:0] p [3:0];" outside of the task; any array in tasks causes this.
The patch is below; this is in GIT and will be in the next release 3.682.
diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index 02dd792..d5f58b5 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -284,8 +284,12 @@ public: init(); combineType(type); if (examplep->rangep()) { + // Creating is faster than cloning; know have constant args setOp1p(new AstRange(fl, examplep->msb(), examplep->lsb())); } + if (examplep->arraysp()) { + setOp2p(examplep->arraysp()->cloneTree(true)); + } width(msb()-lsb()+1,0); } virtual ~AstVar() {}
Sorry, something went wrong.
wsnyder
No branches or pull requests
Author Name: Ralf Karge
Original Redmine Issue: 44 from https://www.veripool.org
Original Date: 2008-11-19
Original Assignee: Wilson Snyder (@wsnyder)
I received new RTL code that causes Verilator to generate illegal C-code. Attached a small test case triggering the same problem.
$ perl $VERILATOR_ROOT/bin/verilator --cc -x-assign 0 --stats -Wno-WIDTH tb_ip_shell.v
$ cd obj_dir
$ make -f Vtb_ip_shell.mk
g++ -I. -MMD -I/cygdrive/c/Projects/Verilator-3.681/include -DVL_PRINTF=printf -DVM_TRACE=0 -DVM_COVERAGE=0 -c -o Vtb_ip_shell__ALLcls.o Vtb_ip_shell__ALLcls.cpp
In file included from Vtb_ip_shell__ALLcls.cpp:1:
Vtb_ip_shell.cpp: In static member function
static void Vtb_ip_shell::_sequent__TOP__1(Vtb_ip_shell__Syms*)': Vtb_ip_shell.cpp:127: error: invalid types
SData[int]' for array subscriptVtb_ip_shell.cpp:128: error: invalid types
SData[int]' for array subscript Vtb_ip_shell.cpp:129: error: invalid types
SData[int]' for array subscriptVtb_ip_shell.cpp:130: error: invalid types `SData[int]' for array subscript
make: *** [Vtb_ip_shell__ALLcls.o] Error 1
The text was updated successfully, but these errors were encountered: