diff --git a/ci/ibex-rtl-ci-steps.yml b/ci/ibex-rtl-ci-steps.yml index c4de904d..bbcc6ca7 100644 --- a/ci/ibex-rtl-ci-steps.yml +++ b/ci/ibex-rtl-ci-steps.yml @@ -67,10 +67,6 @@ steps: displayName: Run RISC-V Compliance test for Ibex RV32IMC for ${{ config }} - bash: | - # Setup environment to use cosim with Simple System - export IBEX_COSIM_ISS_ROOT=/opt/spike-cosim - export LD_LIBRARY_PATH=/opt/spike-cosim/lib:$LD_LIBRARY_PATH - # Build simple system with co-simulation fusesoc --cores-root=. run --target=sim --setup --build lowrisc:ibex:ibex_simple_system_cosim $IBEX_CONFIG_OPTS diff --git a/doc/03_reference/cosim.rst b/doc/03_reference/cosim.rst index 3c9eb880..0d5a3b71 100644 --- a/doc/03_reference/cosim.rst +++ b/doc/03_reference/cosim.rst @@ -28,13 +28,12 @@ Setup and Usage Clone the `lowRISC fork of Spike `_ and check out the ``ibex-cosim-v0.2`` tag. Other, later, versions called ``ibex-cosim-v*`` may also work but there's no guarantee of backwards compatibility. Follow the Spike build instructions to build and install Spike. -The build will install multiple header files and libraries, it is recommended a custom install location (using ``--prefix=`` with ``configure``) is used to avoid cluttering system directories. The ``--enable-commitlog`` and ``--enable-misaligned`` options must be passed to ``configure``. +We recommend using a custom install location (using ``--prefix=`` with ``configure``) to avoid cluttering system directories. +Note that, if you do this, you will also need to add an entry to ``PKG_CONFIG_PATH`` so that ``pkg-config`` can tell us how to build against the installed Spike libraries. -Once built, the ``IBEX_COSIM_ISS_ROOT`` environment variable must be set to the Spike root install directory (as given by ``--prefix=`` to ``configure``) in order to build either the UVM DV environment or Simple System with co-simulation support. - -To build/run the UVM DV environment with the co-simulator add the ``COSIM=1`` argument to the make command. -To build Simple System with the co-simulator build the ``lowrisc:ibex:ibex_simple_system_cosim`` core. +To build/run the UVM DV environment with the co-simulator, add the ``COSIM=1`` argument to the make command. +To build Simple System with the co-simulator, build the ``lowrisc:ibex:ibex_simple_system_cosim`` core. Quick Build and Run Instructions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,9 +54,6 @@ Build and install the co-simulator ../configure --enable-commitlog --enable-misaligned --prefix=/opt/spike-cosim sudo make -j8 install - # Setup IBEX_COSIM_ISS_ROOT so build flow can find the co-simulator - export IBEX_COSIM_ISS_ROOT=/opt/spike-cosim - Run the UVM DV regression with co-simulation enabled .. code-block:: bash @@ -78,9 +74,6 @@ Build and run Simple System with the co-simulation enabled # any read of those CSRs results in a mismatch and a failure. make -C ./examples/sw/benchmarks/coremark SUPPRESS_PCOUNT_DUMP=1 - # Spike's libsoftfloat.so needs to be accessible so add it to LD_LIBRARY_PATH - export LD_LIBRARY_PATH=/opt/spike-cosim/lib:$LD_LIBRARY_PATH - # Run coremark binary with co-simulation checking build/lowrisc_ibex_ibex_simple_system_cosim_0/sim-verilator/Vibex_simple_system --meminit=ram,examples/sw/benchmarks/coremark/coremark.elf diff --git a/doc/03_reference/verification.rst b/doc/03_reference/verification.rst index 89beabab..06fe21a6 100644 --- a/doc/03_reference/verification.rst +++ b/doc/03_reference/verification.rst @@ -208,9 +208,6 @@ The entirety of this flow is controlled by the Makefile found at # Compile and run RTL simulation make TEST=xxx compile,rtl_sim - # Use a different ISS (default is spike) - make ... ISS=ovpsim - # Run a full regression with coverage make COV=1 diff --git a/dv/uvm/core_ibex/Makefile b/dv/uvm/core_ibex/Makefile index 4531e757..73657a3c 100644 --- a/dv/uvm/core_ibex/Makefile +++ b/dv/uvm/core_ibex/Makefile @@ -8,16 +8,6 @@ GEN_DIR := $(realpath ../../../vendor/google_riscv-dv) TOOLCHAIN := ${RISCV_TOOLCHAIN} export IBEX_ROOT := $(realpath ../../../) -ifeq ($(COSIM),1) -ifndef IBEX_COSIM_ISS_ROOT -$(error IBEX_COSIM_ISS_ROOT must be set to the root of a suitable spike build if COSIM=1) -else -# Spike builds a libsoftfloat.so shared library that the simulator binary needs. -# Set LD_LIBRARY_PATH so it can be found. -export LD_LIBRARY_PATH := $(IBEX_COSIM_ISS_ROOT)/lib/:${LD_LIBRARY_PATH} -endif -endif - # Explicitly ask for the bash shell SHELL := bash diff --git a/dv/uvm/core_ibex/yaml/rtl_simulation.yaml b/dv/uvm/core_ibex/yaml/rtl_simulation.yaml index 2748ee50..d7b3cd50 100644 --- a/dv/uvm/core_ibex/yaml/rtl_simulation.yaml +++ b/dv/uvm/core_ibex/yaml/rtl_simulation.yaml @@ -17,7 +17,7 @@ # As a result, passing -fno-extended-identifiers tells G++ to pretend that # everything is ASCII, preventing strange compilation errors. - tool: vcs - env_var: IBEX_COSIM_ISS_ROOT,IBEX_ROOT + env_var: SPIKE_CFLAGS,SPIKE_LDFLAGS,SPIKE_LIBS,IBEX_ROOT compile: cmd: - "vcs -f /ibex_dv.f -full64 @@ -46,11 +46,10 @@ cosim_opts: > -f /ibex_dv_cosim_dpi.f +define+INC_IBEX_COSIM - -LDFLAGS '-L/lib/' - -CFLAGS '-I/include' - -CFLAGS '-I/include/softfloat' + -LDFLAGS '' + -CFLAGS '' -CFLAGS '-I/dv/cosim' - -lriscv -lsoftfloat -lfdt -ldl -ldisasm -lstdc++ + -lstdc++ sim: cmd: > env SIM_DIR= diff --git a/dv/verilator/simple_system_cosim/ibex_cosim_setup_check.core b/dv/verilator/simple_system_cosim/ibex_cosim_setup_check.core index 17bc59dc..ae937162 100644 --- a/dv/verilator/simple_system_cosim/ibex_cosim_setup_check.core +++ b/dv/verilator/simple_system_cosim/ibex_cosim_setup_check.core @@ -3,7 +3,7 @@ CAPI=2: # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 name: "lowrisc:tool:ibex_cosim_setup_check:0.1" -description: "Check $IBEX_COSIM_ISS_ROOT is set" +description: "Check that Spike is installed properly for cosim" filesets: files_ibex_cosim_setup_check: