summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2012-07-10 22:51:54 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2012-07-10 22:51:54 -0700
commit6f9bd33b73428709b534d2c4a2b8246557be2397 (patch)
treefb5b51df8a803c177b01594382e60e5606b857c6
parenta22918dd41dfda1fe7dfd46db33bc7737bfdbb41 (diff)
downloadgem5-6f9bd33b73428709b534d2c4a2b8246557be2397.tar.xz
ruby: remove the cpu assumptions for the random tester
-rw-r--r--configs/example/ruby_random_test.py5
-rw-r--r--src/cpu/testers/rubytest/CheckTable.cc1
2 files changed, 4 insertions, 2 deletions
diff --git a/configs/example/ruby_random_test.py b/configs/example/ruby_random_test.py
index eae3873b7..3f6bd72e2 100644
--- a/configs/example/ruby_random_test.py
+++ b/configs/example/ruby_random_test.py
@@ -90,8 +90,7 @@ if buildEnv['PROTOCOL'] == 'MOESI_hammer':
tester = RubyTester(check_flush = check_flush,
checks_to_complete = options.checks,
- wakeup_frequency = options.wakeup_freq,
- num_cpus = options.num_cpus)
+ wakeup_frequency = options.wakeup_freq)
#
# Create the M5 system. Note that the Memory Object isn't
@@ -104,6 +103,8 @@ Ruby.create_system(options, system)
assert(options.num_cpus == len(system.ruby._cpu_ruby_ports))
+tester.num_cpus = len(system.ruby._cpu_ruby_ports)
+
#
# The tester is most effective when randomization is turned on and
# artifical delay is randomly inserted on messages
diff --git a/src/cpu/testers/rubytest/CheckTable.cc b/src/cpu/testers/rubytest/CheckTable.cc
index b4860b62b..f10132c89 100644
--- a/src/cpu/testers/rubytest/CheckTable.cc
+++ b/src/cpu/testers/rubytest/CheckTable.cc
@@ -106,6 +106,7 @@ CheckTable::addCheck(const Address& address)
Check*
CheckTable::getRandomCheck()
{
+ assert(m_check_vector.size() > 0);
return m_check_vector[random() % m_check_vector.size()];
}