jamesbowman / swapforth

Swapforth is a cross-platform ANS Forth
BSD 3-Clause "New" or "Revised" License
275 stars 56 forks source link

simulator (verilator) does not compile #43

Closed bmentink closed 6 years ago

bmentink commented 7 years ago

I tried running "make bootstrap" for j1a .. but it fails ..

make bootstrap
make -C verilator
make[1]: Entering directory '/home/bmentink/Builds/SwapForth/swapforth/j1a/verilator'
Makefile:33: warning: overriding recipe for target '../build/nuc.hex'
Makefile:12: warning: ignoring old recipe for target '../build/nuc.hex'
verilator -Wall --cc -DVERILATOR=1 j1a.v ../verilog/*.v --top-module j1a --exe sim_main.cpp
make -C obj_dir CXXFLAGS="-fPIC" OPT_FAST="-O2" -f Vj1a.mk Vj1a
make[2]: Entering directory '/home/bmentink/Builds/SwapForth/swapforth/j1a/verilator/obj_dir'
g++ -fPIC -I.  -MMD -I/usr/share/verilator/include -I/usr/share/verilator/include/vltstd -DVL_PRINTF=printf -DVM_TRACE=0 -DVM_COVERAGE=0 -Wno-char-subscripts -Wno-parentheses-equality -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable      -O2 -c -o sim_main.o ../sim_main.cpp
../sim_main.cpp: In function ‘int main(int, char**)’:
../sim_main.cpp:23:12: error: ‘class Vj1a’ has no member named ‘v__DOT__ram_prog’; did you mean ‘j1a__DOT__ram_prog’?
       top->v__DOT__ram_prog[i] = v;
            ^~~~~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-parentheses-equality’
make[2]: *** [Vj1a.mk:65: sim_main.o] Error 1
make[2]: Leaving directory '/home/bmentink/Builds/SwapForth/swapforth/j1a/verilator/obj_dir'
make[1]: *** [Makefile:9: obj_dir/Vj1a] Error 2
make[1]: Leaving directory '/home/bmentink/Builds/SwapForth/swapforth/j1a/verilator'
make: *** [Makefile:8: bootstrap] Error 2
combinatorylogic commented 7 years ago

Verilator version?

jamesbowman commented 7 years ago

Right.. seems most likely.

My Verilator is 3.856 and after the build I get:

$ grep __DOT__ram_prog verilator/obj_dir/Vj1a.h 
        VL_SIG16(v__DOT__ram_prog[4096],15,0);
bmentink commented 7 years ago

The version giving the error is:

Verilator 3.886 2016-07-30 rev verilator_3_884-13-gb4a7e46

The grep above gives "VL_SIG16(j1aDOTram_prog[4096],15,0);"

bmentink commented 7 years ago

Can I give an other help?

RGD2 commented 7 years ago

Mine's Verilator 3.856 2014-03-11 rev verilator_3_855-19-g749ff02 Which works. If you're on debian you can downgrade to it - I'm just using the prebuilt version ubuntu/debian has. Possibly worth raising as a regression bug against Verilator - since the newer version breaks our code.

On Mon, Oct 17, 2016 at 8:23 AM, bmentink notifications@github.com wrote:

Can I give an other help?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jamesbowman/swapforth/issues/43#issuecomment-254075987, or mute the thread https://github.com/notifications/unsubscribe-auth/AO8-GIKedsskY7KlwWpOCeHxs53JhxMGks5q0pW9gaJpZM4KVMeZ .

-- Remy

combinatorylogic commented 7 years ago

There is a way to get the old naming back: just add an option --l2-name v to verilator. Did not try with the older versions though.

jamesbowman commented 7 years ago

Just tried it with my old Verilator (3.856):

%Error: Invalid Option: --l2-name
jamesbowman commented 7 years ago

Looks like this changed in 3.884:

http://www.veripool.org/projects/verilator/news