Mem: Make SimpleMemory single ported
This patch changes the simple memory to have a single slave port rather than a vector port. The simple memory makes no attempts at modelling the contention between multiple ports, and any such multiplexing and demultiplexing could be done in a bus (or crossbar) outside the memory controller. This scenario also matches with the ongoing work on a SimpleDRAM model, which will be a single-ported single-channel controller that can be used in conjunction with a bus (or crossbar) to create a multi-port multi-channel controller. There are only very few regressions that make use of the vector port, and these are all for functional accesses only. To facilitate these cases, memtest and memtest-ruby have been updated to also have a "functional" bus to perform the (de)multiplexing of the functional memory accesses.
This commit is contained in:
@@ -141,6 +141,7 @@ for scale in treespec[:-2]:
|
||||
|
||||
# system simulated
|
||||
system = System(funcmem = SimpleMemory(in_addr_map = False),
|
||||
funcbus = NoncoherentBus(),
|
||||
physmem = SimpleMemory(latency = "100ns"))
|
||||
|
||||
def make_level(spec, prototypes, attach_obj, attach_port):
|
||||
@@ -169,10 +170,13 @@ def make_level(spec, prototypes, attach_obj, attach_port):
|
||||
parent.cpu = objs
|
||||
for t in objs:
|
||||
t.test = getattr(attach_obj, attach_port)
|
||||
t.functional = system.funcmem.port
|
||||
t.functional = system.funcbus.slave
|
||||
|
||||
make_level(treespec, prototypes, system.physmem, "port")
|
||||
|
||||
# connect reference memory to funcbus
|
||||
system.funcbus.master = system.funcmem.port
|
||||
|
||||
# -----------------------
|
||||
# run simulation
|
||||
# -----------------------
|
||||
|
||||
Reference in New Issue
Block a user