microsoft / cheriot-ibex

cheriot-ibex is a RTL implementation of CHERIoT ISA based on LowRISC's Ibex core.
Apache License 2.0
73 stars 14 forks source link

Importing from missing package 'cheri_pkg' when building cheriot-ibex. #2

Closed obnauticus closed 7 months ago

obnauticus commented 1 year ago

I'm trying to build cheriot IBEX to run in a verilator sim. I am running into issues with building this project and I am generally curious what the best way to build the CHERI core is?

Attempting to build with:

$ fusesoc --cores-root . run --target=lint --tool=verilator lowrisc:ibex:ibex_top_tracing

...Cut for verbose output...

INFO: Running pre_build script check_tool_requirements
INFO: Building simulation model
INFO: verilator -f lowrisc_ibex_ibex_top_tracing_0.1.vc -Wall --unroll-count 72

ERROR: %Error-PKGNODECL: ../src/lowrisc_ibex_ibex_tracer_0.1/rtl/ibex_tracer.sv:42:27: Package/class 'cheri_pkg' not found, and needs to be predeclared (IEEE 1800-2017 26.3)
   42 | module ibex_tracer import cheri_pkg::*; # (
      |                           ^~~~~~~~~
                  ... For error description see https://verilator.org/warn/PKGNODECL?v=5.009
%Error: ../src/lowrisc_ibex_ibex_tracer_0.1/rtl/ibex_tracer.sv:42:27: Importing from missing package 'cheri_pkg'
   42 | module ibex_tracer import cheri_pkg::*; # (
      |                           ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_cs_registers.sv:19:33: Importing from missing package 'cheri_pkg'
   19 | module ibex_cs_registers import cheri_pkg::*;  #(
      |                                 ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_decoder.sv:20:28: Importing from missing package 'cheri_pkg'
   20 | module ibex_decoder import cheri_pkg::*; #(
      |                            ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_id_stage.sv:24:29: Importing from missing package 'cheri_pkg'
   24 | module ibex_id_stage import cheri_pkg::*; #(
      |                             ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_if_stage.sv:19:49: Importing from missing package 'cheri_pkg'
   19 | module ibex_if_stage import ibex_pkg::*; import cheri_pkg::*; #(
      |                                                 ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_load_store_unit.sv:21:36: Importing from missing package 'cheri_pkg'
   21 | module ibex_load_store_unit import cheri_pkg::*; #(
      |                                    ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_wb_stage.sv:22:29: Importing from missing package 'cheri_pkg'
   22 | module ibex_wb_stage import cheri_pkg::*; #(
      |                             ^~~~~~~~~
%Error: ../src/lowrisc_ibex_ibex_core_0.1/rtl/ibex_core.sv:22:45: Importing from missing package 'cheri_pkg'
   22 | module ibex_core import ibex_pkg::*; import cheri_pkg::*; #(
      |                                             ^~~~~~~~~
%Error: Exiting due to 9 error(s)
        ... See the manual at https://verilator.org/verilator_doc.html for more assistance.
make: *** [Makefile:16: Vibex_top_tracing.mk] Error 1

ERROR: Failed to build lowrisc:ibex:ibex_top_tracing:0.1 : '['make', '-j', '16', 'Vibex_top_tracing.mk']' exited with an error: 2

I presume there are some modifications that need to be made. README-cheri.md isn't super clear either what needs to be done here to get this running.

My Environment

EDA tool and version: fusesoc version 0.1 verilator version 5.009 devel rev v5.008-103-g7e1980af7

Operating system: Debian GNU/Linux Linux kernel 5.19.11

Version of the Ibex source code: 27a83d15afd5014f0537e364e0bcee8fc6ecbb07

kliuMsft commented 1 year ago

My apologies, I haven't yet found the bandwidth to support the fusesoc/verilator flow (have been using vcs mostly). Looks like the issue you ran into is a file list generation problem. The *.core files needs to updated (probably add a cheri_pkg.core and update the ibex_top.core and ibex_core.core files to add the new chereiot-specific files (as in the Readme). I will try to find some time for that, meanwhile feel free to experiment on your own. BTW if you are interested in contributing, please do let me know, we can for sure use some good help..

davidchisnall commented 1 year ago

@obnauticus, were you able to build it? Are you able to share your configuration?