Skip to content

Commit

Permalink
Update for Amaranth 0.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Jun 15, 2024
1 parent 43dec27 commit 7627d20
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 75 deletions.
126 changes: 59 additions & 67 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Template for a generic FPGA project using Amaranth"

requires-python = "~=3.8"
dependencies = [
"amaranth[builtin-yosys]~=0.4",
"amaranth[builtin-yosys]~=0.5",
"amaranth-boards @ git+https://github.com/amaranth-lang/amaranth-boards",
"yowasp-yosys",
"yowasp-nextpnr-ice40",
Expand Down
14 changes: 7 additions & 7 deletions tests/test_blinky.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
def test_blinky_frequency():
blinky = Blinky(frequency=10)

def testbench():
async def testbench(ctx):
for _ in range(5):
assert (yield blinky.led) == 0
yield
assert ctx.get(blinky.led) == 0
await ctx.tick()
for _ in range(5):
assert (yield blinky.led) == 1
yield
assert (yield blinky.led) == 0
assert ctx.get(blinky.led) == 1
await ctx.tick()
assert ctx.get(blinky.led) == 0

sim = Simulator(blinky)
sim.add_clock(period=1e-2)
sim.add_sync_process(testbench)
sim.add_testbench(testbench)
sim.run()

0 comments on commit 7627d20

Please sign in to comment.