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

"Quick'n'dirty FuseSoC+cocotb example" gives compile errors #3

Closed
stdefeber opened this issue Jun 14, 2024 · 5 comments
Closed

"Quick'n'dirty FuseSoC+cocotb example" gives compile errors #3

stdefeber opened this issue Jun 14, 2024 · 5 comments

Comments

@stdefeber
Copy link

stdefeber commented Jun 14, 2024

As wannabe fusesoc user I wanted to start of with the given FuseSoc+CoCoTb example. However I got compile errors.

poetry run fusesoc library add fusesocotb https://github.com/olofk/fusesocotb
poetry run fusesoc library add fusesoc_cores https://github.com/fusesoc/fusesoc-cores
poetry run fusesoc run axis_send_packet --vcd
poetry run fusesoc run axis_send_packet --vcd
INFO: Preparing ::vlog_tb_utils:1.1-r1
INFO: Preparing ::axis_send_packet:0
iverilog -saxis_send_packet -svlog_tb_utils -c axis_send_packet_0.scr -o axis_send_packet_0
:0: error: parameter `DW` not found in `vlog_tb_utils`.
:0: error: parameter `MSG_LEN` not found in `vlog_tb_utils`.
:0: error: parameter `MSG_STR` not found in `vlog_tb_utils`.
4 error(s) during elaboration.
make: *** [Makefile:8: axis_send_packet_0] Error 4

Environment:

  • Ubuntu 23.10
  • Icarus Verilog version 12.0 (stable)
  • Poetry (version 1.8.2)

Installed packages via poetry:

  • python = ">=3.9,<4"
  • wheel = "^0.38.4"
  • cocotb = "1.7.2"
  • cocotb-bus = "^0.2.0"
  • cocotb-test = "0.2.2"
  • fusesoc=">=1.10"

I found that the parameters are defined "axis_send_packet.v"

parameter DW = 8,
parameter MSG_LEN = 2,
parameter MSG_STR = "aa"

What am I missing/doing wrong ?

br,

ST

@stdefeber
Copy link
Author

One step futher.

parameters DW, MSG_LEN and MSG_STR are indeed no part of vlog_tb_utils.

Running the example with:

fusesoc run axis_send_packet --vcd

still gives compile errors:

poetry run fusesoc run axis_send_packet --vcd

However:

poetry run fusesoc run axis_send_packet --MSG_LEN=11 --MSG_STR=hello_world

Gives a pass. However I got no VCD file. Which is obvious since this is taken care of in vlog_tb_utils.

@olofk
Copy link
Owner

olofk commented Jun 14, 2024

This was caused by a change in Icarus Verilog where a previous warning now is an error. I just filed steveicarus/iverilog#1137 in the hope that this can be downgraded to a warning again. We can add a workaround in the meantime, but they will be a bit more clunky compared to the current solution.

Long term there should be syntax in FuseSoC to select which parameters that goes to which toplevel, but there are other things that are of higher priority to fix. A quick workaround is to change the toplevel line from toplevel : [axis_send_packet, vlog_tb_utils] to toplevel : axis_send_packet but that will also not give you a VCD.

I will come up with a better temporary workaround soon.

@olofk
Copy link
Owner

olofk commented Jun 14, 2024

I pushed some fixes now. Please let me know if those solve your issues.

@stdefeber
Copy link
Author

The fix works.

Isn't it possible to have the vlog_tb_utils as an include file ?

@olofk
Copy link
Owner

olofk commented Aug 22, 2024

Yes, it could be an include file, but that's not how it is currently implemented. Either way, closing now.

@olofk olofk closed this as completed Aug 22, 2024
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