diff --git a/.github/workflows/auto-update-caravel-lite.yml b/.github/workflows/auto-update-caravel-lite.yml index 02afeded..f20b36ce 100644 --- a/.github/workflows/auto-update-caravel-lite.yml +++ b/.github/workflows/auto-update-caravel-lite.yml @@ -48,10 +48,10 @@ jobs: git config --global init.defaultBranch main git init git checkout -b main - git remote add parent https://github.com/efabless/caravel_openframe + git remote add parent https://github.com/efabless/caravel git pull parent main git fetch --all --tags git filter-repo --path openlane/user_project_wrapper_empty --path openlane/user_analog_project_wrapper_empty --path openlane/Makefile --path gds/user_project_wrapper_empty.gds.gz --path gds/user_analog_project_wrapper_empty.gds.gz --path mag/user_project_wrapper_empty.mag --path mag/user_analog_project_wrapper_empty.mag --path lef/user_project_wrapper_empty.lef --path lef/user_analog_project_wrapper_empty.lef --path verilog/ --path Makefile --path scripts/ --path LICENSE --path manifest --path spi/lvs/run_lvs.sh --path gds/gds2mag-all.sh --path gds/drc_on_gds.tcl --path gds/antenna_on_gds.tcl --path spi/lvs/caravel.spice --path spi/lvs/caravan.spice --force - git remote add caravel_lite https://x-access-token:${{ secrets.EFSTAFF_TOKEN }}@github.com/efabless/caravel_openframe-lite + git remote add caravel_lite https://x-access-token:${{ secrets.EFSTAFF_TOKEN }}@github.com/efabless/caravel-lite git push --force caravel_lite main git push -f --tags caravel_lite main diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100755 index 00000000..7380a941 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,28 @@ +# 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 +# .readthedocs.yml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +conda: + environment: docs/environment.yml diff --git a/.travis.yml b/.travis.yml new file mode 100755 index 00000000..08955e15 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,109 @@ +# 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 + +language: python + +branches: + only: + - develop + - master + - fix_gpio + - /^(?i:develop)-.*$/ + +services: + - docker + +os: + - linux + +notifications: + slack: efabless-team:XAEJOuCet9xQ14EEIO0nNufd + +env: + global: + - OPENLANE_TAG=v0.20 +stages: + - commit-compliance + - test + +jobs: + include: + - name: "The README.rst Consistency Test" + stage: commit-compliance + script: bash .travisCI/base_checks/git-check.sh + - name: "The Manifest Test" + stage: commit-compliance + script: bash .travisCI/base_checks/manifest-check.sh + - name: "The Caravel LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh caravel" + - name: "The Caravan LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh caravan" + - name: "The chio_io LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh chip_io" + - name: "The chip_io_alt LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh chip_io_alt" + - name: "The mgmt_core LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh mgmt_core" + - name: "The Rest of the Blocks LVS Test" + stage: test + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/utils/bash_run_wrapper.sh ".travisCI/lvs/lvs-check.sh all" + # - name: "The Caravel MAGLEF LVS Test" + # stage: test + # install: sh .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + # script: bash .travisCI/lvs/maglef-lvs-check.sh + - name: "The GDS Pointers Test" + stage: test + script: bash .travisCI/base_checks/gds-pointers.sh + - name: "The mgmt_soc DV Test: Set 1" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh mgmt_soc 1 + - name: "The mgmt_soc DV Test: Set 2" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh mgmt_soc 2 + - name: "The mgmt_soc DV Test: Set 3" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh mgmt_soc 3 + - name: "The mgmt_soc DV Test: Set 4" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh mgmt_soc 4 + - name: "The mgmt_soc DV Test: Set 5" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh mgmt_soc 5 + - name: "The wb_utests DV Test" + stage: test + if: branch = master OR type=cron + install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh + script: bash .travisCI/dv/dv-check-wrapper.sh wb_utests 1 \ No newline at end of file diff --git a/.travisCI/base_checks/gds-pointers.sh b/.travisCI/base_checks/gds-pointers.sh new file mode 100755 index 00000000..e6c29dc6 --- /dev/null +++ b/.travisCI/base_checks/gds-pointers.sh @@ -0,0 +1,23 @@ +#!/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 + +set -e + +cnt=$(grep -L "string GDS_FILE ../gds/" maglef/*.mag | wc -l) +echo "count of maglef files without gds pointer: $cnt" + +if [ $cnt -eq 0 ]; then exit 0; fi +exit 2 diff --git a/.travisCI/base_checks/git-check.sh b/.travisCI/base_checks/git-check.sh new file mode 100755 index 00000000..66dfeb17 --- /dev/null +++ b/.travisCI/base_checks/git-check.sh @@ -0,0 +1,43 @@ +#!/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 + +set -e + +echo "Current git status" + +git status + +echo "Deleting README.rst & openlane/README.rst" +rm -rf README.rst +rm -rf openlane/README.rst + +echo "Running make README.rst" +make README.rst -B + +echo "New git status" +TMP_FILE=git_dif_tmp_file +git diff > $TMP_FILE + +git status + +echo "git diff:" +cat $TMP_FILE + +cnt=$(cat $TMP_FILE | wc -l) +echo $cnt +rm -f $TMP_FILE +if [[ $cnt -gt 1 ]]; then exit 2; fi +exit 0 diff --git a/.travisCI/base_checks/manifest-check.sh b/.travisCI/base_checks/manifest-check.sh new file mode 100755 index 00000000..dc120f61 --- /dev/null +++ b/.travisCI/base_checks/manifest-check.sh @@ -0,0 +1,32 @@ +#!/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 + +TARGET_PATH=$(pwd)/ +OUT_FILE=tmp_manifest_output_file +echo "Going into $TARGET_PATH" +cd $TARGET_PATH +if [[ -f "manifest" ]]; then + echo "Running shasum checks" + shasum -c manifest > $OUT_FILE + cat $OUT_FILE + cnt=$(grep "FAILED" $OUT_FILE | wc -l) + rm -f $OUT_FILE + if [[ $cnt -eq 0 ]]; then exit 0; fi + exit 2; +else + echo "manifest file doesn't exist" + exit 2 +fi \ No newline at end of file diff --git a/.travisCI/dv/dv-check-wrapper.sh b/.travisCI/dv/dv-check-wrapper.sh new file mode 100755 index 00000000..5ce4f15d --- /dev/null +++ b/.travisCI/dv/dv-check-wrapper.sh @@ -0,0 +1,52 @@ +#!/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 TARGET_PATH=$(pwd) +cd ../ +export PDK_PATH=$(pwd)/pdks/sky130A +export PDK_ROOT=$(pwd)/pdks +export GCC_PATH=/opt/riscv32i/bin +export GCC_PREFIX=riscv32-unknown-elf + +cd $TARGET_PATH + +export RUN_WRAPPER=$TARGET_PATH/.travisCI/utils/run_wrapper.sh + +target_dv=$1 +target_id=$2 + +bash $RUN_WRAPPER "docker pull efabless/dv_setup:latest" + +docker run -it -v $TARGET_PATH:$TARGET_PATH -v $PDK_PATH:$PDK_PATH -v $PDK_ROOT:$PDK_ROOT\ + -e TARGET_PATH=$TARGET_PATH -e PDK_PATH=$PDK_PATH -e PDK_ROOT=$PDK_ROOT -e GCC_PATH=$GCC_PATH -e GCC_PREFIX=$GCC_PREFIX \ + -u $(id -u $USER):$(id -g $USER) efabless/dv_setup:latest \ + bash -c "bash $TARGET_PATH/.travisCI/dv/run-dv-$target_dv.sh $PDK_PATH $TARGET_PATH $target_id" + +echo "DONE!" + +VERDICT_FILE=$TARGET_PATH/$target_dv\_verdict.out +cat $VERDICT_FILE +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 -eq 1 ]]; then exit 0; fi +exit 2; diff --git a/.travisCI/dv/run-dv-mgmt_soc.sh b/.travisCI/dv/run-dv-mgmt_soc.sh new file mode 100755 index 00000000..e5b1df03 --- /dev/null +++ b/.travisCI/dv/run-dv-mgmt_soc.sh @@ -0,0 +1,80 @@ +#!/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 + +PDK_PATH=$1 +TARGET_PATH=$2 +ID=$3 +MGMT_SOC_PATTERNS_1=(gpio perf hkspi sysctrl) +MGMT_SOC_PATTERNS_2=(mprj_ctrl pass_thru user_pass_thru storage) +MGMT_SOC_PATTERNS_3=(uart irq) +MGMT_SOC_PATTERNS_4=(timer timer2 caravan) +MGMT_SOC_PATTERNS_5=(mem pll qspi) + +VERDICT_FILE=$TARGET_PATH/mgmt_soc_verdict.out +OUT_FILE=$TARGET_PATH/mgmt_soc_dv.$ID.out + +case $ID in + + 1) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${MGMT_SOC_PATTERNS_1[@]}" caravel mgmt_soc 1 $TARGET_PATH + len=${#MGMT_SOC_PATTERNS_1[@]} + export TOTAL=$(( 2*len )) + ;; + + 2) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${MGMT_SOC_PATTERNS_2[@]}" caravel mgmt_soc 2 $TARGET_PATH + len=${#MGMT_SOC_PATTERNS_2[@]} + export TOTAL=18 + ;; + + 3) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${MGMT_SOC_PATTERNS_3[@]}" caravel mgmt_soc 3 $TARGET_PATH + len=${#MGMT_SOC_PATTERNS_3[@]} + export TOTAL=$(( 2*len )) + ;; + + 4) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${MGMT_SOC_PATTERNS_4[@]}" caravel mgmt_soc 4 $TARGET_PATH + len=${#MGMT_SOC_PATTERNS_4[@]} + export TOTAL=$(( 2*len )) + ;; + + 5) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${MGMT_SOC_PATTERNS_5[@]}" caravel mgmt_soc 5 $TARGET_PATH + len=${#MGMT_SOC_PATTERNS_5[@]} + export TOTAL=10 + ;; + + *) + echo -n "unknown ID $ID" + exit 2 + ;; +esac + +cnt=$(grep -i "Passed" $OUT_FILE | wc -l) + + +echo "total passed expected: $TOTAL" +echo "passed found: $cnt" +if [[ $cnt -eq $TOTAL ]]; then echo "PASS" > $VERDICT_FILE; exit 0; fi + +echo "FAIL" > $VERDICT_FILE + + +echo "Total Verdict File:" +cat $VERDICT_FILE + +exit 0 diff --git a/.travisCI/dv/run-dv-set.sh b/.travisCI/dv/run-dv-set.sh new file mode 100755 index 00000000..99bea1b9 --- /dev/null +++ b/.travisCI/dv/run-dv-set.sh @@ -0,0 +1,65 @@ +#!/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 + +PDK_PATH=$1; shift +PATTERNS=( "$@" ) +last_idx=$(( ${#PATTERNS[@]} - 1 )) +TARGET_PATH=${PATTERNS[$last_idx]} +unset PATTERNS[$last_idx] +last_idx=$(( ${#PATTERNS[@]} - 1 )) +ID=${PATTERNS[$last_idx]} +unset PATTERNS[$last_idx] +last_idx=$(( ${#PATTERNS[@]} - 1 )) +TARGET_DV=${PATTERNS[$last_idx]} +unset PATTERNS[$last_idx] +last_idx=$(( ${#PATTERNS[@]} - 1 )) +PARENT=${PATTERNS[$last_idx]} +unset PATTERNS[$last_idx] + + +echo "arg1=$PDK_PATH" +echo "arg2=$PARENT" +echo "arg3=$TARGET_DV" +echo "arg4=$ID" +echo "arg5=$TARGET_PATH" +echo "PATTERNS contains:" +printf "%s\n" "${PATTERNS[@]}" + +export RUN_WRAPPER=$TARGET_PATH/.travisCI/utils/run_wrapper.sh + +OUT_FILE=$TARGET_PATH/$TARGET_DV\_dv.$ID.out +cd $TARGET_PATH/verilog/dv/$PARENT/$TARGET_DV; +touch $OUT_FILE +for PATTERN in ${PATTERNS[*]} +do + echo "Executing DV on $PATTERN"; + cd $PATTERN; + for x in RTL GL + do + export SIM=$x + echo "Running $PATTERN $SIM.." + logFile=$TARGET_PATH/$TARGET_DV\_$PATTERN.$SIM.dv.out + bash $RUN_WRAPPER "make" 2>&1 | tee $logFile + grep "Monitor" $logFile >> $OUT_FILE + make clean + done + echo "Execution Done on $PATTERN!" + cd ..; +done + +cat $OUT_FILE + +exit 0 diff --git a/.travisCI/dv/run-dv-user_proj_example.sh b/.travisCI/dv/run-dv-user_proj_example.sh new file mode 100755 index 00000000..c598759a --- /dev/null +++ b/.travisCI/dv/run-dv-user_proj_example.sh @@ -0,0 +1,62 @@ +#!/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 + +PDK_PATH=$1 +TARGET_PATH=$2 +ID=$3 + +USER_PROJ_EXAMPLE_PATTERNS_1=(io_ports la_test2) +USER_PROJ_EXAMPLE_PATTERNS_2=(la_test1) + + +VERDICT_FILE=$TARGET_PATH/user_proj_example_verdict.out +OUT_FILE=$TARGET_PATH/user_proj_example_dv.$ID.out + +case $ID in + + 1) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${USER_PROJ_EXAMPLE_PATTERNS_1[@]}" caravel user_proj_example 1 $TARGET_PATH + len=${#USER_PROJ_EXAMPLE_PATTERNS_1[@]} + export TOTAL=$(( 2*(len) )) + ;; + + 2) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${USER_PROJ_EXAMPLE_PATTERNS_2[@]}" caravel user_proj_example 2 $TARGET_PATH + len=${#USER_PROJ_EXAMPLE_PATTERNS_2[@]} + export TOTAL=$(( 2*(len) )) + ;; + + *) + echo -n "unknown ID $ID" + exit 2 + ;; +esac + +cnt=$(grep -i "Passed" $OUT_FILE | wc -l) + + +echo "total passed expected: $TOTAL" +echo "passed found: $cnt" +if [[ $cnt -eq $TOTAL ]]; then echo "PASS" > $VERDICT_FILE; exit 0; fi + +echo "FAIL" > $VERDICT_FILE + + +echo "Total Verdict File:" +cat $VERDICT_FILE + +exit 0 + diff --git a/.travisCI/dv/run-dv-wb_utests.sh b/.travisCI/dv/run-dv-wb_utests.sh new file mode 100755 index 00000000..67246886 --- /dev/null +++ b/.travisCI/dv/run-dv-wb_utests.sh @@ -0,0 +1,53 @@ +#!/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 + +PDK_PATH=$1 +TARGET_PATH=$2 +ID=$3 +WB_UTESTS_PATTERNS_1=(intercon_wb spimemio_wb storage_wb uart_wb gpio_wb la_wb mprj_ctrl sysctrl_wb spi_sysctrl_wb mem_wb mgmt_protect chip_io) + +VERDICT_FILE=$TARGET_PATH/wb_utests_verdict.out +OUT_FILE=$TARGET_PATH/wb_utests_dv.$ID.out + +case $ID in + + 1) + bash $TARGET_PATH/.travisCI/dv/run-dv-set.sh $PDK_PATH "${WB_UTESTS_PATTERNS_1[@]}" . wb_utests 1 $TARGET_PATH + len=${#WB_UTESTS_PATTERNS_1[@]} + tot=$(( len*2 )) + ;; + + *) + echo -n "unknown ID $ID" + exit 2 + ;; +esac + +cnt=$(grep -i "Passed" $OUT_FILE | wc -l) + + +echo "array length: $len" +echo "total passed expected: $tot" +echo "passed found: $cnt" +if [[ $cnt -eq $tot ]]; then echo "PASS" > $VERDICT_FILE; exit 0; fi + +echo "FAIL" > $VERDICT_FILE + + +echo "Total Verdict File:" +cat $VERDICT_FILE + +exit 0 diff --git a/.travisCI/lvs/lvs-check.sh b/.travisCI/lvs/lvs-check.sh new file mode 100755 index 00000000..7a088349 --- /dev/null +++ b/.travisCI/lvs/lvs-check.sh @@ -0,0 +1,57 @@ +#!/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 +block=$1 +export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG +export CARAVEL_PATH=$(pwd) +cd ../ +export PDK_ROOT=$(pwd)/pdks +cd $CARAVEL_PATH +export PDKPATH=$PDK_ROOT/sky130A +make uncompress + +# LVS +BLOCKS=($block) +if [ $block == all ]; then + BLOCKS=$(cd openlane && find * -maxdepth 0 -type d ! -name "caravel" ! -name "caravan" ! -name "chip_io_alt" ! -name "chip_io" ! -name "mgmt_core" ! -name "user_project_wrapper_empty" ! -name "user_analog_project_wrapper_empty") +fi + +echo "Running Full LVS:" +for BLOCK in ${BLOCKS[*]} +do + echo "Running Full LVS on block $BLOCK:" + docker run -it -v $CARAVEL_PATH:$CARAVEL_PATH -e CARAVEL_PATH=$CARAVEL_PATH -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "cd $CARAVEL_PATH; make lvs-$BLOCK" + + lvs_report=$CARAVEL_PATH/spi/lvs/tmp/$BLOCK.lvs.summary.log + if [ -f $lvs_report ]; then + lvs_total_errors=$(grep "Total errors =" $lvs_report -s | tail -1 | sed -r 's/[^0-9]*//g') + if ! [[ $lvs_total_errors ]]; then lvs_total_errors=0; fi + else + echo "lvs check failed due to netgen failure"; + exit 2; + fi + + echo "LVS summary:" + cat $lvs_report + echo "Total Count: $lvs_total_errors" + if [[ $BLOCK != caravel ]] && [[ $BLOCK != caravan ]] ; then + if [[ $lvs_total_errors -ne 0 ]]; then exit 2; fi + else + if [[ $lvs_total_errors -gt 7 ]]; then exit 2; fi + fi +done +echo "All LVS checks on all blocks passed!" + +exit 0 diff --git a/.travisCI/lvs/maglef-lvs-check.sh b/.travisCI/lvs/maglef-lvs-check.sh new file mode 100755 index 00000000..7d735895 --- /dev/null +++ b/.travisCI/lvs/maglef-lvs-check.sh @@ -0,0 +1,43 @@ +#!/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 IMAGE_NAME=efabless/openlane:$OPENLANE_TAG +export CARAVEL_PATH=$(pwd) +cd ../ +export PDK_ROOT=$(pwd)/pdks +cd $CARAVEL_PATH +export PDKPATH=$PDK_ROOT/sky130A +make uncompress + +# MAGLEF LVS +echo "Running Abstract (maglef) LVS:" +docker run -it -v $CARAVEL_PATH:$CARAVEL_PATH -e CARAVEL_PATH=$CARAVEL_PATH -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "cd $CARAVEL_PATH; make lvs-maglef-caravel" + +lvs_report=$CARAVEL_PATH/spi/lvs/tmp/caravel.maglef.lvs.summary.log +if [ -f $lvs_report ]; then + lvs_total_errors=$(grep "Total errors =" $lvs_report -s | tail -1 | sed -r 's/[^0-9]*//g') + if ! [[ $lvs_total_errors ]]; then lvs_total_errors=0; fi +else + echo "lvs check failed due to netgen failure"; + exit 2; +fi + +echo "Maglef LVS summary:" +cat $lvs_report +echo "Total Count: $lvs_total_errors" + +if [[ $lvs_total_errors -eq 0 ]]; then exit 0; fi +exit 2 diff --git a/.travisCI/openlane_build/build_openlane.sh b/.travisCI/openlane_build/build_openlane.sh new file mode 100755 index 00000000..9139df36 --- /dev/null +++ b/.travisCI/openlane_build/build_openlane.sh @@ -0,0 +1,25 @@ +#!/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 TARGET_PATH=$(pwd) +cd .. +export PDK_ROOT=$(pwd)/pdks +export OPENLANE_ROOT=$(pwd)/openlane +cd $TARGET_PATH +export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG +cd openlane +make openlane +exit 0 diff --git a/.travisCI/openlane_build/run_macro.sh b/.travisCI/openlane_build/run_macro.sh new file mode 100755 index 00000000..dcdcbfff --- /dev/null +++ b/.travisCI/openlane_build/run_macro.sh @@ -0,0 +1,34 @@ +#!/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 TARGET_PATH=$(pwd) +export RUN_WRAPPER=$TARGET_PATH/.travisCI/utils/run_wrapper.sh +cd .. +export PDK_ROOT=$(pwd)/pdks +export OPENLANE_ROOT=$(pwd)/openlane +cd $TARGET_PATH +export TARGET_MACRO=$1 +export logFile=$TARGET_MACRO.run.log +make uncompress +cd openlane + +bash $RUN_WRAPPER "make $TARGET_MACRO" 2>&1 | tee $logFile + +rm -rf $TARGET_MACRO/runs + +cnt=$(grep -c "Flow Completed Without Fatal Errors" $logFile) +if ! [[ $cnt ]]; then cnt=0; fi +if [[ $cnt -eq 1 ]]; then exit 0; fi +exit 2 diff --git a/.travisCI/openlane_build/run_make_ship.sh b/.travisCI/openlane_build/run_make_ship.sh new file mode 100755 index 00000000..d9217e31 --- /dev/null +++ b/.travisCI/openlane_build/run_make_ship.sh @@ -0,0 +1,28 @@ +#!/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 CARAVEL_PATH=$(pwd) +cd .. +export PDK_ROOT=$(pwd)/pdks +export OPENLANE_ROOT=$(pwd)/openlane +cd $CARAVEL_PATH +export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG + +rm -rf maglef/user_proj_example.mag +rm -rf maglef/user_project_wrapper.mag + +docker run -it -v $CARAVEL_PATH:$CARAVEL_PATH -v $OPENLANE_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e CARAVEL_PATH=$CARAVEL_PATH -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) $IMAGE_NAME bash -c "cd $CARAVEL_PATH; make ship;" + +exit 0 diff --git a/.travisCI/precheck/precheckBuild.sh b/.travisCI/precheck/precheckBuild.sh new file mode 100755 index 00000000..d6181901 --- /dev/null +++ b/.travisCI/precheck/precheckBuild.sh @@ -0,0 +1,36 @@ +#!/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 + +# By default build pdk since we don't need the other script for the main purpose +export SKIP_PDK_BUILD=${1:-0} + +export TARGET_PATH=$(pwd) +git clone https://github.com/efabless/open_mpw_precheck.git + +docker pull efabless/open_mpw_precheck:latest + + +if [ $SKIP_PDK_BUILD -eq 0 ]; then + cd $TARGET_PATH/.. + export PDK_ROOT=$(pwd)/precheck_pdks + mkdir $PDK_ROOT + cd $TARGET_PATH/open_mpw_precheck/dependencies + sh build-pdk.sh + cd $TARGET_DIR + +fi + +exit 0 diff --git a/.travisCI/precheck/run-precheck.sh b/.travisCI/precheck/run-precheck.sh new file mode 100755 index 00000000..569ecc7e --- /dev/null +++ b/.travisCI/precheck/run-precheck.sh @@ -0,0 +1,35 @@ +#!/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 TARGET_PATH=$(pwd) +cd .. +export PDK_ROOT=$(pwd)/precheck_pdks +cd $TARGET_PATH/open_mpw_precheck/ + +docker run -v $(pwd):/usr/local/bin -v $TARGET_PATH:$TARGET_PATH -v $PDK_ROOT:$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/open_mpw_precheck:latest bash -c "python3 open_mpw_prechecker.py -p $PDK_ROOT -t $TARGET_PATH" +output=$TARGET_PATH/checks/full_log.log + +gzipped_file=$TARGET_PATH/checks/full_log.log.gz + +if [[ -f $gzipped_file ]]; then + gzip -d $gzipped_file +fi + +grep "Violation Message" $output + +cnt=$(grep -c "All Checks PASSED!" $output) +if ! [[ $cnt ]]; then cnt=0; fi +if [[ $cnt -eq 1 ]]; then exit 0; fi +exit 2 diff --git a/.travisCI/utils/bash_run_wrapper.sh b/.travisCI/utils/bash_run_wrapper.sh new file mode 100755 index 00000000..701739c1 --- /dev/null +++ b/.travisCI/utils/bash_run_wrapper.sh @@ -0,0 +1,25 @@ +#!/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 + +# Abort on Error +set -e + +# Test script is provided as a relative path +export WORKDIR=$(pwd) +export TEST_SCRIPT=$WORKDIR/$1 +export TAILING_LINES=${2:-500} + +bash $WORKDIR/.travisCI/utils/run_wrapper.sh "bash $TEST_SCRIPT" "$TAILING_LINES" diff --git a/.travisCI/utils/pdkBuild.sh b/.travisCI/utils/pdkBuild.sh new file mode 100755 index 00000000..c8304973 --- /dev/null +++ b/.travisCI/utils/pdkBuild.sh @@ -0,0 +1,55 @@ +#!/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) + + +# By default skip timing since we don't need the libs in any of the CI tests +export SKIP_TIMING=${1:-1} +export IMAGE_NAME=efabless/openlane:$OPENLANE_TAG +docker pull $IMAGE_NAME + +cd $RUN_ROOT/.. +export PDK_ROOT=$(pwd)/pdks +mkdir $PDK_ROOT +echo $PDK_ROOT +echo $RUN_ROOT +cd $RUN_ROOT +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 -it -v $RUN_ROOT:/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT $IMAGE_NAME bash -c "yum install -y https://packages.endpoint.com/rhel/7/os/x86_64/endpoint-repo-1.7-1.x86_64.rpm ; yum install -y git; make build-pdk" +echo "done installing" +cd $RUN_ROOT +exit 0 diff --git a/.travisCI/utils/run_wrapper.sh b/.travisCI/utils/run_wrapper.sh new file mode 100755 index 00000000..aeb511f2 --- /dev/null +++ b/.travisCI/utils/run_wrapper.sh @@ -0,0 +1,59 @@ +#!/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 + +# Adopted from Chris Snow +# https://stackoverflow.com/questions/26082444/how-to-work-around-travis-cis-4mb-output-limit/26082445#26082445 + +# Abort on Error +set -e + +# Test script is provided as a relative path +export WORKDIR=$(pwd) +export COMMAND=$1 +export TAILING_LINES=${2:-500} +export PING_SLEEP=30s +export BUILD_OUTPUT=$WORKDIR/build.out + +touch $BUILD_OUTPUT + +dump_output() { + echo Tailing the last $TAILING_LINES lines of output: + tail -$TAILING_LINES $BUILD_OUTPUT + rm -f $BUILD_OUTPUT +} +error_handler() { + echo ERROR: An error was encountered with the build. + dump_output + kill $PING_LOOP_PID + exit 1 +} +# If an error occurs, run our error handler to output a tail of the build +trap 'error_handler' ERR + +# Set up a repeating loop to send some output to Travis. + +bash -c "while true; do echo \$(date) - running $COMMAND ...; sleep $PING_SLEEP; done" & +export PING_LOOP_PID=$! + +# your_build_command_1 >> $BUILD_OUTPUT 2>&1 +# your_build_command_2 >> $BUILD_OUTPUT 2>&1 +$COMMAND >> $BUILD_OUTPUT 2>&1 + +# The build finished without returning an error so dump a tail of the output +dump_output + +# nicely terminate the ping output loop +kill $PING_LOOP_PID diff --git a/README.md b/README.md deleted file mode 100644 index 103e21ff..00000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# caravel_openframe - -This is an ongoing investigation regarding the creation of a new openframe based version of Caravel. - -Link to schedule: https://plan.tomsplanner.com/public/caravel-openframe diff --git a/README.rst b/README.rst index 6703dedd..f80696d6 100644 --- a/README.rst +++ b/README.rst @@ -39,13 +39,16 @@ Table of contents Overview ======== -Caravel is a template SoC for Google SKY130 free shuttles. The +Caravel is a template SoC for Efabless Open MPW and chipIgnite shuttles based on the Sky130 node from SkyWater Technologies. The current SoC architecture is given below. +.. image:: docs/jpg/caravel_block_diagram.jpg + :align: center + .. raw:: html
- +
Datasheet and detailed documentation exist `here- -
+.. image:: docs/source/_static/caravel_block_diagram.jpg + :align: center Datasheet and detailed documentation exist `here