Skip to content

Commit 412f0f5

Browse files
committed
build/io: Add ClkInput/Ouptut to be able to abstract Clk Input/Output primitives.
1 parent 36ce71d commit 412f0f5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

litex/build/io.py

+31
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@ def iter_expressions(self):
4343
def lower(dr):
4444
raise NotImplementedError("Attempted to use a Differential Output, but platform does not support them")
4545

46+
# Clk Input/Output ---------------------------------------------------------------------------------
47+
48+
class ClkInput(Special):
49+
def __init__(self, i, o):
50+
Special.__init__(self)
51+
self.i = wrap(i)
52+
self.o = o if isinstance(o, str) else wrap(o)
53+
54+
def iter_expressions(self):
55+
yield self, "i", SPECIAL_INPUT
56+
yield self, "o", SPECIAL_OUTPUT
57+
58+
@staticmethod
59+
def lower(dr):
60+
raise NotImplementedError("Attempted to use a Clk Input, but platform does not support them")
61+
62+
63+
class ClkOutput(Special):
64+
def __init__(self, i, o):
65+
Special.__init__(self)
66+
self.i = i if isinstance(i, str) else wrap(i)
67+
self.o = wrap(o)
68+
69+
def iter_expressions(self):
70+
yield self, "i", SPECIAL_INPUT
71+
yield self, "o", SPECIAL_OUTPUT
72+
73+
@staticmethod
74+
def lower(dr):
75+
raise NotImplementedError("Attempted to use a Clk Output, but platform does not support them")
76+
4677
# SDR Input/Output ---------------------------------------------------------------------------------
4778

4879
class InferedSDRIO(Module):

0 commit comments

Comments
 (0)