network: convert links & switches to first class C++ SimObjects
This patch converts links and switches from second class simobjects that were virtually ignored by the networks (both simple and Garnet) to first class simobjects that directly correspond to c++ ojbects manipulated by the topology and network classes. This is especially true for Garnet, where the links and switches directly correspond to specific C++ objects. By making this change, many aspects of the Topology class were simplified. --HG-- rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/BasicLink.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/BasicLink.hh rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.hh rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetLink_d.py rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/fixed-pipeline/GarnetRouter_d.py rename : src/mem/ruby/network/Network.cc => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.cc rename : src/mem/ruby/network/Network.hh => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.hh rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetLink.py rename : src/mem/ruby/network/garnet/fixed-pipeline/GarnetNetwork_d.py => src/mem/ruby/network/garnet/flexible-pipeline/GarnetRouter.py
This commit is contained in:
@@ -84,6 +84,8 @@ def create_system(options, system, piobus, dma_devices):
|
||||
l2_bits = int(math.log(options.num_l2caches, 2))
|
||||
block_size_bits = int(math.log(options.cacheline_size, 2))
|
||||
|
||||
cntrl_count = 0
|
||||
|
||||
for i in xrange(options.num_cpus):
|
||||
#
|
||||
# First create the Ruby objects associated with this cpu
|
||||
@@ -105,6 +107,7 @@ def create_system(options, system, piobus, dma_devices):
|
||||
cpu_seq.pio_port = piobus.port
|
||||
|
||||
l1_cntrl = L1Cache_Controller(version = i,
|
||||
cntrl_id = cntrl_count,
|
||||
sequencer = cpu_seq,
|
||||
L1IcacheMemory = l1i_cache,
|
||||
L1DcacheMemory = l1d_cache,
|
||||
@@ -126,6 +129,8 @@ def create_system(options, system, piobus, dma_devices):
|
||||
cpu_sequencers.append(cpu_seq)
|
||||
l1_cntrl_nodes.append(l1_cntrl)
|
||||
|
||||
cntrl_count += 1
|
||||
|
||||
l2_index_start = block_size_bits + l2_bits
|
||||
|
||||
for i in xrange(options.num_l2caches):
|
||||
@@ -137,11 +142,14 @@ def create_system(options, system, piobus, dma_devices):
|
||||
start_index_bit = l2_index_start)
|
||||
|
||||
l2_cntrl = L2Cache_Controller(version = i,
|
||||
cntrl_id = cntrl_count,
|
||||
L2cacheMemory = l2_cache,
|
||||
N_tokens = n_tokens)
|
||||
|
||||
exec("system.l2_cntrl%d = l2_cntrl" % i)
|
||||
l2_cntrl_nodes.append(l2_cntrl)
|
||||
|
||||
cntrl_count += 1
|
||||
|
||||
phys_mem_size = long(system.physmem.range.second) - \
|
||||
long(system.physmem.range.first) + 1
|
||||
@@ -158,6 +166,7 @@ def create_system(options, system, piobus, dma_devices):
|
||||
dir_size.value = mem_module_size
|
||||
|
||||
dir_cntrl = Directory_Controller(version = i,
|
||||
cntrl_id = cntrl_count,
|
||||
directory = \
|
||||
RubyDirectoryMemory(version = i,
|
||||
size = \
|
||||
@@ -168,6 +177,8 @@ def create_system(options, system, piobus, dma_devices):
|
||||
exec("system.dir_cntrl%d = dir_cntrl" % i)
|
||||
dir_cntrl_nodes.append(dir_cntrl)
|
||||
|
||||
cntrl_count += 1
|
||||
|
||||
for i, dma_device in enumerate(dma_devices):
|
||||
#
|
||||
# Create the Ruby objects associated with the dma controller
|
||||
@@ -177,6 +188,7 @@ def create_system(options, system, piobus, dma_devices):
|
||||
physmem = system.physmem)
|
||||
|
||||
dma_cntrl = DMA_Controller(version = i,
|
||||
cntrl_id = cntrl_count,
|
||||
dma_sequencer = dma_seq)
|
||||
|
||||
exec("system.dma_cntrl%d = dma_cntrl" % i)
|
||||
@@ -186,6 +198,8 @@ def create_system(options, system, piobus, dma_devices):
|
||||
exec("system.dma_cntrl%d.dma_sequencer.port = dma_device.dma" % i)
|
||||
dma_cntrl_nodes.append(dma_cntrl)
|
||||
|
||||
cntrl_count += 1
|
||||
|
||||
all_cntrls = l1_cntrl_nodes + \
|
||||
l2_cntrl_nodes + \
|
||||
dir_cntrl_nodes + \
|
||||
|
||||
Reference in New Issue
Block a user