Skip to content

Commit cf88638

Browse files
htfaburish
authored andcommitted
feat: adapt for wokwi projects
1 parent 6d8e013 commit cf88638

File tree

10 files changed

+142
-228
lines changed

10 files changed

+142
-228
lines changed

.github/workflows/gds.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@ jobs:
2929
pdk: sky130
3030
tools-ref: ttsky25a
3131

32-
gl_test:
33-
needs: gds
34-
runs-on: ubuntu-24.04
35-
steps:
36-
- name: checkout repo
37-
uses: actions/checkout@v4
38-
with:
39-
submodules: recursive
40-
41-
- name: GL test
42-
uses: TinyTapeout/tt-gds-action/gl_test@ttsky25a
43-
with:
44-
pdk: sky130
45-
4632
viewer:
4733
needs: gds
4834
runs-on: ubuntu-24.04

.github/workflows/test.yaml renamed to .github/workflows/wokwi_test.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
name: test
1+
name: wokwi_test
22
on: [push, workflow_dispatch]
33
jobs:
4-
test:
4+
wokwi_test:
55
runs-on: ubuntu-24.04
66
steps:
77
- name: Checkout repo
88
uses: actions/checkout@v4
99
with:
1010
submodules: recursive
1111

12+
- name: Checkout tt-support-tools repo
13+
uses: actions/checkout@v4
14+
with:
15+
repository: TinyTapeout/tt-support-tools
16+
path: tt
17+
ref: tt10
18+
1219
- name: Install iverilog
1320
shell: bash
1421
run: sudo apt-get update && sudo apt-get install -y iverilog
@@ -21,9 +28,21 @@ jobs:
2128

2229
- name: Install Python packages
2330
shell: bash
24-
run: pip install -r test/requirements.txt
31+
run: |
32+
pip install -r test/requirements.txt
33+
pip install -r tt/requirements.txt
34+
35+
- name: Fetch the truth table
36+
run: ./tt/tt_tool.py --create-user-config
37+
38+
- name: Check for truth table existence
39+
id: check_files
40+
uses: andstor/file-existence-action@v3
41+
with:
42+
files: "test/truthtable.md"
2543

