diff options
Diffstat (limited to 'src/mem/ruby/network/simple/Network_Files/NetworkFileMaker.py')
-rw-r--r-- | src/mem/ruby/network/simple/Network_Files/NetworkFileMaker.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/mem/ruby/network/simple/Network_Files/NetworkFileMaker.py b/src/mem/ruby/network/simple/Network_Files/NetworkFileMaker.py new file mode 100644 index 000000000..7d07588a1 --- /dev/null +++ b/src/mem/ruby/network/simple/Network_Files/NetworkFileMaker.py @@ -0,0 +1,44 @@ +#!/s/std/bin/python +import sys, os, string, re, math + +rows = 0 +cols =0 + +if len(sys.argv) == 3: + rows = int(sys.argv[1]) + cols = int(sys.argv[2]) +else: + sys.stderr.write("usage : NetworkFileMaker.py <rows> <cols> \n\n") + +banks = rows*cols +bank = 0 +while bank < banks: + sys.stdout.write("ext_node:L2Cache:0:bank:%d int_node:%d link_latency:1 bw_multiplier:16\n" % (bank, bank)) + bank += 1 + +sys.stdout.write("\n") + +col = 0 +while col < cols: + row = 1 + bank = col*rows + while row < rows: + sys.stdout.write("int_node:%d int_node:%d link_latency:1 bw_multiplier:16\n" % (bank, bank+1)) + bank += 1 + row += 1 + sys.stdout.write("\n") + col += 1 + +sys.stdout.write("\n") + +row = 0 +while row < rows: + col = 1 + bank = row + while col < cols: + sys.stdout.write("int_node:%d int_node:%d link_latency:1 bw_multiplier:16\n" % (bank, rows+bank)) + bank += rows + col += 1 + sys.stdout.write("\n") + row += 1 + |