Skip to content
Open
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e8658c9
Integrate UART peripheral with the core
RunzeZhu28 Jan 13, 2026
c7a6fd8
Delete quartus workspace/inst_mem.v
RunzeZhu28 Jan 13, 2026
0a72099
Delete quartus workspace/ram_m10k.v
RunzeZhu28 Jan 13, 2026
4dea453
Merge branch 'uart_peripheral'
RunzeZhu28 Jan 23, 2026
e5262b0
Update ControlFSM.sv
RunzeZhu28 Jan 24, 2026
b348567
Lint changes
RunzeZhu28 Jan 24, 2026
aae5bf5
Lint update
RunzeZhu28 Jan 24, 2026
f998b48
lint update
RunzeZhu28 Jan 24, 2026
6822df9
spacing
RunzeZhu28 Jan 24, 2026
afb4550
lint fixing
RunzeZhu28 Jan 24, 2026
00d5a9f
lint fixing
RunzeZhu28 Jan 24, 2026
809281a
lint fixing
RunzeZhu28 Jan 24, 2026
4ddbd36
lint fixing
RunzeZhu28 Jan 24, 2026
61a8686
lint fixing
RunzeZhu28 Jan 24, 2026
8bf5ee8
lint fixing
RunzeZhu28 Jan 24, 2026
42ef5e0
lint fixing
RunzeZhu28 Jan 24, 2026
f7a1205
lint fixing
RunzeZhu28 Jan 24, 2026
d98e1d5
lint fixing
RunzeZhu28 Jan 24, 2026
2e0da8f
lint fixing
RunzeZhu28 Jan 24, 2026
ea3666f
lint fixing
RunzeZhu28 Jan 24, 2026
b83dffd
lint fixing
RunzeZhu28 Jan 24, 2026
c7a5955
lint fixing
RunzeZhu28 Jan 24, 2026
5a55d1c
fix de1-soc build
TheDeepestSpace Feb 26, 2026
06b1062
Merge branch 'main' into uart_peripheral
TheDeepestSpace Feb 26, 2026
880e9e2
add pin assignments for uart
TheDeepestSpace Feb 28, 2026
9ef3c2b
fix de1-soc base tb
TheDeepestSpace Feb 28, 2026
663dae6
remote nested quartus workspace
TheDeepestSpace Mar 9, 2026
e542d2a
gitignore .idea/ preferences
TheDeepestSpace Mar 9, 2026
95dbc6e
remove autogenerated mem files
TheDeepestSpace Mar 9, 2026
6b4a268
undo ^M drops to cdf
TheDeepestSpace Mar 9, 2026
cab2453
undo ^M drops to qpf and qsf
TheDeepestSpace Mar 9, 2026
69bd415
delete bak files
TheDeepestSpace Mar 9, 2026
3bbd5d7
Moved rx_ready assignment so that it is after the declaration of the …
marwannismail Mar 14, 2026
a288b76
fix svlint infractions
TheDeepestSpace May 6, 2026
771f850
Merge branch 'main' into uart_peripheral
TheDeepestSpace May 6, 2026
bf93c6c
Created first implementation of uart cli interface. Not properly test…
Parzival129 Mar 29, 2026
73cd361
cocotb modular test of uart, with instructions
Parzival129 May 20, 2026
201b898
Fixed warning issues with uart instantiation
Parzival129 May 20, 2026
f9219b8
some fixes for the cocotb uart tb
TheDeepestSpace May 23, 2026
e335e9d
ignore pycache for coctb uart tb
TheDeepestSpace May 23, 2026
bcea09e
ignore some more files
TheDeepestSpace May 23, 2026
2162585
address blocked/no-blocked assignment mixing
TheDeepestSpace May 23, 2026
59c5ba4
move uart_top into cocotb tb folder
TheDeepestSpace May 23, 2026
8cb9a25
fix dupe connection in the bus
TheDeepestSpace May 23, 2026
2bb0088
Merge remote-tracking branch 'origin/multicycle' into uart_peripheral
TheDeepestSpace May 23, 2026
63effa4
dont forget to add cocotb deps to ci image
TheDeepestSpace May 23, 2026
e3c3347
trying to optimize for area
TheDeepestSpace May 23, 2026
bb53774
temporarily remove dbg_regs
TheDeepestSpace May 26, 2026
d39a1ef
bring back dbg_regs
TheDeepestSpace May 30, 2026
2c5fb8f
add another state
TheDeepestSpace May 30, 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 @@ -71,10 +71,10 @@ USER dev
COPY --from=quartus /opt/quartus /opt/quartus
ENV PATH="/opt/quartus/quartus/bin:${PATH}"

# install cocotb
# install cocotb and some other deps (for uart testing)
USER dev
RUN sudo apt update && sudo apt install -y python3 python3-pip libpython3-dev && \
pip3 install cocotb~=1.9
pip3 install cocotb~=1.9 cocotbext-uart pyserial

