From f8bdbfbb2bccf70d14bec9655c9ace4a1d4fac31 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sat, 30 Sep 2023 05:05:12 +0000 Subject: [PATCH] Resolve "Run simulation as part of ci" --- .gitlab-ci.yml | 19 ++++++++++++++++++- init_env.sh | 9 +++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5b77088..f66e279 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,6 +22,7 @@ variables: stages: # List of stages for jobs, and their order of execution - toolchain - build + - simulate build toolchain: tags: @@ -51,6 +52,10 @@ build sim: - iverilog - linux stage: build + artifacts: + paths: + - hw/efinix_fpga/simulation/sim_top + - hw/efinix_fpga/simulation/init_hex.mem script: - source init_env.sh - cd hw/efinix_fpga/simulation @@ -78,4 +83,16 @@ build kernel: - cd sw/ - make kernel dependencies: - - build toolchain \ No newline at end of file + - build toolchain + +run sim: + tags: + - linux + - iverilog + stage: simulate + script: + - source init_env.sh + - cd hw/efinix_fpga/simulation + - vvp sim_top + dependencies: + - build sim diff --git a/init_env.sh b/init_env.sh index 46419d9..443f828 100644 --- a/init_env.sh +++ b/init_env.sh @@ -3,6 +3,8 @@ # ENV=".env/$HOSTNAME" +export REPO_TOP=$(git rev-parse --show-toplevel) + # if [ ! -d "$ENV" ]; then # mkdir -p "$ENV" # fi @@ -19,8 +21,11 @@ # source "$ENV/efinity/2023.1/bin/setup.sh" # export PATH=$PATH:"$EFXPT_HOME/bin" -source $EFX_SETUP -export REPO_TOP=$(git rev-parse --show-toplevel) +if [ -n "$EFX_SETUP" ]; then + source $EFX_SETUP +else + echo "EFX_SETUP not defined!" +fi # python -m venv .user_venv --system-site-packages