fixing ci
diff --git a/.github/scripts/dv/pdkBuild.sh b/.github/scripts/build/pdkBuild.sh
similarity index 60%
rename from .github/scripts/dv/pdkBuild.sh
rename to .github/scripts/build/pdkBuild.sh
index 9f9ac93..2e38798 100644
--- a/.github/scripts/dv/pdkBuild.sh
+++ b/.github/scripts/build/pdkBuild.sh
@@ -22,34 +22,18 @@
docker pull $IMAGE_NAME
cd $RUN_ROOT/..
+echo $PWD
export PDK_ROOT=$(pwd)/pdks
-mkdir $PDK_ROOT
-echo $PDK_ROOT
-echo $RUN_ROOT
+mkdir -p $PDK_ROOT
+
cd $RUN_ROOT
+echo $PWD
+export CARAVEL_ROOT=$(pwd)/caravel
make skywater-pdk
make skywater-library
-# The following section is for running on the CI.
-# If you're running locally you should replace them with: `make skywater-library`
-# This is because sometimes while setting up the conda env (skywater's make timing) it fails to fetch something
-# Then it exits without retrying. So, here we're retrying, and if something goes wrong it will exit after 5 retries.
-# Section Begin
-if [ $SKIP_TIMING -eq 0 ]; then
- cnt=0
- until make skywater-timing; do
- cnt=$((cnt+1))
- if [ $cnt -eq 5 ]; then
- exit 2
- fi
- rm -rf $PDK_ROOT/skywater-pdk
- make skywater-pdk
- make skywater-library
- done
-fi
-# Section End
-
make open_pdks
-docker run -v $RUN_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "make build-pdk"
+
+docker run -v $RUN_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -e OPENLANE_IMAGE_NAME=$IMAGE_NAME -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "make build-pdk"
rm -rf $PDK_ROOT/open_pdks
rm -rf $PDK_ROOT/skywater-pdk
diff --git a/.github/scripts/build/run-install-magic.sh b/.github/scripts/build/run-install-magic.sh
new file mode 100644
index 0000000..c2eaf01
--- /dev/null
+++ b/.github/scripts/build/run-install-magic.sh
@@ -0,0 +1,9 @@
+sudo apt install -y tcsh csh tcl-dev tk-dev libcairo2-dev
+sudo apt install -y gcc-riscv64-unknown-elf iverilog
+
+git clone git://opencircuitdesign.com/magic
+cd magic
+git checkout $MAGIC_VERSION
+./configure
+make
+sudo make install
\ No newline at end of file
diff --git a/.github/scripts/build/run-pdk-build.sh b/.github/scripts/build/run-pdk-build.sh
new file mode 100644
index 0000000..6fbdec3
--- /dev/null
+++ b/.github/scripts/build/run-pdk-build.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2020 Efabless Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
+
+export RUN_ROOT=$(pwd)
+export CARAVEL_ROOT=$(pwd)/caravel
+
+cd $RUN_ROOT/..
+echo $PWD
+export OPENLANE_ROOT=$(pwd)/openlane
+export PDK_ROOT=$(pwd)/pdks
+export INSTALL_SRAM=enable
+
+rm -rf $OPENLANE_ROOT $PDK_ROOT $CARAVEL_ROOT
+
+cd $RUN_ROOT
+echo $PWD
+make install
+
+cd $CARAVEL_ROOT
+echo $PWD
+git checkout $CARAVEL_TAG
+
+cd $RUN_ROOT
+echo $PWD
+make openlane
+
+cd $OPENLANE_ROOT
+echo $PWD
+git checkout $OPENLANE_TAG
+make pdk
+
+echo "done installing"
+
+cd $RUN_ROOT
+exit 0
\ No newline at end of file
diff --git a/.github/scripts/build/run-user-build.sh b/.github/scripts/build/run-user-build.sh
new file mode 100644
index 0000000..2fa64da
--- /dev/null
+++ b/.github/scripts/build/run-user-build.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2020 Efabless Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
+
+export RUN_ROOT=$(pwd)
+export CARAVEL_ROOT=$(pwd)/caravel
+CMD=$1
+BUILD=$2
+
+cd $RUN_ROOT/..
+echo $PWD
+export OPENLANE_ROOT=$(pwd)/openlane
+export PDK_ROOT=$(pwd)/pdks
+
+cd $RUN_ROOT
+echo $PWD
+
+if [[ $BUILD -ne 0 ]]; then
+ cd openlane ;
+ echo $PWD ;
+fi
+
+make $CMD
+RES=$?
+echo "$CMD: $RES"
+if [[ $RES -ne 0 ]]; then
+ exit $RES ;
+fi
+
+cd $RUN_ROOT
+echo $PWD
+
+exit 0
diff --git a/.github/scripts/build/run-xor.sh b/.github/scripts/build/run-xor.sh
index 53ccb59..3908bb8 100644
--- a/.github/scripts/build/run-xor.sh
+++ b/.github/scripts/build/run-xor.sh
@@ -15,16 +15,25 @@
# SPDX-License-Identifier: Apache-2.0
export UPRJ_ROOT=$(pwd)
-export CARAVEL_ROOT=$(pwd)/caravel
cd ..
export PDK_ROOT=$(pwd)/pdks
+export CARAVEL_ROOT=$(pwd)/caravel
export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG
cd $UPRJ_ROOT
+# Install full version of caravel
+git clone https://github.com/efabless/caravel --depth 1 $CARAVEL_ROOT
+
LOG_FILE=out.log
docker run -v $UPRJ_ROOT:$UPRJ_ROOT -v $PDK_ROOT:$PDK_ROOT -v $CARAVEL_ROOT:$CARAVEL_ROOT -e UPRJ_ROOT=$UPRJ_ROOT -e PDK_ROOT=$PDK_ROOT -e CARAVEL_ROOT=$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "cd $UPRJ_ROOT; export USER_ID=$USER_ID; make xor-wrapper | tee $LOG_FILE;"
+if [ ! -f $LOG_FILE ]
+then
+ echo "Log file [$LOG_FILE] DOES NOT exists."
+ exit 3
+fi
+
cnt=$(grep -oP '(?<=Total XOR differences = )[0-9]+' $LOG_FILE)
echo "Total XOR differences = $cnt"
diff --git a/.github/scripts/dv/run-dv-tests.sh b/.github/scripts/dv/run-dv-tests.sh
new file mode 100755
index 0000000..5940cc1
--- /dev/null
+++ b/.github/scripts/dv/run-dv-tests.sh
@@ -0,0 +1,72 @@
+#!/bin/bash
+# SPDX-FileCopyrightText: 2020 Efabless Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# SPDX-License-Identifier: Apache-2.0
+
+# comma seperated test ids
+IDS=$1
+# simulation mode : RTL/GL
+SIM_MODE=$2
+
+DV_TEST_IDS=(${IDS//,/ })
+
+export TARGET_PATH=$(pwd)
+export CARAVEL_ROOT=$(pwd)/caravel
+
+cd ..
+export PDK_ROOT=$(pwd)/pdks
+DV_PATH=$TARGET_PATH/verilog/dv
+
+if [ ! -d $TARGET_PATH ]
+then
+ echo "Directory target [$TARGET_PATH] DOES NOT exists."
+ exit 3
+fi
+
+if [ ! -d $PDK_ROOT ]
+then
+ echo "Directory pdk [$PDK_ROOT] DOES NOT exists."
+ exit 3
+fi
+
+if [ ! -d $DV_PATH ]
+then
+ echo "Directory dv [$DV_PATH] DOES NOT exists."
+ exit 3
+fi
+
+for id in "${DV_TEST_IDS[@]}"
+do
+ $TARGET_PATH/.github/scripts/dv/run-dv.sh $PDK_ROOT $DV_PATH $id $SIM_MODE
+
+ echo "Done test $id $SIM_MODE"
+
+ VERDICT_FILE=$TARGET_PATH/verilog/dv/$id.out
+
+ if [ -f $VERDICT_FILE ]; then
+ cnt=$(grep "Pass" $VERDICT_FILE -s | wc -l)
+ if ! [[ $cnt ]]; then cnt = 0; fi
+ else
+ echo "DV check failed due to subscript failure. Please review the logs";
+ exit 2;
+ fi
+
+ echo "Verdict: $cnt"
+
+ if [[ $cnt -ne 1 ]]; then
+ exit 1;
+ fi
+done
+
+exit 0;
diff --git a/.github/workflows/caravel_build.yml b/.github/workflows/caravel_build.yml
index 3978d7f..1b02930 100644
--- a/.github/workflows/caravel_build.yml
+++ b/.github/workflows/caravel_build.yml
@@ -1,73 +1,49 @@
-name: Caravel Build
-
-
+name: Caravel build
on:
- # Runs on Every Push
+ create:
+ tag: [ t* ]
push:
- # Runs on Pull Requests
+ branches: [ m* ]
pull_request:
+ branches: [ m* ]
workflow_dispatch:
-
+ branches: [ m* ]
jobs:
- make_ship:
+ build:
runs-on: ubuntu-latest
+ env:
+ PDK_ROOT: /home/runner/work/caravel_template/pdks
+ OPENLANE_ROOT: /home/runner/work/caravel_template/openlane
+ CARAVEL_ROOT: /home/runner/work/caravel_template/caravel_template/caravel
+ OPENLANE_IMAGE_NAME: efabless/openlane:mpw-3a
+ OPENLANE_TAG: 2021.12.17_05.07.41
+ CARAVEL_TAG: mpw-3a
+ MAGIC_VERSION: 8.3.209
steps:
- uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Install The PDK
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
- env:
- OPENLANE_TAG: 2021.12.17_05.07.41
-
- - name: Run make ship
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-ship.sh
- env:
- OPENLANE_TAG: 2021.12.17_05.07.41
-
- set_user_id:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Install The PDK
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
-
- - name: Run Set User ID
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-set-id.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
-
- xor_wrapper:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Install The PDK
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
-
- - name: Run XOR Check
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-xor.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
+ - name: install deps
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-install-magic.sh
+ - name: install caravel
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-pdk-build.sh
+ - name: uncompress
+ run: make uncompress
+ - name: build user gds
+ run: |
+ cd openlane/
+ docker run -v $OPENLANE_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -v $PWD/..:/project -v $CARAVEL_ROOT:$CARAVEL_ROOT -e PDK_ROOT=$PDK_ROOT -e CARAVEL_ROOT=$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) $OPENLANE_IMAGE_NAME sh -c "cd /project/openlane && flow.tcl -design ./user_proj -save_path .. -save -tag user_proj -overwrite"
+ cd -
+ - name: build wrapper gds
+ run: |
+ cd openlane
+ docker run -v $OPENLANE_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -v $PWD/..:/project -v $CARAVEL_ROOT:$CARAVEL_ROOT -e PDK_ROOT=$PDK_ROOT -e CARAVEL_ROOT=$CARAVEL_ROOT -u $(id -u $USER):$(id -g $USER) $OPENLANE_IMAGE_NAME sh -c "cd /project/openlane && flow.tcl -design ./user_project_wrapper -save_path .. -save -tag user_project_wrapper -overwrite"
+ cd -
+ - name: compress
+ run: make compress
+ - name: push
+ if: github.event_name == 'create' && github.event.ref_type == 'tag' && startsWith(github.event.ref, 't')
+ run: |
+ git add def gds lef mag maglef signoff verilog
+ git config user.email "rbacik@hotmail.com"
+ git config user.name "roman3017"
+ git commit -m "tag action: update build"
+ git push origin HEAD:main
diff --git a/.github/workflows/user_project_ci.yml b/.github/workflows/user_project_ci.yml
index 923b00c..be30c79 100644
--- a/.github/workflows/user_project_ci.yml
+++ b/.github/workflows/user_project_ci.yml
@@ -1,95 +1,56 @@
name: CI
-
-
on:
- # Runs on Every Push
push:
- # Runs on Pull Requests
pull_request:
workflow_dispatch:
-
jobs:
precheck:
runs-on: ubuntu-latest
timeout-minutes: 720
steps:
- uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- name: Install The Precheck
run: sh ${GITHUB_WORKSPACE}/.github/scripts/precheck/precheckBuild.sh
-
- name: Sanitize The Precheck
run: sed -i 's/yaml manifest makefile consistency/makefile/g' ${GITHUB_WORKSPACE}/.github/scripts/precheck/run-precheck.sh
-
- name: Run The Precheck
run: bash ${GITHUB_WORKSPACE}/.github/scripts/precheck/run-precheck.sh
-
precheck-drc:
timeout-minutes: 720
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- name: Install The Precheck
run: sh ${GITHUB_WORKSPACE}/.github/scripts/precheck/precheckBuild.sh
-
- name: Run The Precheck
run: bash ${GITHUB_WORKSPACE}/.github/scripts/precheck/run-precheck-drc.sh
-
dv_rtl:
runs-on: ubuntu-latest
+ env:
+ OPENLANE_TAG: 2021.12.17_05.07.41
+ CARAVEL_TAG: mpw-3a
+ MAGIC_VERSION: 8.3.209
steps:
- uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Install The PDK
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
-
- - name: Install The Dockerized DV Setup
- run: docker pull efabless/dv_setup:latest
-
+ - name: install deps
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-install-magic.sh
+ - name: Install Caravel
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-pdk-build.sh
- name: Run DV tests
- # Run test number 0,1,2,3,4 in one job <test-ids> <sim-mode>
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-wrapper.sh 0,1,2,3,4 RTL
-
+ # Run test number 0,1,2,3,4 in one job <test-ids> <sim-mode>
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-tests.sh 0,1,2 RTL
dv_gl:
runs-on: ubuntu-latest
+ env:
+ OPENLANE_TAG: 2021.12.17_05.07.41
+ CARAVEL_TAG: mpw-3a
+ MAGIC_VERSION: 8.3.209
steps:
- uses: actions/checkout@v2
-
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Install The PDK
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/pdkBuild.sh
- env:
- OPENLANE_TAG: 2021.09.16_03.28.21
-
- - name: Install The Dockerized DV Setup
- run: docker pull efabless/dv_setup:latest
-
+ - name: install deps
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-install-magic.sh
+ - name: Install Caravel
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/build/run-pdk-build.sh
- name: Run DV tests
- # Run test number 0,1,2,3,4 in one job <test-ids> <sim-mode>
- run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-wrapper.sh 0,1,2,3,4 GL
+ # Run test number 0,1,2,3,4 in one job <test-ids> <sim-mode>
+ run: bash ${GITHUB_WORKSPACE}/.github/scripts/dv/run-dv-tests.sh 0,1,2 GL
diff --git a/verilog/dv/io_ports/Makefile b/verilog/dv/io_ports/Makefile
index 5237a05..95eeb03 100644
--- a/verilog/dv/io_ports/Makefile
+++ b/verilog/dv/io_ports/Makefile
@@ -31,8 +31,8 @@
UPRJ_BEHAVIOURAL_MODELS = ../
## RISCV GCC
-GCC_PATH?=/ef/apps/bin
-GCC_PREFIX?=riscv32-unknown-elf
+GCC_PATH?=/usr/bin
+GCC_PREFIX?=riscv64-unknown-elf
## Simulation mode: RTL/GL
SIM_DEFINES = -DFUNCTIONAL -DSIM
diff --git a/verilog/dv/la_test1/Makefile b/verilog/dv/la_test1/Makefile
index ba979f7..5b181ef 100644
--- a/verilog/dv/la_test1/Makefile
+++ b/verilog/dv/la_test1/Makefile
@@ -31,8 +31,8 @@
UPRJ_BEHAVIOURAL_MODELS = ../
## RISCV GCC
-GCC_PATH?=/ef/apps/bin
-GCC_PREFIX?=riscv32-unknown-elf
+GCC_PATH?=/usr/bin
+GCC_PREFIX?=riscv64-unknown-elf
## Simulation mode: RTL/GL
SIM_DEFINES = -DFUNCTIONAL -DSIM
diff --git a/verilog/dv/la_test2/Makefile b/verilog/dv/la_test2/Makefile
index 0435500..0ac1653 100644
--- a/verilog/dv/la_test2/Makefile
+++ b/verilog/dv/la_test2/Makefile
@@ -31,8 +31,8 @@
UPRJ_BEHAVIOURAL_MODELS = ../
## RISCV GCC
-GCC_PATH?=/ef/apps/bin
-GCC_PREFIX?=riscv32-unknown-elf
+GCC_PATH?=/usr/bin
+GCC_PREFIX?=riscv64-unknown-elf
## Simulation mode: RTL/GL
SIM_DEFINES = -DFUNCTIONAL -DSIM
diff --git a/verilog/dv/mprj_stimulus/Makefile b/verilog/dv/mprj_stimulus/Makefile
index b0e4051..4d83619 100644
--- a/verilog/dv/mprj_stimulus/Makefile
+++ b/verilog/dv/mprj_stimulus/Makefile
@@ -36,8 +36,8 @@
UPRJ_BEHAVIOURAL_MODELS = ../
## RISCV GCC
-GCC_PATH?=/ef/apps/bin
-GCC_PREFIX?=riscv32-unknown-elf
+GCC_PATH?=/usr/bin
+GCC_PREFIX?=riscv64-unknown-elf
## Simulation mode: RTL/GL
SIM_DEFINES = -DFUNCTIONAL -DSIM
diff --git a/verilog/dv/mprj_stimulus/mprj_stimulus.c b/verilog/dv/mprj_stimulus/mprj_stimulus.c
index 7d2c29a..a8fca32 100644
--- a/verilog/dv/mprj_stimulus/mprj_stimulus.c
+++ b/verilog/dv/mprj_stimulus/mprj_stimulus.c
@@ -34,7 +34,7 @@
uint32_t testval;
- reg_hkspi_disable = 1; // Shut off the housekeeping SPI,
+// reg_hkspi_disable = 1; // Shut off the housekeeping SPI,
// so we can use the pins.
reg_mprj_datal = 0x00000000;
diff --git a/verilog/dv/wb_port/Makefile b/verilog/dv/wb_port/Makefile
index 1c784c6..1d5b08c 100644
--- a/verilog/dv/wb_port/Makefile
+++ b/verilog/dv/wb_port/Makefile
@@ -31,8 +31,8 @@
UPRJ_BEHAVIOURAL_MODELS = ../
## RISCV GCC
-GCC_PATH?=/ef/apps/bin
-GCC_PREFIX?=riscv32-unknown-elf
+GCC_PATH?=/usr/bin
+GCC_PREFIX?=riscv64-unknown-elf
## Simulation mode: RTL/GL
SIM_DEFINES = -DFUNCTIONAL -DSIM