# install svlint
USER dev
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.idea/*

*.vvp
*.vcd

Expand Down Expand Up @@ -26,6 +28,10 @@ envs/de1-soc/quartus/*.qws
envs/de1-soc/quartus/metrics/*
!envs/de1-soc/quartus/metrics/.gitkeep

cocotb_uart/__pycache__/
cocotb_uart/sim_build/
cocotb_uart/results.xml

out/**
!out/.gitkeep
build/**
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Mihir Maringanti

Marwan Ismail (marwannismail)

Tony Zhu (RunzeZhu28)
Tony Zhu (RunzeZhu28)
5 changes: 5 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,10 @@ RUN mkdir -p /tmp/svlint && \
sudo mv bin/* /usr/local/bin/ && \
cd .. && rm -r /tmp/svlint

# install cocotb and some other deps (for uart testing)
USER dev
RUN sudo apt update && sudo apt install -y python3 python3-pip libpython3-dev && \
pip3 install cocotb~=1.9 cocotbext-uart pyserial

# CI needs priviledged access
USER root
130 changes: 65 additions & 65 deletions Dockerfile.riscv-toolchain
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
FROM public.ecr.aws/lts/ubuntu:22.04_stable AS builder
ARG DEBIAN_FRONTEND=noninteractive
ARG KEYRING_PATH=/usr/share/keyrings
ARG APT_SOURCES_PATH=/etc/apt/sources.list.d
# update and upgrade
RUN apt update && apt upgrade -y
# install essentialls
RUN apt update && \
apt install -y \
man make build-essential git zsh vim curl wget procps gnupg gnupg2 ca-certificates zip \
software-properties-common
# unminimize the system
RUN bash -c "yes | unminimize"
# create dev sudo user
RUN useradd --create-home dev && \
usermod --append --groups sudo dev && \
apt update && apt install -y sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# build riscv toolchain
RUN sudo apt-get install -y \
autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk \
build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev && \
cd /tmp && \
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git && \
git clone --recursive https://github.com/riscv/riscv-opcodes.git && \
cd riscv-gnu-toolchain && \
./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32 && \
sudo make
# main image stage
FROM public.ecr.aws/lts/ubuntu:22.04_stable
ARG DEBIAN_FRONTEND=noninteractive
ARG KEYRING_PATH=/usr/share/keyrings
ARG APT_SOURCES_PATH=/etc/apt/sources.list.d
# update and upgrade
RUN apt update && apt upgrade -y
# install essentialls
RUN apt update && \
apt install -y \
man make build-essential git zsh vim curl wget procps gnupg gnupg2 ca-certificates zip \
software-properties-common
# unminimize the system
RUN bash -c "yes | unminimize"
# create dev sudo user
RUN useradd --create-home dev && \
usermod --append --groups sudo dev && \
apt update && apt install -y sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# get toolchain artifacts from builder stage
COPY --from=builder /opt/riscv /opt/riscv
ENV PATH="/opt/riscv/bin:${PATH}"
USER dev
FROM public.ecr.aws/lts/ubuntu:22.04_stable AS builder

ARG DEBIAN_FRONTEND=noninteractive
ARG KEYRING_PATH=/usr/share/keyrings
ARG APT_SOURCES_PATH=/etc/apt/sources.list.d

# update and upgrade
RUN apt update && apt upgrade -y

# install essentialls
RUN apt update && \
apt install -y \
man make build-essential git zsh vim curl wget procps gnupg gnupg2 ca-certificates zip \
software-properties-common

# unminimize the system
RUN bash -c "yes | unminimize"

# create dev sudo user
RUN useradd --create-home dev && \
usermod --append --groups sudo dev && \
apt update && apt install -y sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# build riscv toolchain
RUN sudo apt-get install -y \
autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk \
build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev && \
cd /tmp && \
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain.git && \
git clone --recursive https://github.com/riscv/riscv-opcodes.git && \
cd riscv-gnu-toolchain && \
./configure --prefix=/opt/riscv --with-arch=rv32i --with-abi=ilp32 && \
sudo make

# main image stage
FROM public.ecr.aws/lts/ubuntu:22.04_stable

ARG DEBIAN_FRONTEND=noninteractive
ARG KEYRING_PATH=/usr/share/keyrings
ARG APT_SOURCES_PATH=/etc/apt/sources.list.d

# update and upgrade
RUN apt update && apt upgrade -y

# install essentialls
RUN apt update && \
apt install -y \
man make build-essential git zsh vim curl wget procps gnupg gnupg2 ca-certificates zip \
software-properties-common

# unminimize the system
RUN bash -c "yes | unminimize"

# create dev sudo user
RUN useradd --create-home dev && \
usermod --append --groups sudo dev && \
apt update && apt install -y sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# get toolchain artifacts from builder stage
COPY --from=builder /opt/riscv /opt/riscv
ENV PATH="/opt/riscv/bin:${PATH}"

USER dev
12 changes: 12 additions & 0 deletions cocotb_uart/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SIM = icarus
TOPLEVEL_LANG = verilog
VERILOG_SOURCES = \
$(PWD)/../src/uart_rx.sv \
$(PWD)/../src/uart_tx.sv \
$(PWD)/../src/uart.sv \
$(PWD)/../src/uart_bus_master.sv \
$(PWD)/uart_top.sv
TOPLEVEL = uart_top
MODULE = test_uart_master

include $(shell cocotb-config --makefiles)/Makefile.sim
26 changes: 26 additions & 0 deletions cocotb_uart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How to test uart

## Requirements:

Python 3.9+
cocotb — pip install cocotb
cocotbext-uart — pip install cocotbext-uart
Icarus Verilog — brew install icarus-verilog on Mac

In the cocotb_uart/ folder:

## to run all tests:

make SIM=icarus

## to run a single test:

make SIM=icarus COCOTB_TEST_FILTER=test_halt

## What each test does:

test_halt — sends HALT, verifies the DUT asserts hold_core
test_wr32 — sends HALT then writes a word, verifies correct address and data appear on the bus
test_load_and_run — full CLI flow: halt, load 20 program words, run. Mirrors cli option 1 in uart_cli.py. Takes ~30 seconds due to real baud-rate timing.
test_rdreg — reads back a register value through the debug interface
test_bad_checksum — verifies the DUT rejects a corrupted packet with STATUS_CHK
Loading
Loading