Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
urish authored Nov 13, 2024
0 parents commit 2d22959
Show file tree
Hide file tree
Showing 22 changed files with 841 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG VARIANT=ubuntu-22.04
FROM mcr.microsoft.com/vscode/devcontainers/base:${VARIANT}

ENV DEBIAN_FRONTEND=noninteractive
ENV PDK_ROOT=/home/vscode/ttsetup/pdk
ENV PDK=sky130A

RUN apt update
RUN apt install -y iverilog gtkwave python3 python3-pip python3-venv python3-tk python-is-python3 libcairo2 verilator libpng-dev libqhull-dev

# Clone tt-support-tools
RUN mkdir -p /ttsetup
RUN git clone -b tt10 https://github.com/TinyTapeout/tt-support-tools /ttsetup/tt-support-tools

COPY test/requirements.txt /ttsetup/test_requirements.txt
COPY .devcontainer/copy_tt_support_tools.sh /ttsetup

RUN pip3 install -r /ttsetup/test_requirements.txt -r /ttsetup/tt-support-tools/requirements.txt

# Install verible (for formatting)
RUN umask 022 && \
curl -L https://github.com/chipsalliance/verible/releases/download/v0.0-3795-gf4d72375/verible-v0.0-3795-gf4d72375-linux-static-x86_64.tar.gz | \
tar zxf - -C /usr/local --strip-components=1 && \
chmod 755 /usr/local/bin

# Install openlane
RUN pip3 install openlane==2.1.5
6 changes: 6 additions & 0 deletions .devcontainer/copy_tt_support_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#! /bin/sh

if [ ! -L tt ]; then
cp -R /ttsetup/tt-support-tools tt
cd tt && git pull && cd ..
fi
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu
{
"name": "Tiny Tapeout Dev Container",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"runArgs": [
"--memory=10GB"
],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
},
"extensions": ["mshr-h.veriloghdl", "surfer-project.surfer"]
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"azureDnsAutoDetection": true,
"version": "latest",
"dockerDashComposeVersion": "none"
}
},
"postStartCommand": "/ttsetup/copy_tt_support_tools.sh"
}
17 changes: 17 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: docs

on:
push:
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build docs
uses: TinyTapeout/tt-gds-action/docs@tt10
19 changes: 19 additions & 0 deletions .github/workflows/fpga.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: fpga

on:
push:
# Comment out (or remove) the following line to run the FPGA workflow on every push:
branches: none
workflow_dispatch:

jobs:
fpga:
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: FPGA bitstream for TT ASIC Sim (ICE40UP5K)
uses: TinyTapeout/tt-gds-action/fpga/ice40up5k@tt10
47 changes: 47 additions & 0 deletions .github/workflows/gds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: gds

on:
push:
workflow_dispatch:

jobs:
gds:
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build GDS
uses: TinyTapeout/tt-gds-action@tt10
with:
flow: openlane2

precheck:
needs: gds
runs-on: ubuntu-24.04
steps:
- name: Run Tiny Tapeout Precheck
uses: TinyTapeout/tt-gds-action/precheck@tt10

gl_test:
needs: gds
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: GL test
uses: TinyTapeout/tt-gds-action/gl_test@tt10

viewer:
needs: gds
runs-on: ubuntu-24.04
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- uses: TinyTapeout/tt-gds-action/viewer@tt10
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: test
on: [push, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install iverilog
shell: bash
run: sudo apt-get update && sudo apt-get install -y iverilog

# Set Python up and install cocotb
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install Python packages
shell: bash
run: pip install -r test/requirements.txt

- name: Run tests
run: |
cd test
make clean
make
# make will return success even if the test fails, so check for failure in the results.xml
! grep failure results.xml
- name: Test Summary
uses: test-summary/[email protected]
with:
paths: "test/results.xml"
if: always()

- name: upload vcd
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: test-vcd
path: |
test/tb.vcd
test/results.xml
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
.idea
*.vcd
runs
tt_submission
src/user_config.json
src/config_merged.json
test/sim_build
test/__pycache__/
test/results.xml
test/gate_level_netlist.v
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"mshr-h.veriloghdl",
"surfer-project.surfer"
]
}
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"verilog.linting.linter": "verilator",
"verilog.formatting.verilogHDL.formatter": "verible-verilog-format"
}
Loading

0 comments on commit 2d22959

Please sign in to comment.