memory_size_mb = 1024
num_dma = 1
-protocol = "MOESI_CMP_directory"
+protocol = "MESI_CMP_directory"
# check for overrides
net_ports = Array.new
iface_ports = Array.new
-assert(protocol == "MOESI_CMP_directory", __FILE__+" cannot be used with protocol "+protocol);
+#assert(protocol == "MESI_CMP_directory", __FILE__+" cannot be used with protocol "+protocol);
require protocol+".rb"
sequencer,
num_l2_banks)
end
+
+ if protocol == "MESI_CMP_directory"
+ net_ports << MESI_CMP_directory_L1CacheController.new("L1CacheController_"+n.to_s,
+ "L1Cache",
+ icache, dcache,
+ sequencer,
+ num_l2_banks)
+ end
}
num_l2_banks.times { |n|
cache = SetAssociativeCache.new("l2u_"+n.to_s, l2_cache_size_kb/num_l2_banks, l2_cache_latency, l2_cache_assoc, "PSEUDO_LRU")
"L2Cache",
cache)
end
+
+ if protocol == "MESI_CMP_directory"
+ net_ports << MESI_CMP_directory_L2CacheController.new("L2CacheController_"+n.to_s,
+ "L2Cache",
+ cache)
+ end
+
+
}
num_memories.times { |n|
directory = DirectoryMemory.new("DirectoryMemory_"+n.to_s, memory_size_mb/num_memories)
directory,
memory_control)
end
+
+ if protocol == "MESI_CMP_directory"
+ net_ports << MESI_CMP_directory_DirectoryController.new("DirectoryController_"+n.to_s,
+ "Directory",
+ directory,
+ memory_control)
+ end
+
}
num_dma.times { |n|
dma_sequencer = DMASequencer.new("DMASequencer_"+n.to_s)
"DMA",
dma_sequencer)
end
+
+ if protocol == "MESI_CMP_directory"
+ net_ports << MESI_CMP_directory_DMAController.new("DMAController_"+n.to_s,
+ "DMA",
+ dma_sequencer)
+ end
+
+
}
topology = CrossbarTopology.new("theTopology", net_ports)
end
-#require "defaults.rb"
cacti_args << 360 << 0 << 0 << 0 << 0 << 1 << 1 << 1 << 1 << 0 << 0
cacti_args << 50 << 10 << 10 << 0 << 1 << 1
- cacti_cmd = File.dirname(__FILE__) + "/cacti/cacti " + cacti_args.join(" ")
-
- IO.popen(cacti_cmd) { |pipe|
- str1 = pipe.readline
- str2 = pipe.readline
- results = str2.split(", ")
- if results.size != 61
- print "CACTI ERROR: CACTI produced unexpected output.\n"
- print "Are you using the version shipped with libruby?\n"
- raise Exception
- end
- latency_ns = results[5].to_f
- if (latency_ns == "1e+39")
- print "CACTI ERROR: CACTI was unable to realistically model the cache ",@obj_name,"\n"
- print "Either change the cache parameters or manually set the latency values\n"
- raise Exception
- end
- clk_period_ns = 1e9 * (1.0 / (RubySystem.freq_mhz * 1e6))
- latency_cycles = (latency_ns / clk_period_ns).ceil
- @latency = latency_cycles
- }
+# cacti_cmd = File.dirname(__FILE__) + "/cacti/cacti " + cacti_args.join(" ")
+
+# IO.popen(cacti_cmd) { |pipe|
+# str1 = pipe.readline
+# str2 = pipe.readline
+# results = str2.split(", ")
+# if results.size != 61
+# print "CACTI ERROR: CACTI produced unexpected output.\n"
+# print "Are you using the version shipped with libruby?\n"
+# raise Exception
+# end
+# latency_ns = results[5].to_f
+# if (latency_ns == "1e+39")
+# print "CACTI ERROR: CACTI was unable to realistically model the cache ",@obj_name,"\n"
+# print "Either change the cache parameters or manually set the latency values\n"
+# raise Exception
+# end
+# clk_period_ns = 1e9 * (1.0 / (RubySystem.freq_mhz * 1e6))
+# latency_cycles = (latency_ns / clk_period_ns).ceil
+# @latency = latency_cycles
+# }
elsif @latency.is_a?(Float)
clk_period_ns = 1e9 * (1.0 / (RubySystem.freq_mhz * 1e6))
latency_cycles = (@latency / clk_period_ns).ceil
end
-
class Sequencer < IfacePort
def cppClassName()
end
end
+#added by SS
require "defaults.rb"
# buffer_size limits the size of all other buffers connecting to
# SLICC Controllers. When 0, infinite buffering is used.
- default_param :buffer_size, Integer, 32
+ default_param :buffer_size, Integer, 0
# added by SS for TBE
default_param :number_of_TBEs, Integer, 256
# 1. change protocol_trace = true
# 2. enable debug in the Ruby Makefile
# 3. set start_time = 1
- default_param :protocol_trace, Boolean, false
+ default_param :protocol_trace, Boolean, true
# a string for filtering debugging output (for all g_debug vars see Debug.h)
default_param :filter_string, String, "none"
# filters debugging messages based on a ruby time
default_param :start_time, Integer, 1
-
+
# sends debugging messages to a output filename
- default_param :output_filename, String, "none"
+ default_param :output_filename, String, "debug_ss"
end
class Topology < LibRubyObject
class Network < LibRubyObject
default_param :endpoint_bandwidth, Integer, 10000
default_param :adaptive_routing, Boolean, true
- default_param :number_of_virtual_networks, Integer, 6
+ default_param :number_of_virtual_networks, Integer, 10
default_param :fan_out_degree, Integer, 4
# default buffer size. Setting to 0 indicates infinite buffering
- default_param :buffer_size, Integer, 3
+ default_param :buffer_size, Integer, 0
# local memory latency ?? NetworkLinkLatency
default_param :link_latency, Integer, 1
default_param :profiler, Profiler, Profiler.new("profiler0")
end
+#added by SS
+
+class MESI_CMP_directory_L2CacheController < CacheController
+ default_param :l2_request_latency, Integer, 2
+ default_param :l2_response_latency, Integer, 2
+ default_param :to_L1_latency, Integer, 1
+
+#if 0 then automatically calculated
+ default_param :lowest_bit, Integer, 0
+ default_param :highest_bit, Integer, 0
+end
+
+class MESI_CMP_directory_L1CacheController < L1CacheController
+ default_param :l1_request_latency, Integer, 2
+ default_param :l1_response_latency, Integer, 2
+ default_param :to_L2_latency, Integer, 1
+end
+
+
+class MESI_CMP_directory_DirectoryController < DirectoryController
+ default_param :to_mem_ctrl_latency, Integer, 1
+ default_param :directory_latency, Integer, 6
+end
+
+class MESI_CMP_directory_DMAController < DMAController
+ default_param :request_latency, Integer, 6
+end