Skip to content

Commit

Permalink
build/altera/common.py: implement SDRTristate for Agilex5 family
Browse files Browse the repository at this point in the history
  • Loading branch information
trabucayre committed Jul 30, 2024
1 parent 3041150 commit 1f6673c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions litex/build/altera/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,35 @@ class Agilex5SDRInput:
def lower(dr):
return Agilex5DDRInputImpl(dr.i, dr.o, Signal(), dr.clk)

# Agilex5 SDRTristate ------------------------------------------------------------------------------

class Agilex5SDRTristateImpl(Module):
def __init__(self, io, o, oe, i, clk):
_i = Signal()
_o = Signal()
_oe = Signal()
self.specials += [
SDRIO(o, _o, clk),
SDRIO(oe, _oe, clk),
SDRIO(_i, i, clk),
Instance("tennm_ph2_io_ibuf",
p_bus_hold = "BUS_HOLD_OFF",
io_i = io, # FIXME: its an input but io is needed to have correct dir at top module
o_o = _i,
),
Instance("tennm_ph2_io_obuf",
p_open_drain = "OPEN_DRAIN_OFF",
i_i = _o,
i_oe = _oe,
io_o = io, # FIXME: its an output but io is needed to have correct dir at top module
),
]

class Agilex5SDRTristate(Module):
@staticmethod
def lower(dr):
return Agilex5SDRTristateImpl(dr.io, dr.o, dr.oe, dr.i, dr.clk)

# Agilex5 Special Overrides ------------------------------------------------------------------------

agilex5_special_overrides = {
Expand All @@ -215,4 +244,5 @@ def lower(dr):
DDRInput: Agilex5DDRInput,
SDROutput: Agilex5SDROutput,
SDRInput: Agilex5SDRInput,
SDRTristate: Agilex5SDRTristate,
}

0 comments on commit 1f6673c

Please sign in to comment.