Skip to content

Commit

Permalink
Rewrite dffram.py to use OpenLane 2 + Nix (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
donn authored Jul 26, 2023
1 parent 8b1ca63 commit d7aed04
Show file tree
Hide file tree
Showing 12 changed files with 433 additions and 1,118 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,30 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.11
- name: Setup Cachix
uses: cachix/cachix-action@v12
with:
name: openlane
- name: Run
run: |
pip3 install --upgrade --no-cache-dir -r ./requirements.txt
building_blocks=ram
if [ "${{ matrix.variant }}" == "2R1W" ]; then
building_blocks=rf
fi
./dffram.py\
-s ${{ matrix.count }}x${{ matrix.width }}\
-b sky130A:sky130_fd_sc_hd:$building_blocks\
-v ${{ matrix.variant }}
nix-shell --run "\
./dffram.py ${{ matrix.count }}x${{ matrix.width }}\
-p sky130A\
-s sky130_fd_sc_hd\
-v ${{ matrix.variant }}\
-b $building_blocks\
"
echo "PRODUCTS_PATH=$(cat ./products_path)" >> $GITHUB_ENV
echo "PRODUCTS_PATH=$(echo products/*)" >> $GITHUB_ENV
- name: Upload Final Views
uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ support/
*.cvcrc
*.xz
venv/
/products_path
/products_path
/products
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
all: dist

.PHONY: dist
dist: venv/created
dist: venv/manifest.txt
./venv/bin/python3 setup.py sdist bdist_wheel

.PHONY: lint
lint: venv/created
lint: venv/manifest.txt
./venv/bin/black --check .
./venv/bin/flake8 .

venv: venv/created
venv/created: ./requirements_dev.txt ./requirements.txt
venv: venv/manifest.txt
venv/manifest.txt: ./requirements_dev.txt ./requirements.txt
rm -rf venv
python3 -m venv ./venv
./venv/bin/python3 -m pip install --upgrade pip
./venv/bin/python3 -m pip install --upgrade wheel
./venv/bin/python3 -m pip install --upgrade\
PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade pip
PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade wheel
PYTHONPATH= ./venv/bin/python3 -m pip install --upgrade\
-r ./requirements_dev.txt\
-r ./requirements.txt
touch venv/created
PYTHONPATH= ./venv/bin/python3 -m pip freeze > $@
touch venv/manifest.txt

.PHONY: veryclean
veryclean: clean
Expand Down
17 changes: 6 additions & 11 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,11 @@

Standard Cell Library based Memory Compiler using DFF/Latch cells.

# Quick Usage
You can try the [Google Colaboratory](https://colab.research.google.com/github/Cloud-V/DFFRAM/blob/main/dffram.ipynb), but also...
# Installation & Usage
See [this document](./docs/Usage.md).

[Get **Docker**](https://docs.docker.com/get-docker/), set it up nicely, then, in your terminal:

```sh
pip3 install --user --no-cache-dir --upgrade ./requirements.txt
./dffram.py -s 32x32
```

If all goes well, you've placed your first register file!
You can try the [Google Colaboratory](https://colab.research.google.com/github/Cloud-V/DFFRAM/blob/main/dffram.ipynb),
but it is a bit out-of-date at this point.

# Overview
The objective of this project is to develop a DFF/Latch-based RAM, Register File and Cache custom compilation flow that utilizes standard cell libraries following a standard ASIC (Application Specific Integrated Circuit) implementation approach. Different views (HDL netlist, HDL functional models, LEF, GDS, Timing, …) are all generated for a given size configuration.
Expand Down Expand Up @@ -142,7 +136,8 @@ The following table compares the areas and bit densities of RAM macros generated

# ⚖️ Copyright and Licensing
<a id="copyright-and-licensing"></a>
Copyright ©2020-2022 The American University in Cairo

Copyright ©2020-2023 The American University in Cairo

Licensed under the Apache License, Version 2.0 (the "Open Source License");
you may not use this file except in compliance with the Open Source License.
Expand Down
12 changes: 7 additions & 5 deletions dffram.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
"id": "eukW5KG9kq7A"
},
"source": [
"# DFFRAM Compiler\n",
"# DFFRAM Compiler\n",
"\n",
"Standard Cell Library based Memory Compiler using DFF/Latch cells.\n",
"\n",
" Standard Cell Library based Memory Compiler using DFF/Latch cells.\n",
"\n",
"## Warning!\n",
"\n",
"\n"
"This notebook should still work, but is out of date and does not reflect the\n",
"latest DFFRAM release. Use at your own risk!"
]
},
{
Expand Down Expand Up @@ -325,7 +327,7 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3.10.9 64-bit",
"display_name": "Python 3.10.9 ('venv': venv)",
"language": "python",
"name": "python3"
},
Expand All @@ -343,7 +345,7 @@
},
"vscode": {
"interpreter": {
"hash": "3fe098a60de41da4d418149dd85333239847aa92272c8f79d3c6f03653219927"
"hash": "192516fa94e535c4f5cf27eeef389e5df5ced4f52a77092f31776bfbcc9cff03"
}
}
},
Expand Down
Loading

0 comments on commit d7aed04

Please sign in to comment.