diff options
author | Nathan Binkert <nate@binkert.org> | 2009-07-06 15:49:47 -0700 |
---|---|---|
committer | Nathan Binkert <nate@binkert.org> | 2009-07-06 15:49:47 -0700 |
commit | da704f52e55dd2649e53bf233f948c897727f13d (patch) | |
tree | 150514b6e67a108c56ad771adeb908713b06df65 /tests/configs/ruby_config.py | |
parent | a7904e2cf341d5452c5622adfcbdcd268d4ab7d1 (diff) | |
download | gem5-da704f52e55dd2649e53bf233f948c897727f13d.tar.xz |
ruby: Fix RubyMemory to work with the newer ruby.
Diffstat (limited to 'tests/configs/ruby_config.py')
-rw-r--r-- | tests/configs/ruby_config.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/configs/ruby_config.py b/tests/configs/ruby_config.py new file mode 100644 index 000000000..7b8e27613 --- /dev/null +++ b/tests/configs/ruby_config.py @@ -0,0 +1,20 @@ +import os +import subprocess + +from os.path import dirname, join as joinpath + +import m5 + +def generate(config_file, cores=1, memories=1, memory_size=1024): + default = joinpath(dirname(__file__), '../../src/mem/ruby/config') + ruby_config = os.environ.get('RUBY_CONFIG', default) + args = [ "ruby", "-I", ruby_config, joinpath(ruby_config, "print_cfg.rb"), + "-r", joinpath(ruby_config, config_file), "-p", str(cores), + "-m", str(memories), "-s", str(memory_size)] + + temp_config = joinpath(m5.options.outdir, "ruby.config") + ret = subprocess.call(args, stdout=file(temp_config, "w")) + if ret != 0: + raise RuntimeError, "subprocess failed!" + + return m5.objects.RubyMemory(config_file=temp_config, num_cpus=cores) |