Skip to content

Commit

Permalink
iHP0p2: updated files for iHP process
Browse files Browse the repository at this point in the history
  • Loading branch information
rejunity committed Nov 2, 2024
1 parent 2fe68df commit fa106e5
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 126 deletions.
93 changes: 75 additions & 18 deletions .github/workflows/gds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,85 @@ jobs:
submodules: recursive

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

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

gl_test:
needs: gds
runs-on: ubuntu-24.04
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
needs: gds
runs-on: ubuntu-24.04
env:
PDK_ROOT: ${{ github.workspace }}/IHP-Open-PDK
TEST_DIR: ${{ github.workspace }}/test
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive

- name: Download GDS artifact
uses: actions/download-artifact@v4
with:
name: tt_submission

- name: install PDK
uses: actions/checkout@v4
with:
repository: tinytapeout/IHP-Open-PDK
ref: tt
path: IHP-Open-PDK

- 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: ccache
uses: hendrikmuhs/[email protected]

- name: Install iverilog
shell: bash
run: |
wget https://github.com/htfab/iverilog/releases/download/13.0-git-d8c3c51/iverilog_13.0-git-d8c3c51a-1_amd64.deb
sudo apt-get update -y
sudo apt-get install -y ./iverilog_13.0-git-d8c3c51a-1_amd64.deb
- name: Run tests
shell: bash
run: |
cp tt_submission/*.v "$TEST_DIR/gate_level_netlist.v"
cd "$TEST_DIR"
rm -f tb.vcd results.xml
make clean
GATES=yes make
# `make` will return success even if the tests fail, so check for failure in results.xml
test -f results.xml
! grep failure results.xml

- name: Upload VCD
if: always()
uses: actions/upload-artifact@v4
with:
name: gatelevel_test_vcd
path: |
${{ env.TEST_DIR }}/tb.vcd
${{ env.TEST_DIR }}/results.xml
- name: GL test
uses: TinyTapeout/tt-gds-action/gl_test@tt09
- name: Test Summary
if: always()
uses: test-summary/[email protected]
with:
paths: ${{ env.TEST_DIR }}/results.xml

viewer:
needs: gds
Expand Down
2 changes: 1 addition & 1 deletion info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project:
clock_hz: 4000000 # Clock frequency in Hz

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

# Your top module name must start with "tt_um_". Make it unique by including your github username:
top_module: "tt_um_rejunity_sn76489"
Expand Down
73 changes: 12 additions & 61 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,74 +11,25 @@

"//": "Here are some of the variables you may want to change:",

"//": "PL_TARGET_DENSITY_PCT - You can increase this if Global Placement fails with error GPL-0302.",
"//": "Users have reported that values up to 80 worked well for them.",
"PL_TARGET_DENSITY_PCT": 80,
"PLACE_DENSITY": 0.8,
"TNS_END_PERCENT": 100,

"//": "CLOCK_PERIOD - Increase this in case you are getting setup time violations.",
"//": "The value is in nanoseconds, so 20ns == 50MHz.",
"CLOCK_PERIOD": 20,
"//": "Change the clock period here. 20000 ps = 20 ns corresponds to 50 MHz",
"ABC_CLOCK_PERIOD_IN_PS": 20000,

"//": "Hold slack margin - Increase them in case you are getting hold violations.",
"PL_RESIZER_HOLD_SLACK_MARGIN": 0.1,
"GRT_RESIZER_HOLD_SLACK_MARGIN": 0.05,
"//": "Increase this if you are getting 'Synthesized memory size exceeds maximum allowed bits' error:",
"SYNTH_MEMORY_MAX_BITS": 4096,

"//": "RUN_LINTER, LINTER_INCLUDE_PDK_MODELS - Disabling the linter is not recommended!",
"RUN_LINTER": 1,
"LINTER_INCLUDE_PDK_MODELS": 1,
"//": "Setting to 1 may help decrease design area utilization / speed up routing:",
"ABC_AREA": 0,

"//": "If you need a custom clock configuration, read the following documentation first:",
"//": "https://tinytapeout.com/faq/#how-can-i-map-an-additional-external-clock-to-one-of-the-gpios",
"CLOCK_PORT": "clk",

"//": "Configuration docs: https://openlane.readthedocs.io/en/latest/reference/configuration.html",
"//": "Configuration docs: https://openroad-flow-scripts.readthedocs.io/en/latest/user/FlowVariables.html",

"//": "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
"//": "!!! DO NOT CHANGE ANYTHING BELOW THIS POINT !!!",
"//": "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",

"//": "Save some time",
"RUN_KLAYOUT_XOR": 0,
"RUN_KLAYOUT_DRC": 0,

"//": "Don't put clock buffers on the outputs",
"DESIGN_REPAIR_BUFFER_OUTPUT_PORTS": 0,

"//": "Reduce wasted space",
"TOP_MARGIN_MULT": 1,
"BOTTOM_MARGIN_MULT": 1,
"LEFT_MARGIN_MULT": 6,
"RIGHT_MARGIN_MULT": 6,

"//": "Absolute die size",
"FP_SIZING": "absolute",

"GRT_ALLOW_CONGESTION": 1,

"FP_IO_HLENGTH": 2,
"FP_IO_VLENGTH": 2,

"FP_PDN_VPITCH": 38.87,

"//": "Use alternative efabless decap cells to solve LI density issue",
"DECAP_CELL": [
"sky130_fd_sc_hd__decap_3",
"sky130_fd_sc_hd__decap_4",
"sky130_fd_sc_hd__decap_6",
"sky130_fd_sc_hd__decap_8",
"sky130_ef_sc_hd__decap_12"
],

"//": "Clock",
"RUN_CTS": 1,

"//": "Don't use power rings or met5 layer",
"FP_PDN_MULTILAYER": 0,
"RT_MAX_LAYER": "met4",

"//": "MAGIC_DEF_LABELS may cause issues with LVS",
"MAGIC_DEF_LABELS": 0,

"//": "Only export pin area in LEF (without any connected nets)",
"MAGIC_WRITE_LEF_PINONLY": 1
"//": "Power nets for IR drop analysis",
"PWR_NETS_VOLTAGES": "{VPWR 1.2}",
"GND_NETS_VOLTAGES": "{VGND 0.0}"
}
6 changes: 2 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ else
SIM_BUILD = sim_build/gl
COMPILE_ARGS += -DGL_TEST
COMPILE_ARGS += -DFUNCTIONAL
COMPILE_ARGS += -DUSE_POWER_PINS
COMPILE_ARGS += -DSIM
COMPILE_ARGS += -DUNIT_DELAY=\#1
VERILOG_SOURCES += $(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/verilog/primitives.v
VERILOG_SOURCES += $(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v
VERILOG_SOURCES += $(PDK_ROOT)/ihp-sg13g2/libs.ref/sg13g2_io/verilog/sg13g2_io.v
VERILOG_SOURCES += $(PDK_ROOT)/ihp-sg13g2/libs.ref/sg13g2_stdcell/verilog/sg13g2_stdcell.v

# this gets copied in by the GDS action workflow
VERILOG_SOURCES += $(PWD)/gate_level_netlist.v
Expand Down
70 changes: 28 additions & 42 deletions test/tb.v
Original file line number Diff line number Diff line change
@@ -1,51 +1,37 @@
`default_nettype none
`timescale 1ns/1ps
`timescale 1ns / 1ps

/*
this testbench just instantiates the module and makes some convenient wires
that can be driven / tested by the cocotb test.py
/* This testbench just instantiates the module and makes some convenient wires
that can be driven / tested by the cocotb test.py.
*/

