learning-gem5: fix int_links warning
Update the Part 3 config file examples in learning gem5 to resolve a warning with int_links. Some files were initializing self.int_links vector to an empty list of SimObjects. This causes a warning. The fix resolves this by initializing self.int_links to a pre-declared int_links variable. Change-Id: Iaa38a4db9cc42a949879d571d1372f0b0a456f11 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60829 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
@@ -234,11 +234,12 @@ class MyNetwork(SimpleNetwork):
|
||||
# Make an "internal" link (internal to the network) between every pair
|
||||
# of routers.
|
||||
link_count = 0
|
||||
self.int_links = []
|
||||
int_links = []
|
||||
for ri in self.routers:
|
||||
for rj in self.routers:
|
||||
if ri == rj: continue # Don't connect a router to itself!
|
||||
link_count += 1
|
||||
self.int_links.append(SimpleIntLink(link_id = link_count,
|
||||
int_links.append(SimpleIntLink(link_id = link_count,
|
||||
src_node = ri,
|
||||
dst_node = rj))
|
||||
self.int_links = int_links
|
||||
|
||||
@@ -219,11 +219,12 @@ class MyNetwork(SimpleNetwork):
|
||||
# Make an "internal" link (internal to the network) between every pair
|
||||
# of routers.
|
||||
link_count = 0
|
||||
self.int_links = []
|
||||
int_links = []
|
||||
for ri in self.routers:
|
||||
for rj in self.routers:
|
||||
if ri == rj: continue # Don't connect a router to itself!
|
||||
link_count += 1
|
||||
self.int_links.append(SimpleIntLink(link_id = link_count,
|
||||
int_links.append(SimpleIntLink(link_id = link_count,
|
||||
src_node = ri,
|
||||
dst_node = rj))
|
||||
self.int_links = int_links
|
||||
|
||||
Reference in New Issue
Block a user