Skip to content

Commit

Permalink
Fix CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micprog committed May 16, 2024
1 parent e17fd68 commit c3fc3be
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 65 deletions.
44 changes: 10 additions & 34 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,36 +111,6 @@ test_sequential_bare:
- cd sw/regression_tests/sequential_bare_tests/${TEST}
- make clean all run

test_ml:
stage: test
needs: [ build_rtl ]
parallel:
matrix:
- { TEST: mlDotp }
- { TEST: mlSchur }
- { TEST: mlGemm }
- { TEST: mlSin }
- { TEST: mlSvd }
- { TEST: mlButter }
- { TEST: mlGradDir }
- { TEST: mlRbf }
- { TEST: mlLog }
- { TEST: mlAxpy }
- { TEST: mlGivens }
- { TEST: mlWdotp }
- { TEST: mlDist }
- { TEST: mlGemv }
- { TEST: mlChol }
- { TEST: mlGrad }
- { TEST: mlDct }
script:
- echo "Running ml tests"
- make relink
- source sw/pulp-runtime/configs/pulpissimo_cv32.sh
- export VSIM_PATH=$PWD/build/questasim
- cd sw/regression_tests/ml_tests/${TEST}
- make clean all run

test_riscv:
stage: test
needs: [ build_rtl ]
Expand All @@ -152,18 +122,17 @@ test_riscv:
- { TEST: testMisaligned }
- { TEST: testALU }
- { TEST: testMAC3 }
- { TEST: testEventsFlex }
- { TEST: testVecArith }
- { TEST: testDotMul }
- { TEST: testVecLogic }
- { TEST: testComplex }
# - { TEST: testComplex }
- { TEST: testCnt }
- { TEST: testVecRelat }
- { TEST: testShufflePack }
- { TEST: testMUL }
- { TEST: testHWLP }
- { TEST: testMacNorm }
- { TEST: testDivRem }
# - { TEST: testDivRem }
- { TEST: testVariadic }
- { TEST: testMAC }
- { TEST: testLoadStore }
Expand Down Expand Up @@ -196,14 +165,16 @@ freertos_helloworld:
test_dm:
stage: test
before_script:
- source sw/pulp-runtime/configs/pulpissimo_cv32.sh
- make -C sw/regression_tests/hello clean all
script:
- echo "(Re)generating scripts with DPI disabled"
- make scripts
- echo "Setting up vsim path"
- export VSIM_PATH=$PWD/build/questasim
- echo "Running debug module testbench"
# Note that the program is irrelevant we just put something for it to not complain
- make build run_sim VSIM_FLAGS="+jtag_dm_tests +srec=../rtl/tb/srec/min.srec"
- riscv make build run_sim VSIM_USER_PLUSARGS="+jtag_dm_tests +srec_ignore_checksum" EXECUTABLE_PATH=sw/regression_tests/hello/build/test/test

fpga_synth_genesys2:
stage: test
Expand Down Expand Up @@ -381,6 +352,11 @@ spi_boot:
- printf "#include <stdio.h>\nint main(){\n printf(\"Hello World\\\n\");\n return 0;\n}\n" > hello/hello.c
- printf "PULP_APP = hello\nPULP_APP_FC_SRCS = hello.c\nPULP_APP_HOST_SRCS = hello.c\nPULP_CFLAGS = -O3 -g\n\ninclude \$(PULP_SDK_HOME)/install/rules/pulp_rt.mk\n" > hello/Makefile
script:
- make clean build USE_VIPS=1
- export VSIM_PATH=$PWD/build/questasim
- source pulp-runtime/configs/pulpissimo_cv32.sh
- make -C hello clean all run bootmode=spi
dependencies:
- build_rtl
needs:
- build_rtl
6 changes: 0 additions & 6 deletions Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,6 @@ packages:
- scm
- tech_cells_generic
- timer_unit
pulpissimo-rtl_sim_tb:
revision: null
version: null
source:
Path: target/sim/tb
dependencies: []
pulpissimo_optional_vips:
revision: null
version: null
Expand Down
13 changes: 12 additions & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ dependencies:

# Simulation Environment specific dependencies
pulpissimo_optional_vips: { path: "target/sim/vip"}
pulpissimo-rtl_sim_tb: { path: "target/sim/tb"}


export_include_dirs:
Expand Down Expand Up @@ -67,6 +66,18 @@ sources:
- hw/padframe/padframe_adapter.sv
- hw/clock_gen_fpga.sv

- target: simulation
files:
- target/sim/tb/tb_lib/riscv_pkg.sv
- target/sim/tb/tb_lib/jtag_pkg.sv
- target/sim/tb/tb_lib/pulp_tap_pkg.sv
- target/sim/tb/tb_lib/srec/srec_pkg.sv
- target/sim/tb/tb_lib/tb_clk_gen.sv
- target/sim/tb/tb_lib/SimDTM.sv
- target/sim/tb/tb_lib/SimJTAG.sv
- target/sim/tb/tb_pulp.sv
- target/sim/tb/tb_pulp_simple.sv


vendor_package:
# Import the GPIO repository directly. Since we have to regenerate the RTL
Expand Down
31 changes: 23 additions & 8 deletions target/sim/questasim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ include $(PULPISSIMO_ROOT)/utils/utils.mk

