Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,18 @@ RUN umask 022 && \
tar zxf - -C /usr/local --strip-components=1 && \
chmod 755 /usr/local/bin

# install sv2v
ARG SV2V_VERSION=0.0.13
ARG SV2V_ZIP_NAME=sv2v-Linux.zip
ARG SV2V_ZIP_URL=https://github.com/zachjs/sv2v/releases/download/v${SV2V_VERSION}/${SV2V_ZIP_NAME}
ARG SV2V_ZIP_HASH="552799a1d76cd177b9b4cc63a3e77823a3d2a6eb4ec006569288abeff28e1ff8 ${SV2V_ZIP_NAME}"
RUN mkdir /tmp/sv2v && \
cd /tmp/sv2v && \
wget ${SV2V_ZIP_URL} && \
echo ${SV2V_ZIP_HASH} | sha256sum -c && \
unzip ${SV2V_ZIP_NAME} && \
chmod +x sv2v-Linux/sv2v && sudo cp sv2v-Linux/sv2v /usr/local/bin && \
cd .. && rm -r /tmp/sv2v

# Install LibreLane
RUN /ttsetup/venv/bin/pip install librelane==2.4.2
21 changes: 21 additions & 0 deletions .github/actions/install-sv2v/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Install sv2v'
description: 'Install sv2v SystemVerilog to Verilog converter'
runs:
using: 'composite'
steps:
- name: Install sv2v
shell: bash
run: |
SV2V_VERSION=0.0.13
SV2V_ZIP_NAME=sv2v-Linux.zip
SV2V_ZIP_URL=https://github.com/zachjs/sv2v/releases/download/v${SV2V_VERSION}/${SV2V_ZIP_NAME}
SV2V_ZIP_HASH="552799a1d76cd177b9b4cc63a3e77823a3d2a6eb4ec006569288abeff28e1ff8 ${SV2V_ZIP_NAME}"

mkdir /tmp/sv2v
cd /tmp/sv2v
wget ${SV2V_ZIP_URL}
echo ${SV2V_ZIP_HASH} | sha256sum -c
unzip ${SV2V_ZIP_NAME}
chmod +x sv2v-Linux/sv2v
sudo cp sv2v-Linux/sv2v /usr/local/bin
rm -rf /tmp/sv2v
6 changes: 6 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ jobs:
with:
submodules: recursive

- name: Install sv2v
uses: ./.github/actions/install-sv2v

- name: sv2v
run: make sv2v

- name: Build docs
uses: TinyTapeout/tt-gds-action/docs@ttsky25b
16 changes: 11 additions & 5 deletions .github/workflows/gds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ jobs:
with:
script: |
const comment = `👋 Hello! Before merging this PR, you can use the \`run-gds\` label to start the GDS workflow.

⚠️ **Important:** The GDS workflow takes a long time (~1 hour) and consumes significant CI runtime quota.

**Before running the GDS workflow:**
1. Make sure you've run the hardening command locally first:
\`\`\`bash
./tt/tt_tool.py --harden
\`\`\`
2. Verify that the hardening command succeeded without errors

**To run the GDS workflow:**
- Add the \`run-gds\` label to this PR
- The workflow will run automatically
- It will also re-run on subsequent pushes while the label remains attached

📚 For more information about the hardening command, see the [TinyTapeout GDS Action](https://github.com/TinyTapeout/tt-gds-action/blob/0d3300e15eda42ae3a24a2bd36433bdd20b32a9f/action.yml#L101-L103).`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
Expand All @@ -55,6 +55,12 @@ jobs:
with:
submodules: recursive

- name: Install sv2v
uses: ./.github/actions/install-sv2v

- name: sv2v
run: make sv2v

- name: Build GDS
uses: TinyTapeout/tt-gds-action@ttsky25b
with:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
shell: bash
run: pip install -r test/requirements.txt

- name: Install sv2v
uses: ./.github/actions/install-sv2v

- name: sv2v
run: make sv2v

- name: Run tests
run: |
cd test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
.idea
*.sv2v.v
*.vcd
*.fst
*.fst.hier
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Convert SystemVerilog (.sv) files to Verilog (.v) using sv2v

SV_FILES := $(shell find src/ -follow -name "*.sv" -type f 2>/dev/null | grep -v '/src/src')
INCLUDE_FLAGS := -I src/utoss-risc-v/
DEFINE_FLAGS := -DUTOSS_RISCV_HARDENING
V_FILES := $(SV_FILES:.sv=.sv2v.v)

.PHONY: sv2v clean help

sv2v:
@mkdir -p .sv2v_temp
@sv2v $(INCLUDE_FLAGS) $(DEFINE_FLAGS) $(SV_FILES) -w .sv2v_temp
@for svfile in $(SV_FILES); do \
module_name=$$(basename "$$svfile" .sv); \
if [ -f ".sv2v_temp/$$module_name.v" ]; then \
mv ".sv2v_temp/$$module_name.v" "$$(dirname "$$svfile")/$$module_name.sv2v.v"; \
fi; \
done
@rm -rf .sv2v_temp

clean:
@rm -f $(V_FILES)
19 changes: 8 additions & 11 deletions info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,16 @@ project:
# Source files must be in ./src and you must list each source file separately, one per line.
# Don't forget to also update `PROJECT_SOURCES` in test/Makefile.
source_files:
- "tt_um_utoss_riscv.sv"
- "MA.sv"
- "tt_um_utoss_riscv.sv2v.v"
- "MA.sv2v.v"
- "utoss-risc-v/src/ALU_ALUdecoder/ALU.v"
- "utoss-risc-v/src/ALU_ALUdecoder/ALUdecoder.sv"
- "utoss-risc-v/src/ControlFSM.sv"
- "utoss-risc-v/src/fetch.sv"
- "utoss-risc-v/src/Instruction_Decode/Instruction_Decode.sv"
- "utoss-risc-v/src/Instruction_Decode/MemoryLoader.sv"
- "utoss-risc-v/src/ALU_ALUdecoder/ALUdecoder.sv2v.v"
- "utoss-risc-v/src/ControlFSM.sv2v.v"
- "utoss-risc-v/src/fetch.sv2v.v"
- "utoss-risc-v/src/Instruction_Decode/Instruction_Decode.sv2v.v"
- "utoss-risc-v/src/Instruction_Decode/MemoryLoader.sv2v.v"
- "utoss-risc-v/src/Instruction_Decode/RegisterFile.v"
- "utoss-risc-v/src/params.svh"
- "utoss-risc-v/src/types.svh"
- "utoss-risc-v/src/utils.svh"
- "utoss-risc-v/src/utoss_riscv.sv"
- "utoss-risc-v/src/utoss_riscv.sv2v.v"

# The pinout of your project. Leave unused pins blank. DO NOT delete or add any pins.
# This section is for the datasheet/website. Use descriptive names (e.g., RX, TX, MOSI, SCL, SEG_A, etc.).
Expand Down
Loading