Skip to content

Commit

Permalink
gateware.cdc: add a test case that exercises cdc.synchronize() on Pin…
Browse files Browse the repository at this point in the history
… elements
  • Loading branch information
antoinevg committed Jun 7, 2024
1 parent 6cb2175 commit d46963a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_cdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from unittest import TestCase

from amaranth import Module, Record, Signal
from amaranth.lib.io import Pin
from amaranth.hdl.rec import DIR_FANIN, DIR_FANOUT
from luna.gateware.utils.cdc import synchronize, stretch_strobe_signal

Expand Down Expand Up @@ -39,6 +40,17 @@ def test_nested_record(self):
])
synchronize(m, record)

def test_pins(self):
m = Module()
pins = {
"sig_in": Pin(1, "i"),
"sig_out": Pin(1, "o"),
}
record = Record([
(f_name, f.layout) for (f_name, f) in pins.items()
], fields=pins)
synchronize(m, record)


class StrobeStretcherTest(LunaGatewareTestCase):
""" Test case for our strobe stretcher function. """
Expand Down

0 comments on commit d46963a

Please sign in to comment.