Skip to content

Commit d62b59c

Browse files
committed
Update docs and set up sim flow
1 parent eb977b6 commit d62b59c

File tree

10 files changed

+162
-3
lines changed

10 files changed

+162
-3
lines changed
File renamed without changes.

docs/src/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ fpgas
2121
testing
2222
log
2323
tools
24-
resources
2524
```

docs/src/log.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
### Memory Access Instructions
3030

31-
- [ ] LB: Load Byte (Signed)
31+
- [x] LB: Load Byte (Signed)
3232
- [ ] LH: Load Halfword (Signed)
3333
- [ ] LW: Load Word
3434
- [ ] LBU: Load Byte Unsigned

docs/src/resources.md

-1
This file was deleted.

sim/.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12.7

sim/pyproject.toml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[project]
2+
name = "sim"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.12.7"
7+
dependencies = [
8+
"cocotb>=1.9.2",
9+
"pytest>=8.3.4",
10+
]

sim/tb/uart/test_smoke.py

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Smoke test for UART module
2+
3+
import cocotb
4+
from cocotb.clock import Clock
5+
from cocotb.triggers import FallingEdge, Timer, ClockCycles
6+
7+
8+
@cocotb.test()
9+
async def smoke_test(dut):
10+
cocotb.start_soon(Clock(dut.clk, 1, units="ns").start())
11+
dut.rst.value = 0
12+
await ClockCycles(dut.clk, 2)
13+
dut.rst.value = 1
14+
await Timer(1, units="us") # wait a bit
15+
await FallingEdge(dut.clk) # wait for falling edge/"negedge"
16+
dut._log.info("test finished")
17+
18+
19+
import os
20+
from pathlib import Path
21+
from cocotb_tools import runner
22+
23+
24+
def test_lcd_runner():
25+
sim = runner.Icarus()
26+
root = Path(os.getenv("ROOT")) / "hdl"
27+
28+
sources = [
29+
"lcd_st7789v3.v",
30+
"serdes.v",
31+
"fifo.v",
32+
"decoder.v",
33+
"stall.v",
34+
"ram_writer.v",
35+
]
36+
sources = [root / s for s in sources]
37+
38+
sim.build(
39+
sources=sources,
40+
includes=[root],
41+
hdl_toplevel="lcd_st7789v3",
42+
timescale=("1ns", "1ps"),
43+
build_dir=f"build/build_lcd",
44+
waves=True,
45+
)
46+
47+
test_opts = {"waves": True, "test_module": "tb", "timescale": ("1ns", "1ps")}
48+
sim.test(hdl_toplevel="lcd_st7789v3", **test_opts)
49+
50+
51+
if __name__ == "__main__":
52+
test_lcd_runner()

sim/alu.f sim/tb_legacy/alu.f

File renamed without changes.

sim/core.f sim/tb_legacy/core.f

File renamed without changes.

sim/uv.lock

+98
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)