gem5/src/mem/ruby
Brad Beckmann e983ef9e8c testers: move testers to a new directory
This patch moves the testers to a new subdirectory under src/cpu and includes
the necessary fixes to work with latest m5 initialization patches.

--HG--
rename : configs/example/determ_test.py => configs/example/ruby_direct_test.py
rename : src/cpu/directedtest/DirectedGenerator.cc => src/cpu/testers/directedtest/DirectedGenerator.cc
rename : src/cpu/directedtest/DirectedGenerator.hh => src/cpu/testers/directedtest/DirectedGenerator.hh
rename : src/cpu/directedtest/InvalidateGenerator.cc => src/cpu/testers/directedtest/InvalidateGenerator.cc
rename : src/cpu/directedtest/InvalidateGenerator.hh => src/cpu/testers/directedtest/InvalidateGenerator.hh
rename : src/cpu/directedtest/RubyDirectedTester.cc => src/cpu/testers/directedtest/RubyDirectedTester.cc
rename : src/cpu/directedtest/RubyDirectedTester.hh => src/cpu/testers/directedtest/RubyDirectedTester.hh
rename : src/cpu/directedtest/RubyDirectedTester.py => src/cpu/testers/directedtest/RubyDirectedTester.py
rename : src/cpu/directedtest/SConscript => src/cpu/testers/directedtest/SConscript
rename : src/cpu/directedtest/SeriesRequestGenerator.cc => src/cpu/testers/directedtest/SeriesRequestGenerator.cc
rename : src/cpu/directedtest/SeriesRequestGenerator.hh => src/cpu/testers/directedtest/SeriesRequestGenerator.hh
rename : src/cpu/memtest/MemTest.py => src/cpu/testers/memtest/MemTest.py
rename : src/cpu/memtest/SConscript => src/cpu/testers/memtest/SConscript
rename : src/cpu/memtest/memtest.cc => src/cpu/testers/memtest/memtest.cc
rename : src/cpu/memtest/memtest.hh => src/cpu/testers/memtest/memtest.hh
rename : src/cpu/rubytest/Check.cc => src/cpu/testers/rubytest/Check.cc
rename : src/cpu/rubytest/Check.hh => src/cpu/testers/rubytest/Check.hh
rename : src/cpu/rubytest/CheckTable.cc => src/cpu/testers/rubytest/CheckTable.cc
rename : src/cpu/rubytest/CheckTable.hh => src/cpu/testers/rubytest/CheckTable.hh
rename : src/cpu/rubytest/RubyTester.cc => src/cpu/testers/rubytest/RubyTester.cc
rename : src/cpu/rubytest/RubyTester.hh => src/cpu/testers/rubytest/RubyTester.hh
rename : src/cpu/rubytest/RubyTester.py => src/cpu/testers/rubytest/RubyTester.py
rename : src/cpu/rubytest/SConscript => src/cpu/testers/rubytest/SConscript
2010-08-24 12:07:22 -07:00
..
buffers ruby: Stall and wait input messages instead of recycling 2010-08-20 11:46:14 -07:00
common ruby: fixed DirectoryMemory's numa_high_bit configuration 2010-08-20 11:46:13 -07:00
eventqueue ruby: get rid of PrioHeap and use STL 2010-06-10 23:17:07 -07:00
filters ruby: get rid of the Map class 2010-06-10 23:17:07 -07:00
network ruby: Added bcast msg profiling to hammer and token 2010-08-20 11:46:12 -07:00
profiler MOESI_hammer: break down miss latency stalled cycles 2010-08-20 11:46:14 -07:00
recorder ruby: get rid of PrioHeap and use STL 2010-06-10 23:17:07 -07:00
slicc_interface ruby: Fixed L2 cache miss profiling 2010-08-20 11:46:12 -07:00
storebuffer style: another ruby style pass 2010-03-31 16:56:45 -07:00
system testers: move testers to a new directory 2010-08-24 12:07:22 -07:00
tester ruby: Resurrected Ruby's deterministic tests 2010-08-20 11:46:13 -07:00
Decomissioning_note ruby: Import ruby and slicc from GEMS 2009-05-11 10:38:43 -07:00
libruby.cc ruby: get "using namespace" out of headers 2010-04-02 11:20:32 -07:00
libruby.hh ruby: Added ruby_request_type ostream def to libruby.hh 2010-08-20 11:46:12 -07:00
libruby_internal.hh ruby: style pass 2010-03-22 18:43:53 -07:00
README.debugging ruby: Import ruby and slicc from GEMS 2009-05-11 10:38:43 -07:00
SConscript ruby: Ruby changes required to use the python config system 2010-01-29 20:29:19 -08:00
SConsopts scons: make RUBY a regular (non-global) sticky var 2010-06-07 12:19:59 -04:00

