In this section, we will compile Ruby and Opal and run a simulation manually. This is meant to illustrate the steps necessary to get Ruby and Opal loaded into Simics. For actual research and result gathering, it is highly recommended to script the running of the simulation. The Multifacet group uses extensive scripting, as well as the use of the Condor batch-computing system, to automate the running and data collection of simulation. Some examples of our scripts are provided in the $GEMS/gen-scripts directory. See the README file located in that directory, or see this short write-up on running a simulation using ["gen-scripts"].
Compile Ruby
-
To compile Ruby, specify the SLICC protocol specification, and the destination directory which will be created in $GEMS/simics/home . This allows multiple protocols to co-exist in the Simics tree. This is accomplished by the movemodule target in the Ruby Makefile. If desired, you can edit this target such that the ruby module remains in $GEMS/simics/x86-linux/lib.
cd $GEMS/ruby make PROTOCOL=MOSI_SMP_bcast DESTINATION=MOSI_SMP_bcast
When the above command is executed, SLICC is first compiled and run on the MOSI_SMP_bcast specification files. SLICC generates C++ code that is placed in theruby/generated/MOSI_SMP_bcast directory. MOSI_SMP_bcast is a snooping, broadcast-based cache coherence protocol for a SMP system. By default, Ruby is configured to work with this protocol. Other protocols may require you to change configuration options. See the ReleasedProtocols page for more information about SLICC files we have provided.
Compile Opal
-
Compiling Opal is optional Opal is independent of the chosen SLICC protocol, however the DESTINATION directory must be specified.
cd $GEMS/opal make module DESTINATION=MOSI_SMP_bcast
Set Environment and Start Simics
-
The Makefile creates a link to the Simics executable in the $GEMS/simics/home/<DESTINATION> directory. This is what we typically use rather than the GUI Simics executable. In order to find the modules, the SIMICS_EXTRA_LIB environment variable must be set to ./modules. For C-based shells (csh and tcsh), do the following:
setenv SIMICS_EXTRA_LIB ./modules
Now start Simics from the home directorycd $GEMS/simics/home/MOSI_SMP_bcast ./simics -stall
Note that the -stall option should be placed in the Simics command line arguments to ensure forward-compatibility.
Load Checkpoint
- We require that you create a Simics checkpoint before loading Ruby or Opal. Booting Solaris, or your chosen operating system, is not tested and would take a long time. Unfortunately, do to licensing issues, Multifacet cannot release our checkpoint files. Creating checkpoints is not in the scope of this documentation however is covered in detail in Virtutech's documentation. In the example below, we load a checkpoint of a single-processor machine with Solaris booted.
simics> read-configuration ../../checkpoints-u3/golden-1p.check
Due to their immense size and legal restrictions, we do not release the actual checkpoint files. However, we have released limited support for checkpoint creation in the form of scripts. See the $GEMS/checkpoints directory for more information.
Configure Simics for Ruby/Opal
-
These steps are very important. Omitting these steps will result in incorrect execution with little warning. These commands instruct Simics to deliver all instruction fetches to Ruby/Opal, and disable the internal cache. Setting cpu-switch-time to 1 is optional but highly recommended for accurate simulations.
simics> instruction-fetch-mode instruction-fetch-trace simics> istc-disable simics> dstc-disable simics> cpu-switch-time 1
Load Ruby/Opal modules
At this point, Ruby can be loaded. Loading Opal is optional, and if omitted, will result in an in-order processor. Ruby and Opal automatically detect the presence of each other and cooperate accordingly.
-
simics> load-module ruby simics> load-module opal
Configure Ruby
The default options are specified in $GEMS/ruby/config/rubyconfig.defaults, however any of these can be overridden at runtime. Further, the number of processors must be specified at runtime as shown below.
-
simics> ruby0.setparam g_NUM_PROCESSORS 1
The default memory size, set in rubyconfig.defaults, is 4GB. This can also be set at runtime to match your checkpoint.
-
simics> ruby0.setparam g_MEMORY_SIZE_BYTES 4294967296
Initialize Ruby and Opal
After setting runtime options, Ruby and Opal must be initialized.
-
simics> ruby0.init simics> opal0.init
Opal also requires its output file be set
-
simics> opal0.sim-start "results.opal"
Start Simulation
If Opal has been loaded, Opal must start Simics.
-
simics> opal0.sim-step 10000000000
The argument to sim-step is merely a large number to run the simulation indefinitely until instructed otherwise.
If only Ruby has been loaded, we instruct Simics to start the simulation with the following command:
-
simics> c
Print Results
Press Control-C to interrupt the simulation
-
simics> ruby0.dump-stats simics> opal0.listparam simics> opal0.stats
Questions?
Please direct any Simics related questions to [https://www.simics.net/]
Please direct any GEMS related questions to the GEMS users mailing list. You can sign up for the mailing list here: [https://lists.cs.wisc.edu/mailman/listinfo/gems-users].
We also ask that you first search the mailing list to see if your question has already been answered. To search the mailing list please google the following: your-search-string site:https://lists.cs.wisc.edu/archive/gems-users/
Useful LogTM Links
[http://pages.cs.wisc.edu/~david/courses/cs758/Fall2007/handouts/hw-logtm.html]
[http://pages.cs.wisc.edu/~markhill/cs757/Spring2008/handouts/hw3.html]
[http://www.cs.wisc.edu/gems/doc/gems-wiki/moin.cgi/TM_Workload_Setup]