Skip to content

Commit

Permalink
Merge pull request #58 from efabless/develop
Browse files Browse the repository at this point in the history
Develop -> Master

Support for analog projects.
  • Loading branch information
jeffdi committed May 8, 2021
2 parents 29c19bc + 1354d38 commit d6d8f94
Show file tree
Hide file tree
Showing 22 changed files with 14,916 additions and 3,069 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/auto-update-caravel-lite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
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 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 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 git@github.com:efabless/caravel-lite.git
git push --force caravel_lite main
git push --tags caravel_lite main
git push -f --tags caravel_lite main
58 changes: 50 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ SPECIAL_VOLTAGE_LIBRARY ?= sky130_fd_sc_hvl
IO_LIBRARY ?= sky130_fd_io
PRIMITIVES_LIBRARY ?= sky130_fd_pr
SKYWATER_COMMIT ?= bb2f842ac8d1b750677ca25bc71fb312859edb82
OPEN_PDKS_COMMIT ?= b06f0f2148abd1b4f8ef60999f9991775cd87a7e
OPEN_PDKS_COMMIT ?= 7e29496eecf3ee8e1766f1b7f9441f97204d4735
INSTALL_SRAM ?= disabled

.DEFAULT_GOAL := ship
# We need portable GDS_FILE pointers...
.PHONY: ship
ship: check-env uncompress
ship: check-env uncompress uncompress-caravel
ifeq ($(FOREGROUND),1)
@echo "Running make ship in the foreground..."
$(MAKE) __ship
Expand Down Expand Up @@ -97,6 +97,41 @@ __ship:
@cd $(CARAVEL_ROOT)/mag && PDKPATH=${PDK_ROOT}/sky130A magic -noc -dnull mag2gds_caravel.tcl 2>&1 | tee $(UPRJ_ROOT)/signoff/build/make_ship.out
@rm $(CARAVEL_ROOT)/mag/mag2gds_caravel.tcl

truck: check-env uncompress uncompress-caravel
ifeq ($(FOREGROUND),1)
@echo "Running make truck in the foreground..."
mkdir -p ./signoff
mkdir -p ./build
$(MAKE) __truck
@echo "Make truck completed." 2>&1 | tee -a ./signoff/build/make_truck.out
else
@echo "Running make truck in the background..."
mkdir -p ./signoff
mkdir -p ./build
nohup $(MAKE) __truck >/dev/null 2>&1 &
tail -f signoff/build/make_truck.out
@echo "Make truck completed." 2>&1 | tee -a ./signoff/build/make_truck.out
endif

__truck:
@echo "###############################################"
@echo "Generating Caravan GDS (sources are in the 'gds' directory)"
@sleep 1
#### Runs from the CARAVEL_ROOT mag directory
@echo "\
random seed `$(CARAVEL_ROOT)/scripts/set_user_id.py -report`; \
gds readonly true; \
gds rescale false; \
gds read $(UPRJ_ROOT)/gds/user_analog_project_wrapper.gds; \
load caravan -dereference;\
select top cell;\
gds write $(UPRJ_ROOT)/gds/caravan.gds; \
exit;" > $(CARAVEL_ROOT)/mag/mag2gds_caravan.tcl
### Runs from UPRJ_ROOT
@mkdir -p ./signoff/build
@cd $(CARAVEL_ROOT)/mag && PDKPATH=${PDK_ROOT}/sky130A magic -noc -dnull mag2gds_caravan.tcl 2>&1 | tee $(UPRJ_ROOT)/signoff/build/make_truck.out
@rm $(CARAVEL_ROOT)/mag/mag2gds_caravan.tcl

.PHONY: clean
clean:
cd $(CARAVEL_ROOT)/verilog/dv/caravel/mgmt_soc/ && \
Expand Down Expand Up @@ -154,9 +189,15 @@ $(SPLIT_FILES_SOURCES): %: $$(sort $$(wildcard %.$(ARCHIVE_EXT).*.split))
uncompress: $(SPLIT_FILES_SOURCES) $(ARCHIVE_SOURCES)
@echo "All files are uncompressed!"

# Needed for targets that are run from UPRJ_ROOT for which caravel isn't submoduled.
.PHONY: uncompress-caravel
uncompress-caravel:
cd $(CARAVEL_ROOT) && \
$(MAKE) uncompress

