self.data_i = Array(ul)
self.data_o = DataMergerRecord()
+ def elaborate(self, platform):
+ m = Module()
+ comb, sync = m.d.comb, m.d.sync
+ #(1) pick a row
+ m.submodules.pick = pick = PriorityEncoder(self.array_size)
+ pick.i.eq(0)
+ for j in range(self.addr):
+ with m.If(self.addr_match_i[j]>0):
+ pick.i.eq(pick.i||(1<<j))
+ valid = ~pick.n
+ idx = pick.o
+ #(2) merge
+ self.data_o.eq(0)
+ for j in range(self.array_size):
+ with m.If(self.addr_match_i[idx][j] && valid):
+ self.data_o.eq(self.data_i[j]|self.data_o)
+
class LDSTPort(Elaboratable):
def __init__(self, idx, regwid=64, addrwid=48):