// testbench is controlled by test.py
module tb ();

// this part dumps the trace to a vcd file that can be viewed with GTKWave
initial begin
$dumpfile ("tb.vcd");
$dumpvars (0, tb);
#1;
end

// wire up the inputs and outputs
wire [7:0] ui_in;
wire [7:0] uo_out;
wire [7:0] uio_in;
wire [7:0] uio_out;
wire [7:0] uio_oe;
wire clk;
wire rst_n;
wire ena;
`ifdef GL_TEST
wire VPWR = 1'b1;
wire VGND = 1'b0;
`endif
// Dump the signals to a VCD file. You can view it with gtkwave.
initial begin
$dumpfile("tb.vcd");
$dumpvars(0, tb);
#1;
end

// Wire up the inputs and outputs:
reg clk;
reg rst_n;
reg ena;
reg [7:0] ui_in;
reg [7:0] uio_in;
wire [7:0] uo_out;
wire [7:0] uio_out;
wire [7:0] uio_oe;

tt_um_rejunity_sn76489 tt_um_rejunity_sn76489_uut
(
// include power ports for the Gate Level test
`ifdef GL_TEST
.VPWR(VPWR),
.VGND(VGND),
`endif
.ui_in (ui_in), // Dedicated inputs
.uo_out (uo_out), // Dedicated outputs
.uio_in (uio_in), // IOs: Input path
.uio_out (uio_out), // IOs: Output path
.uio_oe (uio_oe), // IOs: Enable path (active high: 0=input, 1=output)
.ena (ena), // enable - goes high when design is selected
.clk (clk), // clock
.rst_n (rst_n) // not reset
);
tt_um_rejunity_sn76489 tt_um_rejunity_sn76489_uut (
.ui_in (ui_in), // Dedicated inputs
.uo_out (uo_out), // Dedicated outputs
.uio_in (uio_in), // IOs: Input path
.uio_out(uio_out), // IOs: Output path
.uio_oe (uio_oe), // IOs: Enable path (active high: 0=input, 1=output)
.ena (ena), // enable - goes high when design is selected
.clk (clk), // clock
.rst_n (rst_n) // not reset
);

endmodule

0 comments on commit fa106e5

Please sign in to comment.