Hi gem5 users,
for research purposes, i'm trying to model a ring topology using garnet
with only 3 routers but after writing the configuration file in python at
try to run the topology an error showed up
*i tried to model only two nodes ==> Works fine
*i tried to model four nodes ==> also works fine
*my configurations python file is attached if you want to check it.
[image: RingSimple.jpg]
My configuration file is in ==> *~/gem5/configs//topologies/TestSimple.py*
My building command is ==> *build/NULL/gem5.debug
configs/example/garnet_synth_traffic.py --num-cpus=3 --num-dirs=3
--network=garnet --topology=TestSimple --sim-cycles=5000000
--synthetic=uniform_random --injectionrate=0.2*
The error is
*build/NULL/base/addr_range.hh:189: fatal: fatal condition !masks.empty()
&& _intlv_match >= 1ULL << masks.size() occurred: Match value 2 does not
fit in 1 interleaving bits*
Best Regards,
*Eng. Karim Soliman*
Teaching Assistant
Computer Engineering Department
Pharos University in Alexandria (P.U.A)
from m5.params import *
from m5.objects import *
from common import FileSystemConfig
from topologies.BaseTopology import SimpleTopology
class TestSimple(SimpleTopology):
description = "Test topology"
def __init__(self, controllers):
self.nodes = controllers
def makeTopology(self, options, network, IntLink, ExtLink, Router):
nodes = self.nodes
num_routers = options.num_cpus
link_latency = options.link_latency
router_latency = options.router_latency
# External Code -- Ceating two routers only working in different two time dmains
# create the routers and configure the routers
routers = [
Router(router_id = i, latency = router_latency)
for i in range(num_routers)
]
# get the count of the controls per router and the remainder controls
cntrls_per_router, remainder = divmod(len(nodes), num_routers)
network_nodes = []
remainder_nodes = []
for node_index in range(len(nodes)):
if node_index < (len(nodes) - remainder):
network_nodes.append(nodes[node_index])
else:
remainder_nodes.append(nodes[node_index])
# create the External Links and configure the links
# external links must be connected to nodes aka controllers
link_count = 0
ext_links = []
for (i, n) in enumerate(network_nodes):
cntrl_level, router_id = divmod(i, num_routers)
assert cntrl_level < cntrls_per_router
ext_links.append(ExtLink(
link_id = link_count,
ext_node = n,
int_node = routers[router_id],
latency = link_latency
))
link_count += 1
# create the Internal Links and configure the links
L0 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[0],
dst_node = routers[1],
weight = 1
)
# update link_count for the next link_id
link_count += 1
L1 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[1],
dst_node = routers[0],
weight = 1
)
# update link_count for the next link_id
link_count += 1
L2 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[0],
dst_node = routers[2],
weight = 1
)
# update link_count for the next link_id
link_count += 1
L3 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[2],
dst_node = routers[0],
weight = 1
)
# update link_count for the next link_id
link_count += 1
L4 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[2],
dst_node = routers[1],
weight = 1
)
# update link_count for the next link_id
link_count += 1
L5 = IntLink(
link_id = link_count,
latency = link_latency,
src_node = routers[1],
dst_node = routers[2],
weight = 1
)
# connect routers & internal links & external links to the routers
network.routers = routers
network.int_links = [L0, L1, L2, L3, L4, L5]
network.ext_links = ext_links
# DEBUG SOME OUTPUTS
print("==========CONFIGS==========")
print(f"# of cntrls_per_router = {cntrls_per_router}")
print(f"# of router_latency = {router_latency}")
print(f"# of link_latency = {link_latency}")
print(f"# of link_count = {link_count}")
print(f"# of routers = {len(routers)}")
print(f"# of nodes = {len(nodes)}")
print(f"# of internal links = {len(network.int_links)}")
print(f"# of external links = {len(ext_links)}\n")
def registerTopology(self, options):
for i in range(options.num_cpus):
FileSystemConfig.register_node(
[i], MemorySize(options.mem_size) // options.num_cpus, i
)
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org