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 `__ diff --git a/README.src.rst b/README.src.rst index e47d424e..ec45ec63 100755 --- a/README.src.rst +++ b/README.src.rst @@ -23,6 +23,11 @@ Caravel Harness |License| |Documentation Status| |Build Status| +.. note:: + + Documentation for this project is being updated to reflect the changes + for the new redesigned version of Caravel. + Table of contents ================= @@ -39,14 +44,11 @@ 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. -.. raw:: html - -

- -

+.. image:: docs/source/_static/caravel_block_diagram.jpg + :align: center Datasheet and detailed documentation exist `here `__ diff --git a/docs/README b/docs/README_DEVELOPMENT similarity index 100% rename from docs/README rename to docs/README_DEVELOPMENT diff --git a/docs/source/_static/caravel_block_diagram.jpg b/docs/source/_static/caravel_block_diagram.jpg new file mode 100644 index 00000000..e23653f3 Binary files /dev/null and b/docs/source/_static/caravel_block_diagram.jpg differ diff --git a/docs/source/_static/caravel_clocking.jpg b/docs/source/_static/caravel_clocking.jpg new file mode 100644 index 00000000..225d2af0 Binary files /dev/null and b/docs/source/_static/caravel_clocking.jpg differ diff --git a/docs/source/_static/caravel_floorplan.jpg b/docs/source/_static/caravel_floorplan.jpg new file mode 100644 index 00000000..e46b6347 Binary files /dev/null and b/docs/source/_static/caravel_floorplan.jpg differ diff --git a/docs/source/_static/counter_timer_function.jpg b/docs/source/_static/counter_timer_function.jpg new file mode 100644 index 00000000..b85cd4aa Binary files /dev/null and b/docs/source/_static/counter_timer_function.jpg differ diff --git a/docs/source/_static/gpio_function.jpg b/docs/source/_static/gpio_function.jpg new file mode 100644 index 00000000..c724595f Binary files /dev/null and b/docs/source/_static/gpio_function.jpg differ diff --git a/docs/source/_static/housekeeping_function.jpg b/docs/source/_static/housekeeping_function.jpg new file mode 100644 index 00000000..aa9049c4 Binary files /dev/null and b/docs/source/_static/housekeeping_function.jpg differ diff --git a/docs/source/_static/irq_function.jpg b/docs/source/_static/irq_function.jpg new file mode 100644 index 00000000..06c87745 Binary files /dev/null and b/docs/source/_static/irq_function.jpg differ diff --git a/docs/source/_static/memory_map.jpg b/docs/source/_static/memory_map.jpg new file mode 100644 index 00000000..f564cdf9 Binary files /dev/null and b/docs/source/_static/memory_map.jpg differ diff --git a/docs/source/_static/monitor_function.jpg b/docs/source/_static/monitor_function.jpg new file mode 100644 index 00000000..fb172ac1 Binary files /dev/null and b/docs/source/_static/monitor_function.jpg differ diff --git a/docs/source/_static/openframe_pinout.jpg b/docs/source/_static/openframe_pinout.jpg new file mode 100644 index 00000000..b12d326b Binary files /dev/null and b/docs/source/_static/openframe_pinout.jpg differ diff --git a/docs/source/_static/qspi_function.jpg b/docs/source/_static/qspi_function.jpg new file mode 100644 index 00000000..93657219 Binary files /dev/null and b/docs/source/_static/qspi_function.jpg differ diff --git a/docs/source/_static/spi_master_function.jpg b/docs/source/_static/spi_master_function.jpg new file mode 100644 index 00000000..e9b7fc30 Binary files /dev/null and b/docs/source/_static/spi_master_function.jpg differ diff --git a/docs/source/_static/uart_function.jpg b/docs/source/_static/uart_function.jpg new file mode 100644 index 00000000..c965e8e3 Binary files /dev/null and b/docs/source/_static/uart_function.jpg differ diff --git a/docs/source/conf.py b/docs/source/conf.py index f960f130..8f659c70 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -33,9 +33,9 @@ # -- Project information ----------------------------------------------------- -project = 'CIIC Harness' -copyright = '2020, efabless' -author = 'efabless' +project = 'Caravel Harness' +copyright = '2021, Efabless' +author = 'Efabless' # -- General configuration --------------------------------------------------- diff --git a/docs/source/description.rst b/docs/source/description.rst index 4ab01e70..3101fdf8 100755 --- a/docs/source/description.rst +++ b/docs/source/description.rst @@ -26,25 +26,14 @@ This section provides basic description of the Efabless Caravel "harness" SoC. Core ---- -The processor core is the PicoRV32 design. -See GitHub `cliffordwolf/picorv32 repository `_ for the core implementation and description. -The hardware implementation is the "large" variant, incorporating options ``IRQ``, ``MUL``, ``DIV``, ``BARREL_SHIFTER``, and ``COMPRESSED_ISA`` (16-bit instructions). - -Core clock rate: (TBD) MHz maximum over all PVT conditions (likely around 50MHz guaranteed). +TO BE UPDATED Features -------- Functions/features of the SoC include: -* 1 SPI flash controller, -* 1 UART, -* 1 SPI controller, -* 2 counter-timers, -* 1 dedicated GPIO channel, -* 27 shared GPIO channels, -* 8k word (32768 bytes x 8 bits) on-board SRAM, -* All-digital frequency-locked loop clock multiplier 128bit logic analyzer. +TO BE UPDATED License ------- diff --git a/docs/source/getting-started.rst b/docs/source/getting-started.rst index 3f8b3ef0..543d5550 100755 --- a/docs/source/getting-started.rst +++ b/docs/source/getting-started.rst @@ -22,31 +22,61 @@ Caravel Architecture ==================== -Caravel is composed of three main sub-blocks: *management area*, *storage area*, and *user project area*. +Caravel is composed of the harness frame plus two wrappers for drop-in modules for the *management area* and *user project area*. + +.. _harness-definition: + +Harness Definition +------------------ + +The harness itself contains the clocking module, DLL, user ID, +housekeeping SPI, POR, and GPIO control. + +GPIO handling moved out of management SoC and into SPI. SPI +gets a wishbone interface; the management SoC talks to the SPI +through wishbone, not by taking over the 4-pin SPI interface. + +A new block like the ID has the mode at power-up for +each GPIO. Can be configured with a text file. SPI pins are +fixed for operation on startup. + +On power-up, the SPI automatically configures the +GPIO. Manual load is possible from both the SPI and from the +wishbone bus. + +All functions within the harness but outside the management SoC +are incorporated into one large module called "housekeeping". +This includes a number of registers for all the included +functions, with a "front door" SPI interface connected to the +padframe through GPIO pins 1 to 4, and a "back door" wishbone +interface connected to the management SoC. The management Soc +reserves the memory block at 0x26000000 for the +housekeeping module. The housekeeping module exchanges data +with the management SoC via an interface that uses the byte- +wide SPI register data. A small state machine reads four +contiguous wishbone addresses and an address decoder determines +the corresponding SPI register. The state machine stalls the +SoC until all four bytes have been handled before returning the +acknowledge signal. .. _management-area: Management Area -------------- -The managment area includes a `picorv32 `__ based SoC that includes a number of periphrals like timers, uart, and gpio. The managemnt area runs firmware that can be used to: +The management area is a drop-in module implemented as a separate repo. +It typically includes a RISC-V based SoC that includes a number of peripherals like timers, uart, and gpio. +The management area runs firmware that can be used to: - Configure User Project I/O pads - Observe and control User Project signals (through on-chip logic analyzer probes) - Control the User Project power supply -For a complete list of the SoC periphrals, check the `memory map `__ +The management area implements SRAM for the management SoC. -.. _storage-area: - -Storage Area --------------- - -The storage area is an auxiliary storage space for the managment SoC. It holds two dual port RAM blocks (1KB) generated by -`OpenRAM `__ - -The storage area is only accessible by the management SoC. +The default instantiation for the management core can be found `here `__ . +See documentation of the management core for further details. .. _user-project-area: @@ -66,8 +96,9 @@ Quick Start for User Projects ============================= Your area is the full user space, so feel free to add your -project there or create a differnt macro and harden it seperately then -insert it into the ``user_project_wrapper`` for digital projects or insert it into ``user_project_analog_wrapper`` for analog projects. +project there or create a different macro and harden it separately then +insert it into the ``user_project_wrapper`` for digital projects or insert it +into ``user_project_analog_wrapper`` for analog projects. .. _digital-user-project: @@ -112,7 +143,7 @@ Analog user projects should adhere the following requirements: IMPORTANT ^^^^^^^^^ -Please make sure to run ``make compress`` before commiting anything to +Please make sure to run ``make compress`` before committing anything to your repository. Avoid having 2 versions of the ``gds/user_project_wrapper.gds`` one compressed and the other not compressed. @@ -171,6 +202,7 @@ MPW Two MPW One -------------- +- `Caravel Legacy Repo (previous version used for MPW-ONE) `__ - `Caravel User Project Features -- What are the utilities provided by caravel to the user project ? `__ - `Aboard Caravel -- How to integrate your design with Caravel? `__ - `Things to Clarify About Caravel -- What versions to use with Caravel? `__ diff --git a/docs/source/index.rst b/docs/source/index.rst index f7325d11..f4968714 100755 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -37,7 +37,6 @@ Efabless Caravel "harness" SoC :hidden: :maxdepth: 1 - description getting-started tool-versioning quick-start diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst index a29106f3..c7e0cee5 100755 --- a/docs/source/introduction.rst +++ b/docs/source/introduction.rst @@ -21,16 +21,16 @@ Introduction ============ +The Efabless Caravel chip is a ready-to-use test harness for creating designs with the Google/Skywater 130nm Open PDK. +The Caravel harness comprises of base functions supporting IO, power and configuration as well as drop-in modules for a +management soc core, and an approximately 2.8mm x 2.8mm open project area for the placement of user IP blocks. -The efabless Caravel chip is a ready-to-use test harness for creating designs with the Google/Skywater 130nm Open PDK. -The Caravel harness comprises a small RISC-V microprocessor based on the simple 2-cycle PicoRV32 RISC-V core implementing the RV32IMC instruction set (see `riscv.org page `_), a 32-bit wishbone bus, and an approximately 2.8mm x 2.8mm open area for the placement of user IP blocks. - -.. figure:: _static/caravel_management_soc_simplified_block_diagram.svg - :name: caravel_management_soc_simplified_block_diagram - :alt: Caravel management SoC simplified block diagram +.. figure:: docs/source/_static/caravel_floorplan.jpg + :name: caravel_floorplan + :alt: Caravel Floorplan :align: center - Caravel management SoC simplified block diagram + Caravel floorplan |