Skip to content

Commit

Permalink
tests: gateware: bootloader: combined D+ and D- on the USB IO record …
Browse files Browse the repository at this point in the history
…in the DUT, not used in the test yet but is prepped for when protocol decoders in surfer work
  • Loading branch information
lethalbit committed Jan 5, 2025
1 parent c2cde06 commit ba5748a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/gateware/bootloader/test_bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,24 @@ class DUTWrapper(Elaboratable):
def __init__(self) -> None:
self.bootloader = SquishyBootloader(serial_number = 'TEST', revision = (2, 0))

self.d_p = Signal()
self.d_n = Signal()

def elaborate(self, _) -> Module:
m = Module()

m.submodules.bootloader = self.bootloader

with m.If(_USB_RECORD.d_p.oe):
m.d.comb += [ self.d_p.eq(_USB_RECORD.d_p.o), ]
with m.Else():
m.d.comb += [ self.d_p.eq(_USB_RECORD.d_p.i), ]

with m.If(_USB_RECORD.d_n.oe):
m.d.comb += [ self.d_n.eq(_USB_RECORD.d_n.o), ]
with m.Else():
m.d.comb += [ self.d_n.eq(_USB_RECORD.d_n.i), ]

return m


Expand Down

0 comments on commit ba5748a

Please sign in to comment.