Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
07b55f4
Integrating UART into RISC-V core
marwannismail May 10, 2026
4cea2fe
UART Cocotb testbench intial work
marwannismail May 10, 2026
680b6eb
Removed all simulation commands from UART makefile
marwannismail May 10, 2026
533442e
Standalone UART test bench using Cocotb
marwannismail May 10, 2026
9bac90d
bump librelane
TheDeepestSpace May 26, 2026
cecca5a
bump upstream
TheDeepestSpace May 26, 2026
a24b6dc
agressively fix antenna violations
TheDeepestSpace May 26, 2026
4f3bf09
skip dbg_* signals for uart for now
TheDeepestSpace May 26, 2026
1fc09c0
bump upstream again
TheDeepestSpace May 26, 2026
d6340de
ci dbg
TheDeepestSpace May 26, 2026
1b55ab6
ci hack
TheDeepestSpace May 26, 2026
7d4c8d3
temporarily stop running tests
TheDeepestSpace May 26, 2026
043a59e
bump upstream again
TheDeepestSpace May 26, 2026
4cd1554
temporarily skip gltest
TheDeepestSpace May 26, 2026
e15516c
use verilator for cocotb test and bring latest version from oss cad s…
TheDeepestSpace May 29, 2026
8ae80e4
bring back dbg_regs for now
TheDeepestSpace May 30, 2026
b69e833
bump upstream
TheDeepestSpace May 30, 2026
bac2c79
make tests work
TheDeepestSpace May 30, 2026
959cbf6
udpate tests a bit
TheDeepestSpace May 30, 2026
48bd0d1
bring back tests in ci
TheDeepestSpace May 30, 2026
17d9670
bump upstream
TheDeepestSpace May 30, 2026
36a4606
use oss cad suite docker image as base for test workflow + remove icarus
TheDeepestSpace May 31, 2026
eea9253
fix git missing from oss-cad-suite image
TheDeepestSpace May 31, 2026
a20109c
use devcontainer as the base imagefor test workflow
TheDeepestSpace May 31, 2026
d3cab35
fix dispatch for test workflow
TheDeepestSpace May 31, 2026
15f63bf
make gds workflow also use devcontainer
TheDeepestSpace May 31, 2026
8b294c2
bring back gl test
TheDeepestSpace May 31, 2026
36c45a6
stip trying to setup python explicitly in test workflow
TheDeepestSpace May 31, 2026
8c4de61
stop using container for gds action
TheDeepestSpace May 31, 2026
d067cb0
debug: reg file check
TheDeepestSpace May 31, 2026
cc66b45
attempting to fix missing regfile issue with sv2v
TheDeepestSpace May 31, 2026
d622073
not using dbg_reg now
RunzeZhu28 May 31, 2026
0c8a7aa
remove and gitignore venv folder
TheDeepestSpace Jun 3, 2026
14627ec
Fixed inverted reset which was failing past tests (not fault of uart …
Parzival129 Jun 4, 2026
efc1c72
update submodule
RunzeZhu28 Jun 5, 2026
dcb8fe3
Merge branch 'uart_new' into mi_uart_integration
TheDeepestSpace Jun 5, 2026
7bf7abb
Merge remote-tracking branch 'origin/uart_new' into mi_uart_integration
TheDeepestSpace Jun 5, 2026
5cca0ee
switch back to ssh based submodule
TheDeepestSpace Jun 5, 2026
c300508
Merge branch 'main' into mi_uart_integration
TheDeepestSpace Jun 5, 2026
3df07d1
fix gl tests
TheDeepestSpace Jun 7, 2026
412be9d
manual gltest action
TheDeepestSpace Jun 7, 2026
2df1a6b
fixing gl action
TheDeepestSpace Jun 7, 2026
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
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ RUN mkdir /tmp/sv2v && \
chmod +x sv2v-Linux/sv2v && sudo cp sv2v-Linux/sv2v /usr/local/bin && \
cd .. && rm -r /tmp/sv2v

# Install LibreLane
RUN pip3 install librelane==2.4.2
# Install LibreLane (pinned to latest known stable)
RUN pip3 install librelane==3.0.3
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ jobs:
- name: sv2v
run: make sv2v

- name: hack
run: touch src/utoss-risc-v/src/Instruction_Decode/RegisterFile.sv2v.v

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to figure out why this file does not seem to be created in ci after sv2v run


- name: Build docs
uses: TinyTapeout/tt-gds-action/docs@ttgf26a
6 changes: 3 additions & 3 deletions .github/workflows/gds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
uses: TinyTapeout/tt-gds-action@ttgf26a
with:
pdk: gf180mcuD
librelane-version: 2.4.2
librelane-version: 3.0.3

precheck:
needs: gds
Expand All @@ -83,8 +83,8 @@ jobs:
with:
submodules: recursive

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

viewer:
needs: gds
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ jobs:
- name: sv2v
run: make sv2v

- 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/action@v2.4
with:
paths: "test/results.xml"
if: always()

- name: upload waveform and test results
if: success() || failure()
uses: actions/upload-artifact@v7
with:
name: test-results
path: |
test/tb.fst
test/results.xml
test/output/*
# - 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/action@v2.4
# with:
# paths: "test/results.xml"
# if: always()

# - name: upload waveform and test results
# if: success() || failure()
# uses: actions/upload-artifact@v7
# with:
# name: test-results
# path: |
# test/tb.fst
# test/results.xml
# test/output/*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: revert

6 changes: 5 additions & 1 deletion info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ project:
- "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/Instruction_Decode/RegisterFile.sv2v.v"
- "utoss-risc-v/src/uart_bus_master.sv2v.v"
- "utoss-risc-v/src/uart_rx.sv2v.v"
- "utoss-risc-v/src/uart_tx.sv2v.v"
- "utoss-risc-v/src/uart.sv2v.v"
- "utoss-risc-v/src/utoss_riscv.sv2v.v"

# The pinout of your project. Leave unused pins blank. DO NOT delete or add any pins.
Expand Down
4 changes: 4 additions & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"VERILOG_INCLUDE_DIRS": ["src/utoss-risc-v"],
"VERILOG_DEFINES": ["UTOSS_RISCV_HARDENING"],

"//": "Attempt to fix attennas more agressively",
"GRT_ANTENNA_ITERS": 20,
"DIODE_PADDING": 20,

Comment on lines +40 to +43

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure we need these, i have not tried running hardening without this after the version bump

"//": "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
"//": "!!! DO NOT CHANGE ANYTHING BELOW THIS POINT !!!",
"//": "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
Expand Down
106 changes: 91 additions & 15 deletions src/tt_um_utoss_riscv.sv
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,110 @@ module tt_um_utoss_riscv (
);

// All output pins must be assigned. If not used, assign to 0.
assign uo_out = memory__address[7:0]; // Example: ou_out is the sum of ui_in and uio_in
// assign uo_out = memory__address[7:0]; // Example: ou_out is the sum of ui_in and uio_in
assign uo_out[3:0] = 4'b0000;
assign uo_out[7:5] = 3'b000;
assign uio_out = 0;
assign uio_oe = 0;

// List all unused inputs to prevent warnings
wire _unused = &{ena, ui_in, uio_in};
wire _unused = &{ena, 1'b0};

addr_t memory__address;
data_t memory__write_data;
logic [3:0] memory__write_enable;
data_t memory__read_data;
wire [7:0] uart_rx_data;
wire uart_rx_valid;
wire uart_rx_ready;

wire [7:0] uart_tx_data;
wire uart_tx_valid;
wire uart_tx_ready;

wire tx_busy, rx_busy, rx_overrun, rx_frame;

addr_t core_addr;
data_t core_write_data;
logic [3:0] core_write_enable;

logic [31:0] dbg_regs [0:31];
addr_t dbg_pc;

uart #(
.DATA_WIDTH(8)
, .CLK_HZ(50000000)
, .BAUD(115200)
)
u_uart (
.clk ( clk )
, .rst ( ~rst_n )
, .i_data_s ( uart_tx_data )
, .i_valid_s ( uart_tx_valid )
, .o_ready_s ( uart_tx_ready )
, .o_data_m ( uart_rx_data )
, .o_valid_m ( uart_rx_valid )
, .i_ready_m ( uart_rx_ready )
, .i_rxd ( ui_in[3] )
, .o_txd ( uo_out[4] )
, .o_tx_busy ( tx_busy )
, .o_rx_busy ( rx_busy )
, .o_rx_overrun_error ( rx_overrun )
, .o_rx_frame_error ( rx_frame )
);

logic [31:0] dbg_addr, dbg_write_data;
logic [3:0] dbg_write_enable;
wire [31:0] read_data;

logic hold_core;

// Temporary: pass zeros to dbg_regs to test if high fanout is the issue
logic [31:0] dbg_regs_zeros [0:31];
assign dbg_regs_zeros = '{default: 32'b0};

uart_bus_master u_master (
.clk ( clk )
, .rst ( ~rst_n )
, .rx_data ( uart_rx_data )
, .rx_valid ( uart_rx_valid )
, .rx_ready ( uart_rx_ready )
, .tx_data ( uart_tx_data )
, .tx_valid ( uart_tx_valid )
, .tx_ready ( uart_tx_ready )
, .bus_addr ( dbg_addr )
, .bus_write_data ( dbg_write_data )
, .bus_write_enable ( dbg_write_enable )
, .bus_read_data ( read_data )
// , .dbg_regs ( dbg_regs_zeros )

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this due to heavy fanout, need to bring back

, .dbg_pc ( 32'b0 )
, .hold_core ( hold_core )
);

wire core_reset = ~rst_n | hold_core;

addr_t bus_addr;
data_t bus_write_data;
logic [3:0] bus_write_enable;

assign bus_addr = hold_core ? dbg_addr : core_addr;
assign bus_write_data = hold_core ? dbg_write_data : core_write_data;
assign bus_write_enable = hold_core ? dbg_write_enable : core_write_enable;

MA #( .SIZE ( 16 ) )
memory
( .clk ( clk )
, .address ( memory__address )
, .write_data ( memory__write_data )
, .write_enable ( memory__write_enable )
, .read_data ( memory__read_data )
, .address ( bus_addr )
, .write_data ( bus_write_data )
, .write_enable ( bus_write_enable )
, .read_data ( read_data )
);

utoss_riscv core
( .clk ( clk )
, .reset ( ~rst_n )
, .memory__address ( memory__address )
, .memory__write_data ( memory__write_data )
, .memory__write_enable( memory__write_enable )
, .memory__read_data ( memory__read_data )
, .reset ( core_reset )
, .memory__address ( core_addr )
, .memory__write_data ( core_write_data )
, .memory__write_enable( core_write_enable )
, .memory__read_data ( read_data )
, .dbg_regs ( dbg_regs )
, .dbg_pc ( dbg_pc )
);

endmodule
14 changes: 10 additions & 4 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ SIM ?= icarus
FST ?= -fst # Use more efficient FST format
TOPLEVEL_LANG ?= verilog
SRC_DIR = $(PWD)/../src
PROJECT_SOURCES = tt_um_utoss_riscv.sv MA.sv utoss-risc-v/src/ALU_ALUdecoder/ALU.sv 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/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
PROJECT_SOURCES = tt_um_utoss_riscv.sv MA.sv utoss-risc-v/src/ALU_ALUdecoder/ALU.sv 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/Instruction_Decode/RegisterFile.sv utoss-risc-v/src/params.svh utoss-risc-v/src/types.svh utoss-risc-v/src/utils.svh utoss-risc-v/src/uart.sv utoss-risc-v/src/uart_tx.sv utoss-risc-v/src/uart_rx.sv utoss-risc-v/src/uart_bus_master.sv utoss-risc-v/src/utoss_riscv.sv
COMPILE_ARGS += -DUTOSS_RISCV_HARDENING

ifneq ($(GATES),yes)

# RTL simulation:
SIM_BUILD = sim_build/rtl
VERILOG_SOURCES += $(addprefix $(SRC_DIR)/,$(PROJECT_SOURCES))
ifeq ($(SIM),verilator)
COMPILE_ARGS += --timing -Wno-fatal -Wno-WIDTHTRUNC -Wno-WIDTHEXPAND
endif

else

Expand All @@ -35,9 +38,12 @@ endif
# Allow sharing configuration between design and testbench via `include`:
COMPILE_ARGS += -I$(SRC_DIR) -I$(SRC_DIR)/utoss-risc-v

# Include the testbench sources:
VERILOG_SOURCES += $(PWD)/tb.sv
TOPLEVEL = tb
# Allow overriding which testbench file is used via TOPLEVEL (command-line)
TOPLEVEL ?= tb

# Include the testbench sources (use TOPLEVEL variable so tb_uart.sv can be selected):
VERILOG_SOURCES += $(PWD)/$(TOPLEVEL).sv


# List test modules to run, separated by commas and without the .py suffix:
COCOTB_TEST_MODULES = test
Expand Down
Loading
Loading