"Shape", "signed", "unsigned",
"Value", "Const", "C", "AnyConst", "AnySeq", "Operator", "Mux", "Part", "Slice", "Cat", "Repl",
"Array", "ArrayProxy",
- "_InternalSwitch", "_InternalAssign",
+ "_InternalSwitch", "_InternalAssign", "_InternalRepl",
"Signal", "ClockSignal", "ResetSignal",
"UserValue", "ValueCastable",
"Sample", "Past", "Stable", "Rose", "Fell", "Initial",
super().__init__()
self.src_loc = tracer.get_src_loc(1 + src_loc_at)
+ def __Repl__(self, count, *, src_loc_at=0):
+ return _InternalRepl(self, count, src_loc_at=src_loc_at)
+
def __Mux__(self, val1, val0):
return _InternalMux(self, val1, val0)
@final
-class Repl(Value):
+def Repl(value, count, *, src_loc_at=0):
+ return value.__Repl__(count, src_loc_at=src_loc_at)
+
+
+class _InternalRepl(Value):
"""Replicate a value
An input value is replicated (repeated) several times
new_value = self.on_Part(value)
elif type(value) is Cat:
new_value = self.on_Cat(value)
- elif type(value) is Repl:
+ elif type(value) is _InternalRepl:
new_value = self.on_Repl(value)
elif type(value) is ArrayProxy:
new_value = self.on_ArrayProxy(value)