Skip to content

Commit

Permalink
build: io: make oe2 of DDRTristate optional
Browse files Browse the repository at this point in the history
make oe2 of DDRTristate optional.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Sep 18, 2024
1 parent abc8f9b commit 37ac79b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion litex/build/efinix/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def lower(dr):

class EfinixDDRTristateImpl(Module):
def __init__(self, platform, io, o1, o2, oe1, oe2, i1, i2, clk):
assert oe1 == oe2
assert oe2 is None
io_name = platform.get_pin_name(io)
io_pad = platform.get_pin_location(io)
io_prop = platform.get_pin_properties(io)
Expand Down
4 changes: 2 additions & 2 deletions litex/build/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk):
_oe = Signal()
_i = Signal()
self.specials += DDROutput(o1, o2, _o, clk)
self.specials += DDROutput(oe1, oe2, _oe, clk)
self.specials += DDROutput(oe1, oe2, _oe, clk) if oe2 is not None else SDROutput(oe1, _oe, clk)
self.specials += DDRInput(_i, i1, i2, clk)
self.specials += Tristate(io, _o, _oe, _i)

class DDRTristate(Special):
def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk=ClockSignal()):
def __init__(self, io, o1, o2, oe1, oe2=None, i1=Signal(), i2=Signal(), clk=ClockSignal()):
Special.__init__(self)
self.io = io
self.o1 = o1
Expand Down
3 changes: 2 additions & 1 deletion litex/build/lattice/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,12 @@ def lower(dr):

class LatticeNXDDRTristateImpl(Module):
def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk):
assert oe2 is None
_o = Signal()
_oe = Signal()
_i = Signal()
self.specials += DDROutput(o1, o2, _o, clk)
self.specials += SDROutput(oe1 | oe2, _oe, clk)
self.specials += SDROutput(oe1, _oe, clk)
self.specials += DDRInput(_i, i1, i2, clk)
self.specials += Tristate(io, _o, _oe, _i)
_oe.attr.add("syn_useioff")
Expand Down
2 changes: 1 addition & 1 deletion litex/build/xilinx/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(self, io, o1, o2, oe1, oe2, i1, i2, clk):
_oe_n = Signal()
_i = Signal()
self.specials += DDROutput(o1, o2, _o, clk)
self.specials += DDROutput(~oe1, ~oe2, _oe_n, clk)
self.specials += DDROutput(~oe1, ~oe2, _oe_n, clk) if oe2 is not None else SDROutput(~oe1, _oe_n, clk)
self.specials += DDRInput(_i, i1, i2, clk)
self.specials += Instance("IOBUF",
io_IO = io,
Expand Down

0 comments on commit 37ac79b

Please sign in to comment.