# ------ Debugging the Ruby Tester ------

You can compile Ruby with debugging turned on.

cd ruby
[vim or emacs] Makefile

Change OPT_FLAGS to "-g -O0" (the first OPT_FLAGS line). Make
sure all the other OPT_FLAGS lines are commented out.

Change DEBUG_FLAGS to "-DRUBY_DEBUG=true". (Just uncomment the
first DEBUG_FLAGS line, and comment out the second DEBUG_FLAGS
line.)

You can choose which component or components to debug, and the
level of verbosity. For example,

"x86-linux/generated/MOSI_SMP_bcast/bin/tester.exec -l 100000 -v med -c n"

gives you debugging information about the network component at
the medium verbosity level. -v selects the verbosity, which may
be low, med, high, or none. -c selects the component or
components.

"x86-linux/generated/MOSI_SMP_bcast/bin/tester.exec -l 100000 -v med -c nSt"

debugs the network, the sequencer, and the tester.

For a list of the components you can debug, just run the tester with
no arguments, and it will display a list of valid components. The
components are defined in ruby/common/Debug.def.

The protocol debug trace is especially useful for debugging cache coherence protocols.  This must be enabled at compile-time by ensuring that PROTOCOL_DEBUG_TRACE is set to true for rubyconfig.defaults (if running in Simics) or tester.defaults.  You must specify the time to start tracing.  The following starts the protocol trace immediately (at time 1)

"x86-linux/generated/MOSI_SMP_bcast/bin/tester.exec -l 100000 -s 1"

Also, if something seems to be wrong and you're not sure where to
start looking, it may help to run the tester for a longer time,
e.g.

"x86-linux/generated/MOSI_SMP_bcast/bin/tester.exec -l 500000"

This may help because some problems eventually show up as
deadlock, but the tester has to run for a long time before a
deadlock is detected.

Once your simulator has succeeded on the tester for a certain
number of cycles, say 1000000, you may want to set the
RANDOMIZATION variable in ruby/config/tester.defaults to "true"
for more thorough testing.  However, RANDOMIZATION may not work in
all situations because it overrides some of the ordering in the
network and may break your simulator in ways you don't like.  For
example, messages are added to MessageBuffers with random
latency.

By default the tester driver is a generator that issues random store
and load requests. This driver does a good job of stressing the
cache coherency protocol by issuing racy store requests from multiple
processors to a cache line then checks the stores with a single load.

Other tester drivers are available.  By setting the g_SYNTHETIC_DRIVER
to true in ruby/config/tester.defaults, you enable a tester that generates
racy lock requests for a number of locks indicated by g_synthetic_locks.

Another tester driver is a series of non-racy deterministic testers.  By
setting the g_DETERMINISTIC_DRIVER in ruby/config/tester.defaults to true,
you enable the deterministic tester.  The deterministic tester can do
different types of deterministic tests as specified by g_SpecifiedGenerator
string.  The deterministic tester works best when RANDOMIZATION is set to
false.  To easily track the queues being used with the deterministic tester,
use the following debug flags "-v low -c nq".

# ------ Debugging Ruby in Simics ------

When you're running Simics, the debugging components and
verbosity levels are the same. However, the way you communicate
with Ruby changes.

See the README.quickstart for information on compiling the Ruby
module and loading it into Simics. Once you've got Simics
running, with the Ruby module loaded, you can set up Ruby
debugging.

To set the debugging verbosity level, run:

simics> ruby0.debug-verb med

To set the debugging components, run: (see common/Debug.def for complete list
                                       of component shortcuts)

simics> ruby0.debug-filter n

(NOTE: sometimes simics will interpret a single letter as a
command; e.g. expanding "p" into "print". If simics gives you an
error when setting the debug filter, try setting it like so:
simics> ruby0.debug-filter "n")

This gives the same kind of debugging information as running the
tester with "-v med -c n".

You can also send the debugging output to a file (may be a good
idea, since there's a lot of it). To do this, run:

simics> ruby0.debug-output-file <filename>