## Configuration Variables for Bender, Questasim behavior
BENDER_SCRIPTS_ARGS += -t rtl -t test -t rtl_sim
BENDER_VIP_SCRIPT_ARGS ?= -t rt_dpi -t i2c_vip -t flash_vip -t i2s_vip -t use_vips
VSIM_ARGS ?= -64
VLOG_ARGS += -suppress 2583 -suppress 13314 \"+incdir+\$$ROOT/hw/includes\"
VCOM_ARGS += ""
VOPT_ARGS ?= +acc
VSIM_BIN ?= "vsim"
VSIM_USER_PLUSARGS ?= ""
VSIM_DEFAULT_PLUSARGS ?= +nowarnTRAN +nowarnTSCALE +nowarnTFMPC -suppress 8386
RISCV_OBJCOPY_BIN ?= 'riscv32-unknown-elf-objcopy'
SIM_TOP ?= 'tb_pulp'
SIM_TOP_OPT ?= 'vopt_tb'
SIM_TOP_OPT ?= vopt_tb
USE_VIPS ?= 0



Expand All @@ -52,10 +55,10 @@ SIM_TOP_OPT ?= 'vopt_tb'
.PHONY: run_sim
run_sim: $(QUESTA_BUILD_DIR)/app.s19
ln -snf waves $(QUESTA_BUILD_DIR)/waves
ifeq ($(GUI), '0')
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do "vsim +BINARY_SREC_PATH='$< $(SIM_TOP_OPT); run -all; exit"
ifeq ($(gui), 1)
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -gui -do "vsim -t ps $(SIM_TOP_OPT) $(VSIM_DEFAULT_PLUSARGS) $(VSIM_USER_PLUSARGS) +srec=$<"
else
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -gui -do "vsim +BINARY_SREC_PATH='$< $(SIM_TOP_OPT)"
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do "vsim -t ps $(SIM_TOP_OPT) $(VSIM_DEFAULT_PLUSARGS) $(VSIM_USER_PLUSARGS) +srec=$<; run -all; exit"
endif

.PHONY: relink
Expand All @@ -68,9 +71,15 @@ relink:
## @param VSIM_BIN=vsim The command to invoke vsim. Default: 'vsim'
## @param VSIM_ARGS='-64' Additional args to supply to vsim during tool invocation
## @param SIM_TOP='tb_pulp' The toplevel module to optimize for simulation. Default: tb_pulp
## @param USE_VIPS=0 Use the VIPs in the simulation. Default: 0
.PHONY: build
build: $(QUESTA_BUILD_DIR)/compile.tcl relink
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do 'source compile.tcl; quit'
build: $(QUESTA_BUILD_DIR)/compile.tcl $(QUESTA_BUILD_DIR)/compile_vip.tcl relink
ifeq ($(USE_VIPS), 0)
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do 'quit -code [source compile.tcl]'
else
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do 'quit -code [source compile_vip.tcl]'
echo "Building with VIPS"
endif
cd $(QUESTA_BUILD_DIR) && $(VSIM_BIN) $(VSIM_ARGS) -c -do 'vopt $(VOPT_ARGS) -o $(SIM_TOP_OPT) $(SIM_TOP) -work work; quit'
@echo "Finished building design $(SIM_TOP). The optimized design has been stored in a unit called '$(SIM_TOP_OPT)'."
ifneq ($(VSIM_PATH), $(PULPISSIMO_ROOT)/build/questasim)
Expand Down Expand Up @@ -101,8 +110,14 @@ clean_questasim:
.PHONY: $(QUESTA_BUILD_DIR)/compile.tcl
$(QUESTA_BUILD_DIR)/compile.tcl: $(PULPISSIMO_ROOT)/Bender.lock | $(PULPISSIMO_UTILS)/bender
mkdir -p $(QUESTA_BUILD_DIR)
echo 'set ROOT [file normalize [file dirname [info script]]/../..]' > $(QUESTA_BUILD_DIR)/compile.tcl
$(PULPISSIMO_UTILS)/bender script vsim $(BENDER_SCRIPTS_ARGS) --vlog-arg="$(VLOG_ARGS)" --vcom-arg="" | grep -v "set ROOT" >> $(QUESTA_BUILD_DIR)/compile.tcl
echo 'set ROOT [file normalize [file dirname [info script]]/../..]' > $@
$(PULPISSIMO_UTILS)/bender script vsim $(BENDER_SCRIPTS_ARGS) --vlog-arg="$(VLOG_ARGS)" --vcom-arg="" | grep -v "set ROOT" >> $@

.PHONY: $(QUESTA_BUILD_DIR)/compile_vip.tcl
$(QUESTA_BUILD_DIR)/compile_vip.tcl: $(PULPISSIMO_ROOT)/Bender.lock | $(PULPISSIMO_UTILS)/bender
mkdir -p $(QUESTA_BUILD_DIR)
echo 'set ROOT [file normalize [file dirname [info script]]/../..]' > $@
$(PULPISSIMO_UTILS)/bender script vsim $(BENDER_SCRIPTS_ARGS) $(BENDER_VIP_SCRIPT_ARGS) --vlog-arg="$(VLOG_ARGS)" --vcom-arg="" | grep -v "set ROOT" >> $@

# Convert the ELF binary to SREC format for simulation
$(QUESTA_BUILD_DIR)/app.s19: $(EXECUTABLE_PATH)
Expand Down
15 changes: 0 additions & 15 deletions target/sim/tb/Bender.yml

This file was deleted.

0 comments on commit c3fc3be

Please sign in to comment.