From 7d7ab738622e7969a7db85ff970e406c950b2576 Mon Sep 17 00:00:00 2001 From: Akash Bagdia Date: Thu, 27 Jun 2013 05:49:49 -0400 Subject: sim: Add the notion of clock domains to all ClockedObjects This patch adds the notion of source- and derived-clock domains to the ClockedObjects. As such, all clock information is moved to the clock domain, and the ClockedObjects are grouped into domains. The clock domains are either source domains, with a specific clock period, or derived domains that have a parent domain and a divider (potentially chained). For piece of logic that runs at a derived clock (a ratio of the clock its parent is running at) the necessary derived clock domain is created from its corresponding parent clock domain. For now, the derived clock domain only supports a divider, thus ensuring a lower speed compared to its parent. Multiplier functionality implies a PLL logic that has not been modelled yet (create a separate clock instead). The clock domains should be used as a mechanism to provide a controllable clock source that affects clock for every clocked object lying beneath it. The clock of the domain can (in a future patch) be controlled by a handler responsible for dynamic frequency scaling of the respective clock domains. All the config scripts have been retro-fitted with clock domains. For the System a default SrcClockDomain is created. For CPUs that run at a different speed than the system, there is a seperate clock domain created. This domain incorporates the CPU and the associated caches. As before, Ruby runs under its own clock domain. The clock period of all domains are pre-computed, such that no virtual functions or multiplications are needed when calling clockPeriod. Instead, the clock period is pre-computed when any changes occur. For this to be possible, each clock domain tracks its children. --- configs/ruby/MESI_CMP_directory.py | 13 +++++++++++-- configs/ruby/MI_example.py | 13 +++++++++++-- configs/ruby/MOESI_CMP_directory.py | 13 +++++++++++-- configs/ruby/MOESI_CMP_token.py | 13 +++++++++++-- configs/ruby/MOESI_hammer.py | 13 +++++++++++-- configs/ruby/Network_test.py | 13 +++++++++++-- configs/ruby/Ruby.py | 3 +-- 7 files changed, 67 insertions(+), 14 deletions(-) (limited to 'configs/ruby') diff --git a/configs/ruby/MESI_CMP_directory.py b/configs/ruby/MESI_CMP_directory.py index c265bd4cb..4128f87ad 100644 --- a/configs/ruby/MESI_CMP_directory.py +++ b/configs/ruby/MESI_CMP_directory.py @@ -144,13 +144,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): system.memories.unproxy(system))) mem_module_size = phys_mem_size / options.num_dirs + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/MI_example.py b/configs/ruby/MI_example.py index 0514a7240..6bbd35ea7 100644 --- a/configs/ruby/MI_example.py +++ b/configs/ruby/MI_example.py @@ -109,13 +109,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): system.memories.unproxy(system))) mem_module_size = phys_mem_size / options.num_dirs + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system. + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/MOESI_CMP_directory.py b/configs/ruby/MOESI_CMP_directory.py index f53758d71..81d04914c 100644 --- a/configs/ruby/MOESI_CMP_directory.py +++ b/configs/ruby/MOESI_CMP_directory.py @@ -139,13 +139,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): system.memories.unproxy(system))) mem_module_size = phys_mem_size / options.num_dirs + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system. + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/MOESI_CMP_token.py b/configs/ruby/MOESI_CMP_token.py index f3ad05a92..9c2598a1d 100644 --- a/configs/ruby/MOESI_CMP_token.py +++ b/configs/ruby/MOESI_CMP_token.py @@ -160,13 +160,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): system.memories.unproxy(system))) mem_module_size = phys_mem_size / options.num_dirs + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/MOESI_hammer.py b/configs/ruby/MOESI_hammer.py index 30fb0f0b7..11ea579ea 100644 --- a/configs/ruby/MOESI_hammer.py +++ b/configs/ruby/MOESI_hammer.py @@ -158,13 +158,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): else: pf_start_bit = block_size_bits + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/Network_test.py b/configs/ruby/Network_test.py index c1a1f9509..c4df4dddb 100644 --- a/configs/ruby/Network_test.py +++ b/configs/ruby/Network_test.py @@ -107,13 +107,22 @@ def create_system(options, system, piobus, dma_ports, ruby_system): system.memories.unproxy(system))) mem_module_size = phys_mem_size / options.num_dirs + # Run each of the ruby memory controllers at a ratio of the frequency of + # the ruby system. + # clk_divider value is a fix to pass regression. + ruby_system.memctrl_clk_domain = DerivedClockDomain( + clk_domain=ruby_system.clk_domain, + clk_divider=3) + for i in xrange(options.num_dirs): # # Create the Ruby objects associated with the directory controller # - mem_cntrl = RubyMemoryControl(version = i, - ruby_system = ruby_system) + mem_cntrl = RubyMemoryControl( + clk_domain = ruby_system.memctrl_clk_domain, + version = i, + ruby_system = ruby_system) dir_size = MemorySize('0B') dir_size.value = mem_module_size diff --git a/configs/ruby/Ruby.py b/configs/ruby/Ruby.py index 5c5e84197..a35ef4f09 100644 --- a/configs/ruby/Ruby.py +++ b/configs/ruby/Ruby.py @@ -95,8 +95,7 @@ def create_topology(controllers, options): def create_system(options, system, piobus = None, dma_ports = []): - system.ruby = RubySystem(clock = options.ruby_clock, - stats_filename = options.ruby_stats, + system.ruby = RubySystem(stats_filename = options.ruby_stats, no_mem_vec = options.use_map) ruby = system.ruby -- cgit v1.2.3