a binary number (accepting values 1-16).
"""
def __init__(self):
- self.outp = []
- self.outp[0] = PortInterface(name="outp_0")
- self.outp[1] = PortInterface(name="outp_1")
- self.inp = PortInterface(name="inp")
+ self.outp = [PortInterface(name="outp_0"),
+ PortInterface(name="outp_1")]
+ self.inp = PortInterface(name="inp")
+ print(self.outp)
def elaborate(self, platform):
- splitter = LDSTSplitter(64, 48, 4)
-
+ m = Module()
+ comb = m.d.comb
+ #TODO splitter = LDSTSplitter(64, 48, 4)
+ return m
class DataMergerRecord(Record):
"""
Record.__init__(self, Layout(layout), name=name)
- self.data.reset_less = True
- self.en.reset_less = True
-
+ #FIXME: make resetless
# TODO: formal verification
+
class DataMerger(Elaboratable):
"""DataMerger
def __init__(self, n_units, mem, regwid=64, addrwid=48):
self.n_units = n_units
self.mem = mem
- self.regwid = regwid
- self.addrwid = addrwid
ul = []
for i in range(n_units):
ul.append(LDSTPort(i, regwid, addrwid))
self.dports = Array(ul)
- def truncaddr(self, addr):
- """truncates the address to the top bits of the memory granularity
- """
- nbits = log2_int(self.mem.regwid)
- return addr[nbits:]
-
def elaborate(self, platform):
m = Module()
comb, sync = m.d.comb, m.d.sync
assert data == result, "data %x != %x" % (result, data)
assert data2 == result2, "data2 %x != %x" % (result2, data2)
-
def data_merger_merge(dut):
print("data_merger")
#starting with all inputs zero
assert en == 0xff
yield
-
def test_l0_cache():
dut = TstL0CacheBuffer(regwid=64)
run_simulation(dut, data_merger_merge(dut),
vcd_name='test_data_merger.vcd')
+def test_dual_port_splitter():
+
+ dut = DualPortSplitter()
+ #vl = rtlil.convert(dut, ports=dut.ports())
+ #with open("test_data_merger.il", "w") as f:
+ # f.write(vl)
+
+ run_simulation(dut, data_merger_merge(dut),
+ vcd_name='test_dual_port_splitter.vcd')
if __name__ == '__main__':
- test_l0_cache()
- test_data_merger()
+ #test_l0_cache()
+ #test_data_merger()
+ test_dual_port_splitter()