# Digital Wrapper
# verify that the wrapper was respected
xor-wrapper: uncompress
xor-wrapper: uncompress uncompress-caravel
### first erase the user's user_project_wrapper.gds
sh $(CARAVEL_ROOT)/utils/erase_box.sh gds/user_project_wrapper.gds 0 0 2920 3520
### do the same for the empty wrapper
Expand All @@ -180,12 +221,13 @@ xor-wrapper: uncompress
signoff/user_project_wrapper_xor/user_project_wrapper.xor.gds
@cat signoff/user_project_wrapper_xor/total.txt

# Analog Wrapper
# verify that the wrapper was respected
xor-analog-wrapper: uncompress
xor-analog-wrapper: uncompress uncompress-caravel
### 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
sh $(CARAVEL_ROOT)/utils/erase_box.sh gds/user_analog_project_wrapper.gds 0 0 2920 3520 -8 -8
### 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
sh $(CARAVEL_ROOT)/utils/erase_box.sh $(CARAVEL_ROOT)/gds/user_analog_project_wrapper_empty.gds 0 0 2920 3520 -8 -8
mkdir -p signoff/user_analog_project_wrapper_xor
### XOR the two resulting layouts
sh $(CARAVEL_ROOT)/utils/xor.sh \
Expand Down Expand Up @@ -364,7 +406,7 @@ __generate_fill:


.PHONY: final
final: check-env check-uid uncompress
final: check-env check-uid uncompress uncompress-caravel
ifeq ($(FOREGROUND),1)
$(MAKE) __final
@echo "Final build completed." 2>&1 | tee -a ./signoff/build/final_build.out
Expand All @@ -386,7 +428,7 @@ __final:
@rm -rf ./mag/tmp

.PHONY: set_user_id
set_user_id: check-env check-uid uncompress
set_user_id: check-env check-uid uncompress uncompress-caravel
ifeq ($(FOREGROUND),1)
$(MAKE) __set_user_id
@echo "Set user ID completed." 2>&1 | tee -a ./signoff/build/set_user_id.out
Expand Down
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@ Digital user projects should adhere the following requirements:
Analog User Project
------------------

> :construction: Under construction :construction:
If you are building an analog project for the user space, check a sample project at `caravel_user_project_analog <https://github.com/efabless/caravel_user_project_analog>`__.

Analog user projects should adhere the following requirements:

- Top module is named ``user_analog_project_wrapper``

- The ``user_analog_project_wrapper`` uses the `empty analog wrapper <https://github.com/efabless/caravel/blob/master/mag/user_analog_project_wrapper_empty.mag>`__.

- The ``user_analog_project_wrapper`` adheres to the same pin order and placement of the `empty analog wrapper <https://github.com/efabless/caravel/blob/master/mag/user_analog_project_wrapper_empty.mag>`__.

------

Expand Down Expand Up @@ -178,7 +186,7 @@ Required Directory Structure
project.
- ``maglef`` : includes all the maglef files used or produced from the
project.
- ``spi/lvs/`` : includes all the maglef files used or produced from the
- ``spi/lvs/`` : includes all the spice files used or produced from the
project.
- ``verilog/dv`` : includes all the simulation test benches and how to
run them.
Expand Down Expand Up @@ -207,6 +215,7 @@ Additional Material
MPW Two
--------

- `Open MPW Program - MPW-TWO Walkthrough <https://www.youtube.com/watch?v=jBrBqhVNgDo>`__
- `MPW Two Shuttle Program <https://efabless.com/open_shuttle_program/2>`__

.. _mpw-one:
Expand All @@ -219,7 +228,7 @@ MPW One
- `Things to Clarify About Caravel -- What versions to use with Caravel? <https://youtu.be/-LZ522mxXMw>`__
- `45 Chips in 30 Days: Open Source ASIC at its best! <https://www.youtube.com/watch?v=qlBzE27at6M>`__

Check ``mpw-one-final`` for the caravel used for the mpw-one tapeout.
Check `mpw-one-final <https://github.com/efabless/caravel/tree/mpw-one-final>`__ for the caravel used for the mpw-one tapeout.

> :warning: You don't need to integrate your design with Caravel GDS for **MPW two**. Running ``make ship`` is no longer required.

Expand Down
Loading

0 comments on commit d6d8f94

Please sign in to comment.