Skip to content
New issue

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

Step 17 of FROM_BLINKER_TO_RISCV doesn't work for ULX3S #65

Open
samontab opened this issue Apr 26, 2022 · 5 comments
Open

Step 17 of FROM_BLINKER_TO_RISCV doesn't work for ULX3S #65

samontab opened this issue Apr 26, 2022 · 5 comments

Comments

@samontab
Copy link

I was following FROM_BLINKER_TO_RISCV tutorial on a ULX3S, and it all started great but when trying to run step 17 on the board it says:

BOARDS/run_ulx3s.sh step17.v

step17.v:455: ERROR: Unimplemented compiler directive or undefined macro `CPU_FREQ.

I checked and indeed BOARDS/run_ulx3s.sh doesn't have CPU_FREQ defined while BOARDS/run_icestick.sh has it.

I tried defining it with some values, but then more issues appeared which I'm not sure how to solve:

ERROR: Module \femtoPLL' referenced in module \Clockworks' in cell `\genblk1.pll' is not part of the design.

Any help would be great.

@BrunoLevy
Copy link
Owner

Thank you for notifying this !
I have pushed a new version (-DULX3S was missing on command line), would you test it ?

@BrunoLevy
Copy link
Owner

(note: it will work until step 22, I still need to do something for SPI flash, will do that shortly...)

@samontab
Copy link
Author

samontab commented May 6, 2022

Thanks for the fix.

Most steps now work on the ULX3S but I had a couple of problems with verilator. Here's what I experienced:

Step 17 now works on the ULX3S correctly.

Step 18 also works on the ULX3S, but I found a small issue. If you're using screen as the terminal the output doesn't align correctly:

terminals

Step 19 doesn't work:

verilator -DBENCH -DBOARD_FREQ=12 -Wno-fatal --top-module SOC -cc -exe sim_main.cpp step18.v

%Error: step18.v:549:20: Define or directive not defined: '`CPU_FREQ'
  549 |       .clk_freq_hz(`CPU_FREQ*1000000),
      |                    ^~~~~~~~~
        step18.v:8:1: ... note: In file included from step18.v
%Error: step18.v:549:29: syntax error, unexpected '*', expecting TYPE-IDENTIFIER
  549 |       .clk_freq_hz(`CPU_FREQ*1000000),
      |                             ^
        step18.v:8:1: ... note: In file included from step18.v
%Error: Exiting due to 2 error(s)

Tried adding the same -DULX3S flag but it doesn't fix it.

Step 20 works until this part:

./run_verilator.sh step20.v


g++  -I.  -MMD -I/opt/oss-cad-suite/share/verilator/include -I/opt/oss-cad-suite/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -DVM_TRACE_FST=0 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -I../../../FIRMWARE/LIBFEMTORV32 -DSTANDALONE_FEMTOELF  -std=gnu++14 -Os -c -o femto_elf.o ../../../FIRMWARE/LIBFEMTORV32/femto_elf.c
g++  -I.  -MMD -I/opt/oss-cad-suite/share/verilator/include -I/opt/oss-cad-suite/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=0 -DVM_TRACE_FST=0 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -I../../../FIRMWARE/LIBFEMTORV32 -DSTANDALONE_FEMTOELF  -std=gnu++14 -Os -c -o sim_main.o ../sim_main.cpp
../sim_main.cpp: In function ‘int main(int, char**, char**)’:
../sim_main.cpp:13:37: error: ‘class VSOC’ has no member named ‘SOC__DOT__RAM__DOT__MEM’
   13 |    void* simulated_RAM = (void*)top.SOC__DOT__RAM__DOT__MEM;
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~
make: *** [VSOC.mk:66: sim_main.o] Error 1
./run_verilator.sh: line 4: obj_dir/VSOC: No such file or directory

The board itself(BOARDS/run_ulx3s.sh step20.v) works fine. I was able to compile mandelbrot.S and it runs correctly on the ULX3S.

For Step 21 the same thing happened. It works fine on the ULX3S but verilator has the same error as in Step 20.

Step 22 is as you mention still not working:

BOARDS/run_ulx3s.sh step22.v

ERROR: Module `MappedSPIFlash' referenced in module `SOC' in cell `SPIFlash' does not have a port named 'IO'.

@BrunoLevy
Copy link
Owner

Yes, I still need to port different things on the ULX3S. Main thing is the SPI Flash pin multiplexed that needs a special primitive, I will need to insert a layer between the SOC and the ULX3S, now working on doing that without making the whole design too complicated....

@BrunoLevy
Copy link
Owner

  • Normally, all the steps up to step 21 (included) work in icarus, verilator and on the ULX3S
    (using run.sh, run_verilator.sh and BOARDS/run_ULX3S.sh), please tell me if it is not the case
  • Step 22 and later don't work (because they use SPI Flash for which I need to do something special on the ULX3S and in simulation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants