Skip to content

Commit

Permalink
Develop -> Master (#53)
Browse files Browse the repository at this point in the history
* Fix analog_io placemnet

* [CI] Add workflow for auto-updating caravel-lite

* [CI] Silence lvs checks for caravel and GL sim for caravel and qspi

* Modified the "caravan" analog project to replace 8 of the 11 power
pads being used as placeholders for the analog I/O with the new
sky130_ef_io__analog_pad.  The remaining 3 pads continue to use
sky130_fd_io__top_power_hvc_wpadv2, providing a few clamp circuits
that users can connect to additional analog power supplies if they
need them.

* Apply automatic changes to Manifest and README.rst

* Added three user project IRQ lines to input to the management SoC to
allow the SoC to respond to triggered events from the user project
instead of having to poll for them.

* Apply automatic changes to Manifest and README.rst

* Modified the GPIO control block to propagate the clock and reset
signals.  Otherwise, per the existing MPW-one caravel chip, the
top-level routing is not generating a clock tree and so creates a
long and highly resistive network for clock and reset that will
probably cause the clock rate to have to be significantly reduced
for the serial load to work.  The modification means that the
management SoC only drives clock and reset on the first control
block on each side.  The signal transfer then ripples from the front
to the end of each serial chain, mitigating timing issues.

* Apply automatic changes to Manifest and README.rst

* Additional changes to caravel:  (1) Added "input enable" bits for
each logic analyzer input from the user project to the management
SoC.  This allows the user to ignore any bits not being used, and
they do not need to be wired out from the user project.  (2)
Made a simple change to the way the logic analyzer reads inputs,
which decouples inputs and outputs.  This doubles the number of
available logic analyzer bits by allowing simultaneous use of
128 inputs and 128 outputs.  (3) Added logic to the management
protect block so that the output enable signals work as advertised
and put the output into a high-impedence state.  Previously it
could be used by the user project to selectively multiplex the
output, but did not prevent the output from being driven.

* Apply automatic changes to Manifest and README.rst

* One additional useful function for the logic analyzer, to sample across
the entire set of 128 bits, with a simultaneous data capture.

* Apply automatic changes to Manifest and README.rst

* Update open_pdks and skywater pdk to latest

* Add analog wrapper

* Apply automatic changes to Manifest and README.rst

* Corrected errors in the chip_io_alt layout for caravan, pointed out
by Manar Abdelatty, where the references were to sky130_fd_io__analog_pad,
which was done before I decided to make the name sky130_ef_io__analog_pad.

* Update analog wrapper

- fixed placement of io_in_3v3 pins
- dropped power straps

* Makefile updates

- add target for running xor against analog wrapper
- change open_pdks url to github for now till opencircuit design is stable

* [CI] fix dv script

* [CI] Update lvs

- dropeed chip_io from CI, needs to be rebuilt with latest pdk
- currently fails due to name changes from ef_io -> fd_io

* [CI] fix lvs script

* [DV] update wb_utests to reflect new changes to LA and mgmt_protect

* [CI] Run RTL simulation only for now since GL netlists are obselete

* Documentation updates

* Apply automatic changes to Manifest and README.rst

* [CI] Run DV on every push

* [CI] update number of total expected "passes"

* Update README.src.rst

* Apply automatic changes to Manifest and README.rst

* Update wrapper view

* Update Makefile

* Fix gpio_control_block serial_clock_out definition

* Apply automatic changes to Manifest and README.rst

* Removed unused gpio_control blocks from caravan.  Redrew the
user analog project wrapper to maximize area and to bring the
power supplies directly into the user core as stub connections.
Redrew the analog connections larger to match the pads, and
added the clamp connections on the three remaining power pads
in the middle.

* Modified the analog padframe, wrapper, and caravan harness to better
reflect what I need all of them to look like.

* Doc updates

* Apply automatic changes to Manifest and README.rst

* [DATA] Update wrappers views

* Update documentation

* Apply automatic changes to Manifest and README.rst

* Restore mgmt_core.mag.gz

* [CI] update caravel-lite

Co-authored-by: Tim Edwards <[email protected]>
Co-authored-by: RTimothyEdwards <[email protected]>
Co-authored-by: Manarabdelaty <[email protected]>
  • Loading branch information
4 people authored Apr 29, 2021
1 parent 928af6f commit 29c19bc
Show file tree
Hide file tree
Showing 53 changed files with 95,836 additions and 7,247 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/auto-update-caravel-lite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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

# This is a workflow to automatically update caravel-lite whenever caravel master is updated.
name: Auto Update Caravel Lite

# Controls when the action will run.
on:
# Trigger the workflow on push to master branch
push:
branches:
- master
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa # optional
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Install git-filter-repo
run: pip install git-filter-repo

- name: Update Caravel Lite
run: |
mkdir -p caravel-lite
cd caravel-lite
git init
git checkout -b main
git remote add parent https://github.com/efabless/caravel
git pull parent master
git fetch --all --tags
git filter-repo --path openlane/user_project_wrapper_empty --path openlane/Makefile --path gds/user_project_wrapper_empty.gds.gz --path verilog/ --path info.yaml --path Makefile --path scripts/ --path utils/ --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 --force
git remote add caravel_lite [email protected]:efabless/caravel-lite.git
git push --force caravel_lite main
git push --tags caravel_lite main
30 changes: 12 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ jobs:
- 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 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 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 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 mgmt_core LVS Test"
stage: test
install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh
Expand All @@ -62,40 +62,34 @@ jobs:
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 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 OR type=api
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 OR type=api
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 OR type=api
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 OR type=api
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 OR type=api
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 OR type=api
install: bash .travisCI/utils/bash_run_wrapper.sh .travisCI/utils/pdkBuild.sh
script: bash .travisCI/dv/dv-check-wrapper.sh wb_utests 1
10 changes: 5 additions & 5 deletions .travisCI/dv/run-dv-mgmt_soc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,31 @@ 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 ))
export TOTAL=$(( 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=16
export TOTAL=8
;;

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 ))
export TOTAL=$(( 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 ))
export TOTAL=$(( 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=8
export TOTAL=5
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion .travisCI/dv/run-dv-set.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ for PATTERN in ${PATTERNS[*]}
do
echo "Executing DV on $PATTERN";
cd $PATTERN;
for x in RTL GL
for x in RTL
do
export SIM=$x
echo "Running $PATTERN $SIM.."
Expand Down
2 changes: 1 addition & 1 deletion .travisCI/dv/run-dv-wb_utests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ 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=$(( 2*(len) ))
tot=$(( len ))
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion .travisCI/lvs/lvs-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
echo "Running Full LVS:"
for BLOCK in ${BLOCKS[*]}
do
if [[ $BLOCK != DFFRAM ]]; then
if [ $BLOCK != DFFRAM ] && [ $BLOCK != user_analog_project_wrapper_empty ]; then
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"

Expand Down
52 changes: 39 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ STD_CELL_LIBRARY ?= sky130_fd_sc_hd
SPECIAL_VOLTAGE_LIBRARY ?= sky130_fd_sc_hvl
IO_LIBRARY ?= sky130_fd_io
PRIMITIVES_LIBRARY ?= sky130_fd_pr
SKYWATER_COMMIT ?= db2e06709dc3d876aa6b74a5f3893fa5f1bc2a6e
OPEN_PDKS_COMMIT ?= f788cea5d98d99a6cf3a7510a478e1de01a33b07
SKYWATER_COMMIT ?= bb2f842ac8d1b750677ca25bc71fb312859edb82
OPEN_PDKS_COMMIT ?= b06f0f2148abd1b4f8ef60999f9991775cd87a7e
INSTALL_SRAM ?= disabled

.DEFAULT_GOAL := ship
Expand Down Expand Up @@ -180,6 +180,31 @@ xor-wrapper: uncompress
signoff/user_project_wrapper_xor/user_project_wrapper.xor.gds
@cat signoff/user_project_wrapper_xor/total.txt

# verify that the wrapper was respected
xor-analog-wrapper: uncompress
### first erase the user's user_project_wrapper.gds
sh $(CARAVEL_ROOT)/utils/erase_box.sh gds/user_analog_project_wrapper.gds 0 0 2920 3520
### do the same for the empty wrapper
sh $(CARAVEL_ROOT)/utils/erase_box.sh $(CARAVEL_ROOT)/gds/user_analog_project_wrapper_empty.gds 0 0 2920 3520
mkdir -p signoff/user_analog_project_wrapper_xor
### XOR the two resulting layouts
sh $(CARAVEL_ROOT)/utils/xor.sh \
$(CARAVEL_ROOT)/gds/user_analog_project_wrapper_empty_erased.gds gds/user_analog_project_wrapper_erased.gds \
user_analog_project_wrapper user_analog_project_wrapper.xor.xml
sh $(CARAVEL_ROOT)/utils/xor.sh \
$(CARAVEL_ROOT)/gds/user_analog_project_wrapper_empty_erased.gds gds/user_analog_project_wrapper_erased.gds \
user_analog_project_wrapper gds/user_analog_project_wrapper.xor.gds > signoff/user_analog_project_wrapper_xor/xor.log
rm $(CARAVEL_ROOT)/gds/user_analog_project_wrapper_empty_erased.gds gds/user_analog_project_wrapper_erased.gds
mv gds/user_analog_project_wrapper.xor.gds gds/user_analog_project_wrapper.xor.xml signoff/user_analog_project_wrapper_xor
python $(CARAVEL_ROOT)/utils/parse_klayout_xor_log.py \
-l signoff/user_analog_project_wrapper_xor/xor.log \
-o signoff/user_analog_project_wrapper_xor/total.txt
### screenshot the result for convenience
sh $(CARAVEL_ROOT)/utils/scrotLayout.sh \
$(PDK_ROOT)/sky130A/libs.tech/klayout/sky130A.lyt \
signoff/user_analog_project_wrapper_xor/user_analog_project_wrapper.xor.gds
@cat signoff/user_analog_project_wrapper_xor/total.txt

# LVS
BLOCKS = $(shell cd openlane && find * -maxdepth 0 -type d)
LVS_BLOCKS = $(foreach block, $(BLOCKS), lvs-$(block))
Expand Down Expand Up @@ -282,13 +307,14 @@ $(LVS_MAGLEF_BLOCKS): lvs-maglef-% : ./mag/%.mag ./verilog/gl/%.v
exit;" > ./mag/extract_$*.tcl
cd mag && export MAGTYPE=maglef; magic -noc -dnull extract_$*.tcl < /dev/null
mv ./mag/$*.spice ./spi/lvs
rm ./maglef/*.ext
mv -f ./mag/extract_$*.{tcl,log} ./maglef/tmp
rm ./mag/*.ext
mv -f ./mag/extract_$*.tcl ./maglef/tmp
mv -f ./mag/extract_$*.log ./maglef/tmp
####
mkdir -p ./spi/lvs/tmp
sh ./spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $*
sh $(CARAVEL_ROOT)/spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $*
@echo ""
python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.maglef.lvs.summary.log
python3 $(CARAVEL_ROOT)/scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.maglef.lvs.summary.log
mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true
@echo ""
@echo "LVS: ./spi/lvs/$*.spice vs. ./verilog/gl/$*.v"
Expand All @@ -301,7 +327,7 @@ DRC_BLOCKS = $(foreach block, $(BLOCKS), drc-$(block))
$(DRC_BLOCKS): drc-% : ./gds/%.gds
echo "Running DRC on $*"
mkdir -p ./gds/tmp
cd gds && export DESIGN_IN_DRC=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.magicrc -noc -dnull ../$(CARAVEL_ROOT)/gds/drc_on_gds.tcl < /dev/null
cd gds && export DESIGN_IN_DRC=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.magicrc -noc -dnull $(CARAVEL_ROOT)/gds/drc_on_gds.tcl < /dev/null
@echo "DRC result: ./gds/tmp/$*.drc"

# Antenna
Expand All @@ -310,7 +336,7 @@ ANTENNA_BLOCKS = $(foreach block, $(BLOCKS), antenna-$(block))
$(ANTENNA_BLOCKS): antenna-% : ./gds/%.gds
echo "Running Antenna Checks on $*"
mkdir -p ./gds/tmp
cd gds && export DESIGN_IN_ANTENNA=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.magicrc -noc -dnull ../$(CARAVEL_ROOT)/gds/antenna_on_gds.tcl < /dev/null 2>&1 | tee ./tmp/$*.antenna
cd gds && export DESIGN_IN_ANTENNA=$* && export MAGTYPE=mag; magic -rcfile ${PDK_ROOT}/sky130A/libs.tech/magic/sky130A.magicrc -noc -dnull $(CARAVEL_ROOT)/gds/antenna_on_gds.tcl < /dev/null 2>&1 | tee ./tmp/$*.antenna
mv -f ./gds/*.ext ./gds/tmp/
@echo "Antenna result: ./gds/tmp/$*.antenna"

Expand Down Expand Up @@ -392,7 +418,7 @@ $(PDK_ROOT)/skywater-pdk:
.PHONY: skywater-pdk
skywater-pdk: check-env $(PDK_ROOT)/skywater-pdk
cd $(PDK_ROOT)/skywater-pdk && \
git checkout master && git pull && \
git checkout main && git pull && \
git checkout -qf $(SKYWATER_COMMIT)

.PHONY: skywater-library
Expand All @@ -415,7 +441,7 @@ skywater-timing: check-env $(PDK_ROOT)/skywater-pdk
$(MAKE) timing
### OPEN_PDKS
$(PDK_ROOT)/open_pdks:
git clone git://opencircuitdesign.com/open_pdks $(PDK_ROOT)/open_pdks
git clone https://github.com/RTimothyEdwards/open_pdks.git $(PDK_ROOT)/open_pdks

.PHONY: open_pdks
open_pdks: check-env $(PDK_ROOT)/open_pdks
Expand All @@ -442,10 +468,10 @@ build-pdk: check-env $(PDK_ROOT)/open_pdks $(PDK_ROOT)/skywater-pdk
manifest: mag/ maglef/ verilog/rtl/ scripts/ Makefile
touch manifest && \
find verilog/rtl/* -type f ! -name "caravel_netlists.v" ! -name "user_*.v" ! -name "README" ! -name "defines.v" -exec shasum {} \; > manifest && \
# find maglef/*.mag -type f ! -name "user_project_wrapper.mag" -exec shasum {} \; >> manifest && \
# shasum mag/caravel.mag mag/.magicrc >> manifest
shasum scripts/set_user_id.py scripts/generate_fill.py scripts/compositor.py >> manifest
# shasum lef/user_project_wrapper_empty.lef >> manifest
# shasum lef/user_project_wrapper_empty.lef >> manifest
# find maglef/*.mag -type f ! -name "user_project_wrapper.mag" -exec shasum {} \; >> manifest && \
# shasum mag/caravel.mag mag/.magicrc >> manifest

check-env:
ifndef PDK_ROOT
Expand Down
Loading

0 comments on commit 29c19bc

Please sign in to comment.