gem5/util
Andrew Bardsley 83f7e7afaf sim: SystemC hosting
This patch hosts gem5 onto SystemC scheduler. There's already an upstream
review board patch that does something similar but this patch ...:

 1) is less obtrusive to the existing gem5 code organisation. It's divided
 into the 'generic' preparatory patches (already submitted) and this patch
 which affects no existing files

 2) does not try to exactly track the gem5 event queue with notifys into
 SystemC and so doesn't requive the event queue to be modified for
 anything other than 'out of event queue' scheduling events

 3) supports debug logging with SC_REPORT

The patch consists of the files:
    util/systemc/
        sc_gem5_control.{cc,hh} -- top level objects to use to
                                   instantiate gem5 Systems within
                                   larger SystemC test harnesses as
                                   sc_module objects
        sc_logger.{cc,hh}       -- logging support
        sc_module.{cc,hh}       -- a separated event loop specific to
                                   SystemC
        stats.{cc,hh}           -- example Stats handling for the sample
                                   top level
        main.{cc,hh}            -- a sample top level

On the downside this patch is only currently functional with C++
configuration at the top level.

The above sc_... files are indended to be compiled alongside gem5 (as a
library, see main.cc for a command line and util/systemc/README for
more details.)

The top-level system instantiation in sc_gem5_control.{cc,hh} provides
two classes: Gem5Control and Gem5System

Gem5Control is a simulation control class (from which a singleton
object should be created) derived from Gem5SystemC::Module which
carries the top level simulation control interface for gem5.  This
includes hosting a system-building configuration file and
instantiating the Root object from that file.

Gem5System is a base class for instantiating renamed gem5 Systems
from the config file hosted by the Gem5Control object.  In use, a
SystemC module class should be made which represents the desired,
instantiable gem5 System.  That class's instances should create
a Gem5System during their construction, set the parameters of that
system and then call instantiate to build that system.  If this
is all carried out in the sc_core::sc_module-derived classes
constructor, the System's external ports will become children of
that module and can then be recovered by name using sc_core::
sc_find_object.

It is intended that this interface is used with dlopen.  To that
end, the header file sc_gem5_control.hh includes no other header
files from gem5 (and so can be easily copied into another project).
The classes Gem5System and Gem5Control have all their member
functions declared `virtual' so that those functions can be called
through the vtable acquired by building the top level Gem5Control
using dlsym(..., "makeGem5Control") and `makeSystem' on the
Gem5Control.
2014-10-16 05:49:54 -04:00
..
batch python: Move various utility classes into a new m5.util package so 2008-06-14 20:19:49 -07:00
ccdrv includes: sort all includes 2011-04-15 10:44:06 -07:00
cxx_config config: Add the ability to read a config file using C++ and Python 2014-10-16 05:49:37 -04:00
emacs Make the M5 Emacs C style default to inserting spaces instead 2006-01-30 14:32:00 -05:00
m5 arm: Add Makefile for aarch64 build of util/m5 2014-05-09 18:58:46 -04:00
minorview cpu: `Minor' in-order CPU model 2014-07-23 16:09:04 -05:00
pbs python: Move various utility classes into a new m5.util package so 2008-06-14 20:19:49 -07:00
statetrace ARM: Add vfpv3 support to native trace. 2011-05-04 20:38:26 -05:00
stats stats: fix usage of jobfile 2009-07-02 16:48:21 -07:00
streamline config: Update Streamline scripts and configs 2014-09-03 07:43:02 -04:00
systemc sim: SystemC hosting 2014-10-16 05:49:54 -04:00
tap includes: sort all includes 2011-04-15 10:44:06 -07:00
term includes: sort all includes 2011-04-15 10:44:06 -07:00
checkpoint-tester.py util: add a script for testing checkpointing 2010-07-05 21:39:38 -07:00
checkpoint_aggregator.py util: update checkpoint aggregation script 2013-12-03 10:36:03 -06:00
checktrace.sh Add checktrace.sh. Checks all the ethertrace files in */ethertrace 2005-11-11 18:43:09 -05:00
chkformat Utilities for doing a format check for some elements of proper 2006-12-17 18:58:05 -08:00
compile Nate's utility for compiling m5 2006-12-17 18:58:50 -08:00
cpt_upgrader.py util: Add DVFS perfLevel to checkpoint upgrade script 2014-07-01 11:58:22 -04:00
cscope-index.py cscope-find.py: 2006-11-29 13:17:41 -08:00
decode_packet_trace.py util: Move packet trace file read to protolib 2014-08-10 05:39:20 -04:00
diff_config.pl Util: Added script to semantically diff two config.ini files 2012-09-25 11:49:40 -05:00
dram_sweep_plot.py mem: Add utility script to plot DRAM efficiency sweep 2014-09-03 07:42:29 -04:00
drampower_trace.py mem: DRAMPower trace formatting script 2014-06-30 13:56:04 -04:00
encode_packet_trace.py mem: Edit proto Packet and enhance the python script 2014-03-07 15:56:23 -05:00
file_types.py file_types: Make code work in Python 2.4 2011-04-17 13:57:03 -07:00
find_copyrights.py copyright: Add code for finding all copyright blocks and create a COPYING file 2011-06-02 17:36:07 -07:00
fixwhite Utilities for doing a format check for some elements of proper 2006-12-17 18:58:05 -08:00
gem5img.py Util: Replace mkblankimage.sh with the new gem5img.py. 2011-04-29 04:46:19 -04:00
hgfilesize.py hgfilesize: skip files that have been removed 2012-01-10 22:50:54 -08:00
minorview.py cpu: `Minor' in-order CPU model 2014-07-23 16:09:04 -05:00
o3-pipeview.py o3: fix tick used for renaming and issue with range selection 2013-02-15 17:40:09 -05:00
on-chip-network-power-area.py util: adds a script for using DSENT 2014-10-11 16:16:00 -05:00
oprofile-top.py Updated Authors from bk prs info 2006-05-31 19:26:56 -04:00
protolib.py util: Move packet trace file read to protolib 2014-08-10 05:39:20 -04:00
qdo Make qdo work with oar. I don't know if this catches every case, but it appears 2007-10-10 23:24:16 -04:00
regress ruby: rename MESI_CMP_directory to MESI_Two_Level 2014-01-04 00:03:33 -06:00
rundiff rundiff: Don't flush stdout until after postcontext is printed. 2009-09-26 10:50:50 -07:00
SConscript Major changes to how SimObjects are created and initialized. Almost all 2007-07-23 21:51:38 -07:00
slicc slicc: Pure python implementation of slicc. 2009-09-22 18:12:39 -07:00
sort_includes.py util: Fix state leakage in the SortIncludes style verifier 2014-08-13 06:57:25 -04:00
style.py style: Add support for a style ignore list and ignore ext/ 2014-08-26 10:14:30 -04:00
tracediff tracediff: Check for --debug-flags now instead of --trace-flags. 2011-07-02 22:52:26 -07:00
valgrind-suppressions util: Valgrind suppression addition 2014-04-23 05:18:29 -04:00