vlen = len(self.i_valid)
if vlen > 1: # multi-bit case: valid only when i_valid is all 1s
all1s = Const(-1, (len(self.i_valid), False))
+ if self.stage_ctl:
+ return self.i_valid == all1s & self.s_o_ready
return self.i_valid == all1s
# single-bit i_valid case
+ if self.stage_ctl:
+ return self.i_valid & self.s_o_ready
return self.i_valid
"""
def __init__(self):
- self.count = Signal(3)
+ self.count = Signal(2)
def ispec(self):
return Signal(16, name="example_input_signal")
@property
def p_o_ready(self):
- return Const(1)
return self.count == 0
@property
def elaborate(self, platform):
m = Module()
- m.d.sync += self.count.eq(~self.count)
+ m.d.sync += self.count.eq(self.count + 1)
return m