2644
- name: Run tests
45+
if: steps.check_files.outputs.files_exists == 'true'
2746
run: |
2847
cd test
2948
make clean
@@ -43,5 +62,5 @@ jobs:
4362
with:
4463
name: test-vcd
4564
path: |
46-
test/tb.vcd
65+
test/*.vcd
4766
test/results.xml

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
![](../../workflows/gds/badge.svg) ![](../../workflows/docs/badge.svg) ![](../../workflows/test/badge.svg) ![](../../workflows/fpga/badge.svg)
1+
![](../../workflows/gds/badge.svg) ![](../../workflows/docs/badge.svg) ![](../../workflows/wokwi_test/badge.svg) ![](../../workflows/fpga/badge.svg)
22

3-
# Tiny Tapeout Verilog Project Template
3+
# Tiny Tapeout Wokwi Project Template
44

55
- [Read the documentation for project](docs/info.md)
66

@@ -10,14 +10,11 @@ Tiny Tapeout is an educational project that aims to make it easier and cheaper t
1010

1111
To learn more and get started, visit https://tinytapeout.com.
1212

13-
## Set up your Verilog project
13+
## Wokwi Projects
1414

15-
1. Add your Verilog files to the `src` folder.
16-
2. Edit the [info.yaml](info.yaml) and update information about your project, paying special attention to the `source_files` and `top_module` properties. If you are upgrading an existing Tiny Tapeout project, check out our [online info.yaml migration tool](https://tinytapeout.github.io/tt-yaml-upgrade-tool/).
17-
3. Edit [docs/info.md](docs/info.md) and add a description of your project.
18-
4. Adapt the testbench to your design. See [test/README.md](test/README.md) for more information.
15+
Edit the [info.yaml](info.yaml) and change the `wokwi_id` to the ID of your Wokwi project. You can find the ID in the URL of your project, it's the big number after `wokwi.com/projects/`.
1916

20-
The GitHub action will automatically build the ASIC files using [OpenLane](https://www.zerotoasiccourse.com/terminology/openlane/).
17+
The GitHub action will automatically fetch the digital netlist from Wokwi and build the ASIC files.
2118

2219
## Enable GitHub actions to build the results page
2320

info.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
1-
# Tiny Tapeout project information
1+
# Tiny Tapeout project information (Wokwi project)
22
project:
3+
wokwi_id: 0 # Set this to the ID of your Wokwi project (the number from the project's URL)
34
title: "" # Project title
45
author: "" # Your name
56
discord: "" # Your discord username, for communication and automatically assigning you a Tapeout role (optional)
67
description: "" # One line description of what your project does
7-
language: "Verilog" # other examples include SystemVerilog, Amaranth, VHDL, etc
8+
language: "Wokwi" # other examples include SystemVerilog, Amaranth, VHDL, etc
89
clock_hz: 0 # Clock frequency in Hz (or 0 if not applicable)
910

1011
# How many tiles your design occupies? A single tile is about 167x108 uM.
1112
tiles: "1x1" # Valid values: 1x1, 1x2, 2x2, 3x2, 4x2, 6x2 or 8x2
1213

13-
# Your top module name must start with "tt_um_". Make it unique by including your github username:
14-
top_module: "tt_um_example"
15-
16-
# List your project's source files here.
17-
# Source files must be in ./src and you must list each source file separately, one per line.
18-
# Don't forget to also update `PROJECT_SOURCES` in test/Makefile.
19-
source_files:
20-
- "project.v"
2114

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

src/cells.v

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
This file provides the mapping from the Wokwi modules to Verilog HDL.
3+
4+
It's only needed for Wokwi designs.
5+
*/
6+
7+
`define default_netname none
8+
9+
(* keep_hierarchy *)
10+
module buffer_cell (
11+
input wire in,
12+
output wire out
13+
);
14+
assign out = in;
15+
endmodule
16+
17+
(* keep_hierarchy *)
18+
module and_cell (
19+
input wire a,
20+
input wire b,
21+
output wire out
22+
);
23+
24+
assign out = a & b;
25+
endmodule
26+
27+
(* keep_hierarchy *)
28+
module or_cell (
29+
input wire a,
30+
input wire b,
31+
output wire out
32+
);
33+
34+
assign out = a | b;
35+
endmodule
36+
37+
(* keep_hierarchy *)
38+
module xor_cell (
39+
input wire a,
40+
input wire b,
41+
output wire out
42+
);
43+
44+
assign out = a ^ b;
45+
endmodule
46+
47+
(* keep_hierarchy *)
48+
module nand_cell (
49+
input wire a,
50+
input wire b,
51+
output wire out
52+
);
53+
54+
assign out = !(a&b);
55+
endmodule
56+
57+
(* keep_hierarchy *)
58+
module not_cell (
59+
input wire in,
60+
output wire out
61+
);
62+
63+
assign out = !in;
64+
endmodule
65+
66+
(* keep_hierarchy *)
67+
module mux_cell (
68+
input wire a,
69+
input wire b,
70+
input wire sel,
71+
output wire out
72+
);
73+
74+
assign out = sel ? b : a;
75+
endmodule
76+
77+
(* keep_hierarchy *)
78+
module dff_cell (
79+
input wire clk,
80+
input wire d,
81+
output reg q,
82+
output wire notq
83+
);
84+
85+
assign notq = !q;
86+
always @(posedge clk)
87+
q <= d;
88+
89+
endmodule
90+
91+
(* keep_hierarchy *)
92+
module dffsr_cell (
93+
input wire clk,
94+
input wire d,
95+
input wire s,
96+
input wire r,
97+
output reg q,
98+
output wire notq
99+
);
100+
101+
assign notq = !q;
102+
103+
always @(posedge clk or posedge s or posedge r) begin
104+
if (r)
105+
q <= 0;
106+
else if (s)
107+
q <= 1;
108+
else
109+
q <= d;
110+
end
111+
endmodule

src/project.v

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/README.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

test/tb.gtkw

Lines changed: 0 additions & 39 deletions
This file was deleted.

test/tb.v

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)