summaryrefslogtreecommitdiff
path: root/src/python/swig
AgeCommit message (Collapse)Author
2011-10-31GCC: Get everything working with gcc 4.6.1.Gabe Black
And by "everything" I mean all the quick regressions.
2011-10-20SimObject: add export_method* hooks to export C++ methods to PythonSteve Reinhardt
Replace the (broken as of previous changeset) swig_objdecl() method that allowed/forced you to substitute a whole new C++ struct definition for SWIG to wrap with a set of export_method* hooks that let you just declare a set of C++ methods (or other declarations) that get inserted in the auto-generated struct. Restore the System get/setMemoryMode methods, and use this mechanism to specialize SimObject as well, eliminating teh need for sim_object.i. Needed bits of sim_object.i are moved to the new pyobject.i. Also sucked a little SimObject specialization into cxx_param_decl() allowing us to get rid of src/sim/sim_object_params.hh. Now the generation and wrapping of the base SimObject param struct is more in line with how derived objects are handled. --HG-- rename : src/python/swig/sim_object.i => src/python/swig/pyobject.i
2011-08-19Stats: Add a sparse histogram stat object.Thomas Grass
2011-05-12stats: delete mysql supportNathan Binkert
we can add it back within python in some future changeset
2011-05-12stats: move code that loops over all stats into pythonNathan Binkert
2011-05-12stats: better expose statistics to python.Nathan Binkert
Build a python list and dict of all stats and expose flags properly. --HG-- rename : src/python/m5/stats.py => src/python/m5/stats/__init__.py
2011-04-28event: fix PythonEventNathan Binkert
order of %includes since they matter for this case
2011-04-15trace: reimplement the DTRACE function so it doesn't use a vectorNathan Binkert
At the same time, rename the trace flags to debug flags since they have broader usage than simply tracing. This means that --trace-flags is now --debug-flags and --trace-help is now --debug-help
2011-04-15includes: sort all includesNathan Binkert
2011-03-18swig: get rid of m5.internal.random module (swig/random.i)Steve Reinhardt
Thanks to swig this was interfering with the standard Python random module. The only function in that module was seed(), which erroneously called srand48(). Moved the function to m5.internal.core, renamed it seedRandom(), and made it call random_mt.init() instead.
2011-01-07Replace curTick global variable with accessor functions.Steve Reinhardt
This step makes it easy to replace the accessor functions (which still access a global variable) with ones that access per-thread curTick values.
2011-01-07stats: rename StatEvent() function to schedStatEvent().Steve Reinhardt
This follows the style rules and is more descriptive.
2011-01-03Make commenting on close namespace brackets consistent.Steve Reinhardt
Ran all the source files through 'perl -pi' with this script: s|\s*(};?\s*)?/\*\s*(end\s*)?namespace\s*(\S+)\s*\*/(\s*})?|} // namespace $3|; s|\s*};?\s*//\s*(end\s*)?namespace\s*(\S+)\s*|} // namespace $2\n|; s|\s*};?\s*//\s*(\S+)\s*namespace\s*|} // namespace $1\n|; Also did a little manual editing on some of the arch/*/isa_traits.hh files and src/SConscript.
2010-12-30swig: use <> for system %includes instead of ""Nathan Binkert
2010-11-23Copyright: Add AMD copyright to the param changes I just made.Gabe Black
2010-11-23Params: Add parameter types for IP addresses in various forms.Gabe Black
New parameter forms are: IP address in the format "a.b.c.d" where a-d are from decimal 0 to 255. IP address with netmask which is an IP followed by "/n" where n is a netmask length in bits from decimal 0 to 32 or by "/e.f.g.h" where e-h are from decimal 0 to 255 and which is all 1 bits followed by all 0 bits when represented in binary. These can also be specified as an integral IP and netmask passed in separately. IP address with port which is an IP followed by ":p" where p is a port index from decimal 0 to 65535. These can also be specified as an integral IP and port value passed in separately.
2010-11-19SCons: Support building without an ISAAli Saidi
2010-09-09scons: Stop building the big monolithic swigged params moduleNathan Binkert
kill params.i and create a separate .i for each object (param, enums, etc.)
2010-09-09swig: don't override SWIG_name anymoreNathan Binkert
It doesn't appear to be necessary and it is somewhat odd. I'm pretty sure that the package parameter to %module does whatever this might have been before. It's necessary in future revisions anyway.
2010-08-17sim: revamp unserialization procedureSteve Reinhardt
Replace direct call to unserialize() on each SimObject with a pair of calls for better control over initialization in both ckpt and non-ckpt cases. If restoring from a checkpoint, loadState(ckpt) is called on each SimObject. The default implementation simply calls unserialize() if there is a corresponding checkpoint section, so we get backward compatibility for existing objects. However, objects can override loadState() to get other behaviors, e.g., doing other programmed initializations after unserialize(), or complaining if no checkpoint section is found. (Note that the default warning for a missing checkpoint section is now gone.) If not restoring from a checkpoint, we call the new initState() method on each SimObject instead. This provides a hook for state initializations that are only required when *not* restoring from a checkpoint. Given this new framework, do some cleanup of LiveProcess subclasses and X86System, which were (in some cases) emulating initState() behavior in startup via a local flag or (in other cases) erroneously doing initializations in startup() that clobbered state loaded earlier by unserialize().
2010-08-17sim: move iterating over SimObjects into Python.Steve Reinhardt
2010-07-05sim: fold StartupCallback into SimObjectSteve Reinhardt
There used to be a reason to have StartupCallback be a separate object, but not any more. Now it's just confusing.
2009-06-01swig: %include Event before PythonEvent so python gets the subclass correct.Nathan Binkert
Before this change, some versions of swig would cause PythonEvent to be derived from object instead of Event
2009-05-17includes: sort includes againNathan Binkert
2009-05-17types: Move stuff for global types into src/base/types.hhNathan Binkert
--HG-- rename : src/sim/host.hh => src/base/types.hh
2009-04-22stats: expose statistics to pythonNathan Binkert
2009-04-22stats: remove simplescalar compatibility for printingNathan Binkert
2009-03-05stats: create an enable phase, and a prepare phase.Nathan Binkert
Enable more or less takes the place of check, but also allows stats to do some other configuration. Prepare moves all of the code that readies a stat for dumping into a separate function in preparation for supporting serialization of certain pieces of statistics data. While we're at it, clean up the visitor code and some of the python code.
2009-01-19python: Rework how things are importedNathan Binkert
2008-11-10python: Fix the reference counting for python events placed on the eventq.Nathan Binkert
We need to add a reference when an object is put on the C++ queue, and remove a reference when the object is removed from the queue. This was not happening before and caused a memory problem.
2008-10-27Checkpointing: createCountedDrain function, it was only returning an Event, ↵Clint Smullen
which does not expose a setCount method to Python. Signed-off By: Ali Saidi
2008-10-10output: Make panic/fatal/warn more flexible so we can add some new ones.Nathan Binkert
The major thrust of this change is to limit the amount of code duplication surrounding the code for these functions. This code also adds two new message types called info and hack. Info is meant to be less harsh than warn so people don't get confused and start thinking that the simulator is broken. Hack is a way for people to add runtime messages indicating that the simulator just executed a code "hack" that should probably be fixed. The benefit of knowing about these code hacks is that it will let people know what sorts of inaccuracies or potential bugs might be entering their experiments. Finally, I've added some flags to turn on and off these message types so command line options can change them.
2008-10-09eventq: Major API change for the Event and EventQueue structures.Nathan Binkert
Since the early days of M5, an event needed to know which event queue it was on, and that data was required at the time of construction of the event object. In the future parallelized M5, this sort of requirement does not work well since the proper event queue will not always be known at the time of construction of an event. Now, events are created, and the EventQueue itself has the schedule function, e.g. eventq->schedule(event, when). To simplify the syntax, I created a class called EventManager which holds a pointer to an EventQueue and provides the schedule interface that is a proxy for the EventQueue. The intent is that objects that frequently schedule events can be derived from EventManager and then they have the schedule interface. SimObject and Port are examples of objects that will become EventManagers. The end result is that any SimObject can just call schedule(event, when) and it will just call that SimObject's eventq->schedule function. Of course, some objects may have more than one EventQueue, so this interface might not be perfect for those, but they should be relatively few.
2008-08-04Get rid of outputStream... wasn't really being usedSteve Reinhardt
(except for warn()) and new -r/-e options make it not worth fixing.
2008-08-03sockets: Add a function to disable all listening sockets.Nathan Binkert
When invoking several copies of m5 on the same machine at the same time, there can be a race for TCP ports for the terminal connections or remote gdb. Expose a function to disable those ports, and have the regression scripts disable them. There are some SimObjects that have no other function than to be used with ports (NativeTrace and EtherTap), so they will panic if the ports are disabled.
2008-08-03libm5: Create a libm5 static library for embedding m5.Nathan Binkert
This should allow m5 to be more easily embedded into other simulators. The m5 binary adds a simple main function which then calls into the m5 libarary to start the simulation. In order to make this work correctly, it was necessary embed python code directly into the library instead of the zipfile hack. This is because you can't just append the zipfile to the end of a library the way you can a binary. As a result, Python files that are part of the m5 simulator are now compile, marshalled, compressed, and then inserted into the library's data section with a certain symbol name. Additionally, a new Importer was needed to allow python to get at the embedded python code. Small additional changes include: - Get rid of the PYTHONHOME stuff since I don't think anyone ever used it, and it just confuses things. Easy enough to add back if I'm wrong. - Create a few new functions that are key to initializing and running the simulator: initSignals, initM5Python, m5Main. The original code for creating libm5 was inspired by a patch Michael Adler, though the code here was done by me.
2008-07-23RemoteGDB: add an m5 command line option for setting or disabling remote gdb.Michael Adler
2008-06-24Automated merge with http://repo.m5sim.org/m5-stableAli Saidi
2008-06-24Checkpoinging/SWIG: Undo part of changeset 5464 since it broke checkpointing.Ali Saidi
2008-06-15add compile flags to m5Nathan Binkert
2008-06-14Fix various SWIG warningsNathan Binkert
2008-06-13HG: Add compiled hg revision and date to the standard M5 output.Ali Saidi
2007-10-31String constant const-ness changes to placate g++ 4.2.Steve Reinhardt
Also some bug fixes in MIPS ISA uncovered by g++ warnings (Python string compares don't work in C++!). --HG-- extra : convert_revision : b347cc0108f23890e9b73b3ee96059f0cea96cf6
2007-09-04Serialization: Fix unserialization of object pointersAli Saidi
--HG-- extra : convert_revision : a5aed880b2fc05841067e8597a58a9484e30b84a
2007-09-04Config: Remove some ini file code that no longer worksAli Saidi
--HG-- extra : convert_revision : cb01dc0abeabc97b03d7af10959d92ceb62ea936
2007-08-30params: Deprecate old-style constructors; update most SimObject constructors.Miles Kaufmann
SimObjects not yet updated: - Process and subclasses - BaseCPU and subclasses The SimObject(const std::string &name) constructor was removed. Subclasses that still rely on that behavior must call the parent initializer as : SimObject(makeParams(name)) --HG-- extra : convert_revision : d6faddde76e7c3361ebdbd0a7b372a40941c12ed
2007-08-17Ports: Only try to do EthPort stuff in full system.Ali Saidi
--HG-- extra : convert_revision : 9ea093ea7c9ab22f8467c5cd5d55b66c71eb3427
2007-08-16Devices: Make EtherInts connect in the same way memory ports currently do.Ali Saidi
--HG-- extra : convert_revision : 765b096785a77df9adc4791c9101b90696bd7be2
2007-08-02python: Improve support for python calling back to C++ member functions.Nathan Binkert
Add support for declaring SimObjects to swig so their members can be wrapped. Make sim_object.i only contain declarations for SimObject. Create system.i to contain declarations for System. Update python code to properly call the C++ given the new changes. --HG-- extra : convert_revision : 82076ee69e8122d56e91b92d6767e356baae420a
2007-07-23Major changes to how SimObjects are created and initialized. Almost allNathan Binkert
creation and initialization now happens in python. Parameter objects are generated and initialized by python. The .ini file is now solely for debugging purposes and is not used in construction of the objects in any way. --HG-- extra : convert_revision : 7e722873e417cb3d696f2e34c35ff488b7bff4ed