return eq(self.p.i_data, i)
def ports(self):
- res = []
- res += [self.p.i_valid, self.p.o_ready,
- self.p.i_data] # XXX need flattening!
+ res = [self.p.i_valid, self.p.o_ready]
+ if hasattr(self.p.i_data, "ports"):
+ res += self.p.i_data.ports()
+ else:
+ res += self.p.i_data
+
for i in range(len(self.n)):
- res += [self.n[i].i_ready, self.n[i].o_valid,
- self.n[i].o_data] # XXX need flattening!
+ n = self.n[i]
+ res += [n.i_ready, n.o_valid]
+ if hasattr(n.o_data, "ports"):
+ res += n.o_data.ports()
+ else:
+ res += n.o_data
return res
-
class CombMultiOutPipeline(MultiOutControlBase):
""" A multi-input Combinatorial block conforming to the Pipeline API
# HACK: n-mux is also the stage... so set the muxid equal to input mid
stage.m_id = self.p.i_data.mid
- def ports(self):
- return self.p_mux.ports()
class InputPriorityArbiter:
stage = PassThroughStage(iospec)
CombMuxOutPipe.__init__(self, stage, n_len=self.num_rows)
- def ports(self):
- res = [self.p.i_valid, self.p.o_ready] + \
- self.p.i_data.ports()
- for i in range(len(self.n)):
- res += [self.n[i].i_ready, self.n[i].o_valid] + \
- self.n[i].o_data.ports()
- return res
-
class FPADDMuxInOut:
""" Reservation-Station version of FPADD pipeline.
stage = PassThroughStage()
CombMuxOutPipe.__init__(self, stage, n_len=self.num_rows)
- def ports(self):
- res = [self.p.i_valid, self.p.o_ready] + \
- self.p.i_data.ports()
- for i in range(len(self.n)):
- res += [self.n[i].i_ready, self.n[i].o_valid] + \
- self.n[i].o_data.ports()
- return res
-
class TestInOutPipe:
def __init__(self, num_rows=4):
stage = PassThroughStage()
CombMuxOutPipe.__init__(self, stage, n_len=self.num_rows)
- def ports(self):
- res = [self.p.i_valid, self.p.o_ready] + \
- self.p.i_data.ports()
- for i in range(len(self.n)):
- res += [self.n[i].i_ready, self.n[i].o_valid] + \
- [self.n[i].o_data]
- #self.n[i].o_data.ports()
- return res
-
class TestSyncToPriorityPipe:
def __init__(self):