Rework regression to use docker.

This commit is contained in:
mrg 2022-02-04 14:38:35 -08:00
parent 049751ae1f
commit e45e2f77c9
7 changed files with 98 additions and 78 deletions

View File

@ -1,44 +1,56 @@
name: ci name: ci
on: [push] on: [push]
jobs: jobs:
scn4me_subm: regress:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: SCMOS test - name: Docker pull
run: docker pull vlsida/openram-ubuntu:latest
- name: PDK Install
run: | run: |
. /home/github-runner/setup-paths.sh
export OPENRAM_HOME="${{ github.workspace }}/compiler" export OPENRAM_HOME="${{ github.workspace }}/compiler"
export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" export OPENRAM_TECH="${{ github.workspace }}/technology"
export OPENRAM_TMP="${{ github.workspace }}/scn4me_subm_temp" #cd $OPENRAM_HOME/tests
#export PDK_ROOT="${{ github.workspace }}/pdk"
#make pdk
#make install
- name: Regress
run: |
export OPENRAM_HOME="${{ github.workspace }}/compiler"
export OPENRAM_TECH="${{ github.workspace }}/technology"
#cd $OPENRAM_HOME/.. && make pdk && make install
#export OPENRAM_TMP="${{ github.workspace }}/scn4me_subm_temp"
#python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t scn4m_subm #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t scn4m_subm
$OPENRAM_HOME/tests/regress.py -j 24 -t scn4m_subm #$OPENRAM_HOME/tests/regress.py -j 24 -t scn4m_subm
cd $OPENRAM_HOME/tests
make -j 36
- name: Archive - name: Archive
if: ${{ failure() }} if: ${{ failure() }}
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: scn4me_subm Archives name: Regress Archives
path: ${{ github.workspace }}/*.zip path: ${{ github.workspace }}/compiler/tests/results/*.zip
freepdk45: # freepdk45:
runs-on: self-hosted # runs-on: self-hosted
steps: # steps:
- name: Checkout code # - name: Checkout code
uses: actions/checkout@v1 # uses: actions/checkout@v1
- name: FreePDK45 test # - name: FreePDK45 test
run: | # run: |
. /home/github-runner/setup-paths.sh # . /home/github-runner/setup-paths.sh
export OPENRAM_HOME="${{ github.workspace }}/compiler" # export OPENRAM_HOME="${{ github.workspace }}/compiler"
export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" # export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech"
export OPENRAM_TMP="${{ github.workspace }}/freepdk45_temp" # export OPENRAM_TMP="${{ github.workspace }}/freepdk45_temp"
#python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t freepdk45 # #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t freepdk45
$OPENRAM_HOME/tests/regress.py -j 24 -t freepdk45 # $OPENRAM_HOME/tests/regress.py -j 24 -t freepdk45
- name: Archive # - name: Archive
if: ${{ failure() }} # if: ${{ failure() }}
uses: actions/upload-artifact@v2 # uses: actions/upload-artifact@v2
with: # with:
name: FreePDK45 Archives # name: FreePDK45 Archives
path: ${{ github.workspace }}/*.zip # path: ${{ github.workspace }}/*.zip
# coverage_stats: # coverage_stats:
# if: ${{ always() }} # if: ${{ always() }}
# needs: [scn4me_subm, freepdk45] # needs: [scn4me_subm, freepdk45]

View File

@ -188,6 +188,7 @@ mount:
-e PDK_ROOT=$(PDK_ROOT) \ -e PDK_ROOT=$(PDK_ROOT) \
-e OPENRAM_HOME=/openram/compiler \ -e OPENRAM_HOME=/openram/compiler \
-e OPENRAM_TECH=/openram/technology \ -e OPENRAM_TECH=/openram/technology \
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \
--user $(UID):$(GID) \ --user $(UID):$(GID) \
vlsida/openram-ubuntu:latest vlsida/openram-ubuntu:latest
.PHONY: mount .PHONY: mount

View File

@ -15,6 +15,7 @@ from globals import OPTS
from sram_factory import factory from sram_factory import factory
import debug import debug
@unittest.skip("SKIPPING 21_hspice_delay_test")
class timing_sram_test(openram_test): class timing_sram_test(openram_test):
def runTest(self): def runTest(self):

View File

@ -14,6 +14,7 @@ import globals
from globals import OPTS from globals import OPTS
@unittest.skip("SKIPPING 21_hspice_setuphold_test")
class timing_setup_test(openram_test): class timing_setup_test(openram_test):
def runTest(self): def runTest(self):

View File

@ -1,16 +1,22 @@
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..) TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..)
include $(TOP_DIR)/openram.mk include $(TOP_DIR)/openram.mk
.DEFAULT_GOAL := regress .DEFAULT_GOAL := all
ARGS ?= "-k" ARGS ?=
TECH ?= scn4m_subm
TECHS = scn4m_subm freepdk45
# sky130
TEST_DIR = $(TOP_DIR)/compiler/tests TEST_DIR = $(TOP_DIR)/compiler/tests
TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py)))
TEST_DIRS=$(basename $(TEST_SRCS)) TEST_BASES = $(basename $(TEST_SRCS))
TEST_STAMPS=$(addsuffix .ok,$(TEST_DIRS)) TEST_STAMPS= $(addsuffix .ok,$(TEST_BASES))
TEST_BROKEN := \ OPENRAM_DIR = /openram/compiler/tests
RESULTS_DIR = $(OPENRAM_DIR)/results
TEST_BROKEN = \
50_riscv_1k_1rw1r_func_test.py \ 50_riscv_1k_1rw1r_func_test.py \
50_riscv_1k_1rw_func_test.py \ 50_riscv_1k_1rw_func_test.py \
50_riscv_1rw1r_func_test.py \ 50_riscv_1rw1r_func_test.py \
@ -29,66 +35,65 @@ TEST_BROKEN := \
WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS)) WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS))
$(TEST_DIRS):
@$(MAKE) --no-print-directory $@.ok
tests: gettech = $(word 1,$(subst /, ,$*))
@echo "Running the following tests" getfile = $(word 2,$(subst /, ,$*))
@for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done WORKING_TECH_TEST_STAMPS=$(foreach T, $(TECHS),$(addprefix $T/,$(WORKING_TEST_STAMPS)))
@sleep 5
@$(MAKE) $(WORKING_TEST_STAMPS)
.PHONY:
%.ok: %.py all: $(WORKING_TECH_TEST_STAMPS)
@echo "Running $*" .PHONY: all
@mkdir -p $(TOP_DIR)/compiler/tests/results/$*
# Targets for each individual test
# e.g. make 04_pinv_1x_test
$(TEST_BASES):
# @echo "Running $(TECH) $@ ... "
@$(MAKE) --no-print-directory $(TECH)/$@.ok
.PHONY: $(TEST_BASES)
# To run a test in a given technology
%.ok:
# @echo "Running $(gettech) $(getfile) ... "
@mkdir -p results/$*/tmp
@docker run \ @docker run \
-v $(TOP_DIR):/openram \ -v $(TOP_DIR):/openram \
-v $(FREEPDK45):/pdk/freepdk45\ -v $(FREEPDK45):/pdk/freepdk45\
-v $(PDK_ROOT):/pdk \ -v $(PDK_ROOT):/pdk \
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \
--user $(UID):$(GID) \ --user $(UID):$(GID) \
-e OPENRAM_TMP=$(OPENRAM_DIR)/results/$*/tmp \
vlsida/openram-ubuntu:latest \ vlsida/openram-ubuntu:latest \
sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@" sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/$(getfile).py \
-t $(gettech) -k $(ARGS) -p $(OPENRAM_DIR)/results/$* > $(OPENRAM_DIR)/results/$*.out 2>&1 && touch $(OPENRAM_DIR)/results/$*.ok"
@test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" || echo "$* ... FAIL!"
.DELETE_ON_ERROR: $(TEST_STAMPS) .DELETE_ON_ERROR: $(TEST_STAMPS)
TECHS := scn4m_subm freepdk45 # This would use the regress.py script to run in parallel instead of
#sky130 # the Makefile.
#$(TECHS):
$(TECHS): # @echo "Running $*"
docker run \ # docker run \
-v $(TOP_DIR):/openram \ # -v $(TOP_DIR):/openram \
-v $(FREEPDK45):/pdk/freepdk45 \ # -v $(FREEPDK45):/pdk/freepdk45 \
-v $(PDK_ROOT):/pdk \ # -v $(PDK_ROOT):/pdk \
--user $(UID):$(GID) \ # --user $(UID):$(GID) \
-e OPENRAM_TMP=/openram/compiler/tests/tmp_$@/$* \ # -e OPENRAM_TMP=$(OPENRAM_DIR)/results/$@ \
vlsida/openram-ubuntu:latest \ # vlsida/openram-ubuntu:latest \
sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" # sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/regress.py -t $@ $(ARGS)"
.PHONY: $(TECHS) #.PHONY: $(TECHS)
#regress: $(TECHS)
regress: $(TECHS) #.PHONY: regress
.PHONY: regress
foo:
docker run \
-v $(TOP_DIR):/openram \
-v $(FREEPDK45):/pdk/freepdk45 \
-v $(PDK_ROOT):/pdk \
--user $(UID):$(GID) \
vlsida/openram-ubuntu:latest \
sh -c ". ~/.bashrc && env"
.PHONY: foo
# Mount environment for debug
mount: mount:
docker run -it \ docker run -it \
-v $(TOP_DIR):/openram \ -v $(TOP_DIR):/openram \
-v $(FREEPDK45):/pdk/freepdk45 \ -v $(FREEPDK45):/pdk/freepdk45 \
-v $(PDK_ROOT):/pdk \ -v $(PDK_ROOT):/pdk \
-v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \
--user $(UID):$(GID) \ --user $(UID):$(GID) \
vlsida/openram-ubuntu:latest vlsida/openram-ubuntu:latest
.PHONY: mount .PHONY: mount
clean: clean:
@rm -rf $(TEST_STAMPS) @rm -rf $(TOP_DIR)/compiler/tests/results
@rm -rf $(TEST_DIRS)
.PHONE: clean .PHONE: clean