mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-28 01:32:49 -04:00
Add support for using branch as CVW_GIT and use 1 as enable for knobs.
This commit is contained in:
parent
29c19d9cb4
commit
9d91b9d6f2
4 changed files with 36 additions and 15 deletions
|
@ -9,6 +9,7 @@ USER root
|
||||||
|
|
||||||
COPY --chown=${USERNAME}:${USERNAME} . /home/${USERNAME}
|
COPY --chown=${USERNAME}:${USERNAME} . /home/${USERNAME}
|
||||||
RUN chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
|
RUN chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}
|
||||||
|
RUN chown -R ${USERNAME}:${USERNAME} /home/${USERNAME}/cvw
|
||||||
|
|
||||||
USER ${USERNAME}
|
USER ${USERNAME}
|
||||||
WORKDIR /home/${USERNAME}/cvw
|
WORKDIR /home/${USERNAME}/cvw
|
||||||
|
|
18
docs/docker/Makefile
Normal file
18
docs/docker/Makefile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
QUESTA_HOME?=/cad/mentor/questa_sim-2023.4
|
||||||
|
CVW_GIT?=""
|
||||||
|
|
||||||
|
commanline:
|
||||||
|
podman run -it --rm \
|
||||||
|
-v cvw_temp:/home/cad/cvw \
|
||||||
|
-v $(QUESTA_HOME):/cad/mentor/questa_sim-xxxx.x_x \
|
||||||
|
--privileged --network=host \
|
||||||
|
wallysoc/regression_wally /bin/bash
|
||||||
|
|
||||||
|
regression_openhw_cvw:
|
||||||
|
podman run \
|
||||||
|
-e CVW_GIT=$(CVW_GIT) \
|
||||||
|
-e CLEAN_CVW=1 -e BUILD_RISCOF=1 -e RUN_QUESTA=1 \
|
||||||
|
-v cvw_temp:/home/cad/cvw \
|
||||||
|
-v $(QUESTA_HOME):/cad/mentor/questa_sim-xxxx.x_x \
|
||||||
|
--privileged --network=host \
|
||||||
|
--rm wallysoc/regression_wally
|
|
@ -21,7 +21,7 @@ If you have any other questions, please read the [troubleshooting]() first.
|
||||||
- `xhost +localhost:${USER}` for host
|
- `xhost +localhost:${USER}` for host
|
||||||
- [x] Regression Script
|
- [x] Regression Script
|
||||||
- [x] Configure the license for Questa
|
- [x] Configure the license for Questa
|
||||||
- [ ] Change the condition from empty string to 1
|
- [x] Change the condition from empty string to 1
|
||||||
- [x] Add linux testvector-generation
|
- [x] Add linux testvector-generation
|
||||||
- [x] Estimate the useless building intermediate files
|
- [x] Estimate the useless building intermediate files
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ podman volume create cvw_temp
|
||||||
|
|
||||||
# run regression on the OpenHW/cvw
|
# run regression on the OpenHW/cvw
|
||||||
podman run \
|
podman run \
|
||||||
-e CLEAN_CVW= -e BUILD_RISCOF= -e RUN_QUESTA= \
|
-e CLEAN_CVW=1 -e BUILD_RISCOF=1 -e RUN_QUESTA=1 \
|
||||||
-v cvw_temp:/home/cad/cvw \
|
-v cvw_temp:/home/cad/cvw \
|
||||||
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
||||||
--privileged --network=host \
|
--privileged --network=host \
|
||||||
|
@ -106,7 +106,7 @@ podman run \
|
||||||
|
|
||||||
# run regression on the Karl-Han/cvw
|
# run regression on the Karl-Han/cvw
|
||||||
podman run \
|
podman run \
|
||||||
-e CLEAN_CVW= -e BUILD_RISCOF= -e RUN_QUESTA= \
|
-e CLEAN_CVW=1 -e BUILD_RISCOF=1 -e RUN_QUESTA=1 \
|
||||||
-e CVW_GIT=https://github.com/Karl-Han/cvw \
|
-e CVW_GIT=https://github.com/Karl-Han/cvw \
|
||||||
-v cvw_temp:/home/cad/cvw \
|
-v cvw_temp:/home/cad/cvw \
|
||||||
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
||||||
|
@ -115,7 +115,7 @@ podman run \
|
||||||
|
|
||||||
# get into the container command line to debug or reading files
|
# get into the container command line to debug or reading files
|
||||||
podman run -it \
|
podman run -it \
|
||||||
-e RUN_QUESTA= \
|
-e RUN_QUESTA=1 \
|
||||||
-v cvw_temp:/home/cad/cvw \
|
-v cvw_temp:/home/cad/cvw \
|
||||||
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x \
|
||||||
--privileged --network=host \
|
--privileged --network=host \
|
||||||
|
@ -242,10 +242,10 @@ There are three main knobs:
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
- CVW_GIT: git clone address, only main branch supported
|
- CVW_GIT: git clone address
|
||||||
- CLEAN_CVW: declared with empty string to clone
|
- CLEAN_CVW: clone CVW_GIT if enabled with `-e CLEAN_CVW=1`
|
||||||
- BUILD_RISCOF: declared with empty string to rebuild RISCOF
|
- BUILD_RISCOF: rebuild RISCOF if enabled with `-e BUILD_RISCOF=1`
|
||||||
- RUN_QUESTA: declared with empty string to run vsim to check
|
- RUN_QUESTA: run vsim to check if enabled with `-e RUN_QUESTA=1`
|
||||||
- QUESTA: home folder for mounted QuestaSIM `/cad/mentor/questa_sim-xxxx.x_x` if enabled
|
- QUESTA: home folder for mounted QuestaSIM `/cad/mentor/questa_sim-xxxx.x_x` if enabled
|
||||||
- for example, if your vsim is in `/cad/mentor/questa_sim-2023.4/questasim/bin/vsim` then your local QuestaSIM folder is `/cad/mentor/questa_sim-2023.4`, so you have to add `-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x -e RUN_QUESTA=1`
|
- for example, if your vsim is in `/cad/mentor/questa_sim-2023.4/questasim/bin/vsim` then your local QuestaSIM folder is `/cad/mentor/questa_sim-2023.4`, so you have to add `-v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x -e RUN_QUESTA=1`
|
||||||
|
|
||||||
|
@ -295,8 +295,7 @@ There are stages in the old Dockerfile:
|
||||||
Description: permission problem in `/home/$USERNAME/cvw`.
|
Description: permission problem in `/home/$USERNAME/cvw`.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
$ podman run -v cvw_temp:/home/cad/cvw -e CLEAN_CVW= -e BUILD_RISCOF= -e RUN_QUESTA= -v /cad/mentor/que
|
$ podman run -v cvw_temp:/home/cad/cvw -e CLEAN_CVW=1 -e BUILD_RISCOF=1 -e RUN_QUESTA=1 -v /cad/mentor/questa_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x --rm wallysoc/regression_wally
|
||||||
sta_sim-2023.4:/cad/mentor/questa_sim-xxxx.x_x --rm wallysoc/regression_wally
|
|
||||||
No CVW_GIT is provided
|
No CVW_GIT is provided
|
||||||
rm: cannot remove '/home/cad/cvw': Device or resource busy
|
rm: cannot remove '/home/cad/cvw': Device or resource busy
|
||||||
Cloning into '/home/cad/cvw'...
|
Cloning into '/home/cad/cvw'...
|
||||||
|
|
|
@ -17,12 +17,14 @@ if [ -z "${CVW_GIT}" ]; then
|
||||||
export CVW_GIT="https://github.com/openhwgroup/cvw"
|
export CVW_GIT="https://github.com/openhwgroup/cvw"
|
||||||
else
|
else
|
||||||
echo "Using customized CVW_GIT: ${CVW_GIT}"
|
echo "Using customized CVW_GIT: ${CVW_GIT}"
|
||||||
|
# support specific branch now
|
||||||
|
export CVW_GIT=$(echo ${CVW_GIT} | sed -E "s/tree\// -b /g")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git config --global http.version HTTP/1.1
|
git config --global http.version HTTP/1.1
|
||||||
|
|
||||||
# if cvw is not available or CLEAN_CVW(empty string) is defined
|
# if cvw is not available or CLEAN_CVW(empty string) is defined
|
||||||
if [[ ! -f "/home/${USERNAME}/cvw/setup.sh" ]] || [[ -z "${CLEAN_CVW-x}" ]]; then
|
if [[ ! -f "/home/${USERNAME}/cvw/setup.sh" ]] || [[ "${CLEAN_CVW}" -eq 1 ]]; then
|
||||||
cd /home/${USERNAME} && rm -rf /home/${USERNAME}/cvw
|
cd /home/${USERNAME} && rm -rf /home/${USERNAME}/cvw
|
||||||
git clone --recurse-submodules ${CVW_GIT} /home/${USERNAME}/cvw
|
git clone --recurse-submodules ${CVW_GIT} /home/${USERNAME}/cvw
|
||||||
# if failed to clone submodules for some reason, please run `git submodule update`
|
# if failed to clone submodules for some reason, please run `git submodule update`
|
||||||
|
@ -46,11 +48,11 @@ export QUESTAPATH=/cad/mentor/questa_sim-xxxx.x_x/questasim/bin
|
||||||
|
|
||||||
cd ${CVW_HOME}
|
cd ${CVW_HOME}
|
||||||
# build it only if BUILD_RISCOF is defined with empty string
|
# build it only if BUILD_RISCOF is defined with empty string
|
||||||
if [[ -z "${BUILD_RISCOF-x}" ]]; then
|
if [[ "${BUILD_RISCOF}" -eq 1 ]]; then
|
||||||
make install && make riscof && make testfloat
|
make install && make riscof && make testfloat
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${RUN_QUESTA-x}" ]] ; then
|
if [[ "${RUN_QUESTA}" -eq 1 ]] ; then
|
||||||
if [ ! -f "${QUESTA}/questasim/bin/vsim" ]; then
|
if [ ! -f "${QUESTA}/questasim/bin/vsim" ]; then
|
||||||
echo "Cannot find vsim with ${QUESTA}/questasim/bin/vsim"
|
echo "Cannot find vsim with ${QUESTA}/questasim/bin/vsim"
|
||||||
else
|
else
|
||||||
|
@ -64,6 +66,7 @@ make coverage
|
||||||
make benchmarks
|
make benchmarks
|
||||||
|
|
||||||
if [[ ! NO_VERILATOR -eq 1 ]]; then
|
if [[ ! NO_VERILATOR -eq 1 ]]; then
|
||||||
cd ${CVW_HOME}/sim/verilator && verilator -GTEST="\"arch64i\"" -DVERILATOR=1 --timescale "1ns/1ns" --timing --binary --top-module testbench -I${CVW_HOME}/config/shared -I${CVW_HOME}/config/rv64gc ${CVW_HOME}/src/cvw.sv ${CVW_HOME}/testbench/testbench.sv ${CVW_HOME}/testbench/common/*.sv ${CVW_HOME}/src/*/*.sv ${CVW_HOME}/src/*/*/*.sv --relative-includes
|
make -C sim/verilator run
|
||||||
${CVW_HOME}/sim/verilator/obj_dir/Vtestbench
|
# by default it runs the arch64i on rv64gc
|
||||||
|
cat ${CVW_HOME}/sim/verilator/logs/rv64gc_arch64i.log
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue