Open jordankrim opened 3 months ago
Somehow the GLIBCXX was incorrect. I changed my g++ compiler from /opt/rh/gcc-toolset-13 to /opt/rh/gcc-toolset-13 in the sims/cep_cosim/common.make. This got me a little further but now I get this:
/mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/.conda-env/riscv-tools/bin/../lib/gcc/riscv64-unknown-elf/13.2.0/../../../../riscv64-unknown-elf/bin/ld: warning: riscv_wrapper.elf has a LOAD segment with RWX permissions /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/.conda-env/riscv-tools/bin/riscv64-unknown-elf-objdump -S -C -d -l -x riscv_wrapper.elf > riscv_wrapper.dump /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/.conda-env/riscv-tools/bin/riscv64-unknown-elf-objcopy -O binary --change-addresses=-0x80000000 riscv_wrapper.elf riscv_wrapper.img /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/scripts/smartelf2hex.sh riscv_wrapper.elf > riscv_wrapper.hex /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/bin/vpp.pl /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/aesMacro/c_dispatch 1 1 testHistory.txt 0 /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/aesMacro/aesMacro_sim_xrun.log 0 \""/mnt/data/cadtools/cds/xcelium/23.09.006/tools/bin/64bit/xrun -64bit -R -xmlibdirname /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/xcelium.d -afile /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/pli/v2c.tab -loadpli1 /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/lib/libvpp.so -sv_lib /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/lib/libvpp.so -loadvpi /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/xcelium.d/run.d/librun.so:boot -log /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/aesMacro/aesMacro_sim_xrun.log"\" use_gdb flags = 0 WARNING: testInfo file testHistory.txt does not exit..Creating one.. From Parent PID=3510491 From Child PID=3510496 EXEC: /mnt/data/cadtools/cds/xcelium/23.09.006/tools/bin/64bit/xrun -64bit -R -xmlibdirname /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/xcelium.d -afile /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/pli/v2c.tab -loadpli1 /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/lib/libvpp.so -sv_lib /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/lib/libvpp.so -loadvpi /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/xcelium.d/run.d/librun.so:boot -log /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/aesMacro/aesMacro_sim_xrun.log Executing /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/testSuites/bareMetalTests/aesMacro/c_dispatch 0x45682399 TOOL: xrun(64) 23.09-s006: Started on Aug 19, 2024 at 17:42:20 EDT xrun(64): 23.09-s006: (c) Copyright 1995-2024 Cadence Design Systems, Inc. Loading snapshot worklib.cep_tb:sv .................... Done __exit = jtag_tick( | xmsim: *F,NOFDPI (/mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/generated-src/chipyard.harness.TestHarness.CEPRocketConfig/gen-collateral/SimJTAG.v,76|32): Function jtag_tick not found in any of the shared object specified with -SV_LIB switch.** The corresponding import DPI declaration is done in file /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/generated-src/chipyard.harness.TestHarness.CEPRocketConfig/gen-collateral/SimJTAG.v at line no. 6. TOOL: xrun(64) 23.09-s006: Exiting on Aug 19, 2024 at 17:42:21 EDT (total: 00:00:01)
I have solved this issue myself. Some Makefiles changed to add some files (no idea why they are not being comiled already) and other fixes and needed to have env var LD_PRELOAD set to point to a compiled version of the GCC GLIBCXX (14) library. In order to semi-automate the process, I have made a Perl script that changes all the files necessary on CEP v4.5 and v4.7 to be able to run Xcelium and Verilator on the bareMetal Tests.
I go into for example sims/cep_cosim/testSuites/baremetaltests/aesMacro and do a: make all
The simulator seems to load OK but then it errors out. It looks initially like something is wrong in c_dispatch that didn't happen in v4.4. Then there is a fatal error with GLIB and another error with get_v2c_mail. Not sure why all these are occurring because v4.4 works fine:
CEP_COSIM: ---------------------------------------------------------------------- CEP_COSIM: Common Evaluation Platform Co-Simulation Environment
CEP_COSIM: ---------------------------------------------------------------------- CEP_COSIM: CEP_COSIM: Operating System: Red Hat Enterprise Linux 8.10 (Ootpa) CEP_COSIM: Running non-ASIC test with the following variables: CEP_COSIM: RISCV = /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/.conda-env/riscv-tools) CEP_COSIM: VMGR_PATH = /mnt/data/cadtools/cds/vmanager/23.09.002 CEP_COSIM: XCELIUM_INSTALL = /mnt/data/cadtools/cds/xcelium/23.09.006 CEP_COSIM: CHIPYARD_SUB_PROJECT = cep_cosim CEP_COSIM: CHIPYARD_CPU_COUNT = 4 CEP_COSIM: MODELSIM = 0 CEP_COSIM: CADENCE = 1 CEP_COSIM: DUT_SIM_MODE = BARE_MODE CEP_COSIM: RISCV_TESTS = 0 CEP_COSIM: NOWAVE = 1 CEP_COSIM: PROFILE = 0 CEP_COSIM: COVERAGE = 0 CEP_COSIM: USE_GDB = 0 CEP_COSIM: TL_CAPTURE = 0 CEP_COSIM: VIRTUAL_MODE = 0 CEP_COSIM: BYPASS_PLL = 0 CEP_COSIM: DISABLE_CHISEL_PRINTF = 1 CEP_COSIM: BAREMETAL_PRINTF = none CEP_COSIM: OPENOCD_ENABLE = 0 CEP_COSIM: NOLLKI_MODE = 0
/opt/rh/gcc-toolset-13/root/usr/bin/g++ -DRISCV_WRAPPER=\"./riscv_wrapper.img\" -DNOWAVE -DCHIPYARD_CPU_COUNT=4 -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/src -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/drivers/cep_tests -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/drivers/diag -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/share -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/simDiag -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/pli -I /mnt/data/cadtools/cds/xcelium/23.09.006/tools/include -DTL_CAPTURE=0 -DVECTOR_D=\"/mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/drivers/vectors\" -g -std=gnu++11 -I /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/../../.conda-env/include -L /mnt/data/projects/avalon/jkrim/cep_v4_7_test_verilator/CEP/sims/cep_cosim/../../.conda-env/lib -Wno-format -Wno-narrowing -DBIG_ENDIAN -DSIM_ENV_ONLY -D_SIM_SW_ENV -I. -c -o c_dispatch.o c_dispatch.cc c_dispatch.cc: In function ‘int main(int, char**)’: