summaryrefslogtreecommitdiff
path: root/src/mem/ruby/config/cfg.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/ruby/config/cfg.rb')
-rw-r--r--src/mem/ruby/config/cfg.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mem/ruby/config/cfg.rb b/src/mem/ruby/config/cfg.rb
index 82fbb64a5..ffc36dd67 100644
--- a/src/mem/ruby/config/cfg.rb
+++ b/src/mem/ruby/config/cfg.rb
@@ -150,6 +150,9 @@ class NetPort < LibRubyObject
def cppClassName
"NetPort"
end
+ def self.totalOfType(mach_type)
+ return @@type_cnt[mach_type]
+ end
end
class MemoryVector < LibRubyObject
@@ -190,6 +193,7 @@ end
class RubySystem
@@params = Hash.new
+ @@defaults = Hash.new
@@network = nil
def self.init(iface_ports, network)
@@ -197,6 +201,14 @@ class RubySystem
@@network = network
end
+ def self.reset()
+ @@iface_ports = nil
+ @@network = nil
+ @@params.each { |param_name, param|
+ param = @@defaults[param_name]
+ }
+ end
+
def self.default_param(param_name, type, default)
if default.is_a?(FalseClass) || default.is_a?(TrueClass)
assert type.is_a?(Boolean), "default value of param \"#{param_name}\" must be either true or false"
@@ -204,6 +216,7 @@ class RubySystem
assert default.is_a?(type), "default value of param \"#{param_name}\" does not match type #{type}"
end
@@params[param_name] = default
+ @@defaults[param_name] = default
method_name = (param_name.to_s).to_sym
instance_eval <<-EOS
def #{method_name.to_s}