summaryrefslogtreecommitdiff
path: root/src/python/m5/params.py
AgeCommit message (Collapse)Author
2011-05-23config: reinstate implicit parenting on parameter assignmentSteve Reinhardt
Last summer's big rewrite of the initialization code (in particular cset 6efc3672733b) got rid of the implicit parenting that used to occur when an unparented SimObject was assigned as a parameter value to another SimObject. The idea was that the new adoptOrphanParams() step would catch these anyway so it was unnecessary. Unfortunately it turns out that adoptOrphanParams() has some inherent instability in that the parent that does the adoption depends on the config tree traversal order. Even making this order deterministic (e.g., by traversing children in alphabetical order) can introduce unwanted and unexpected hierarchy changes between similar configs (e.g., when adding a switch_cpu in place of a cpu), causing problems when trying to restore checkpoints across similar configs. The hierarchy created by implicit parenting is more stable and more controllable, so this patch turns that behavior back on. This patch also cleans up some long-standing holes regarding parenting of SimObjects that are created in class definitions (either in the body of the class, or as default parameters). To avoid breaking some existing config files, this necessitated changing the error on reparenting children to a warning. This change fixes another bug where attempting to print the prior error message would fail on reparenting SimObjectVectors because they lack a _parent attribute. Some further issues with SimObjectVectors were cleaned up by getting rid of the get_parent() call (which could cause errors with some SimObjectVectors where there was no single parent to return) with has_parent() (since all the uses of get_parent() were just boolean tests anyway). Finally, since the adoptOrphanParam() step turned out to be so problematic, we now issue a warning when it actually has to do an adoption. Future cleanup of config files will get rid of current warnings.
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-20Params: Fix a broken error message in verifyIp.Gabe Black
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-11Params: Fix an off by one error and a misleading comment.Gabe Black
2010-09-12swig: make all generated files go into the m5.internal packageNathan Binkert
This is necessary because versions of swig older than 1.3.39 fail to do the right thing and try to do relative imports for everything (even with the package= option to %module). Instead of putting params in the m5.internal.params package, put params in the m5.internal package and make all param modules start with param_. Same thing for m5.internal.enums. Also, stop importing all generated params into m5.objects. They are not necessary and now with everything using relative imports we wound up with pollution of the namespace (where builtin-range got overridden). --HG-- rename : src/python/m5/internal/enums/__init__.py => src/python/m5/internal/enums.py rename : src/python/m5/internal/params/__init__.py => src/python/m5/internal/params.py
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-09scons: use code_formatter wherever we can in the build systemNathan Binkert
2010-08-17misc: add some AMD copyright noticesSteve Reinhardt
Meant to add these with the previous batch of csets.
2010-08-17sim: clean up child handlingSteve Reinhardt
The old code for handling SimObject children was kind of messy, with children stored both in _values and _children, and inconsistent and potentially buggy handling of SimObject vectors. Now children are always stored in _children, and SimObject vectors are consistently handled using the SimObjectVector class. Also, by deferring the parenting of SimObject-valued parameters until the end (instead of doing it at assignment), we eliminate the hole where one could assign a vector of SimObjects to a parameter then append to that vector, with the appended objects never getting parented properly. This patch induces small stats changes in tests with data races due to changes in the object creation & initialization order. The new code does object vectors in order and so should be more stable.
2010-08-17sim: fail on implicit creation of orphans via portsSteve Reinhardt
Orphan SimObjects (not in the config hierarchy) could get created implicitly if they have a port connection to a SimObject that is in the hierarchy. This means that there are objects on the C++ SimObject list (created via the C++ SimObject constructor call) that are unknown to Python and will get skipped if we walk the hierarchy from the Python side (as we are about to do). This patch detects this situation and prints an error message. Also fix the rubytester config script which happened to rely on this behavior.
2009-09-22params: small cleanup to param description internalsNathan Binkert
2009-09-22python: Move more code into m5.util allow SCons to use that code.Nathan Binkert
Get rid of misc.py and just stick misc things in __init__.py Move utility functions out of SCons files and into m5.util Move utility type stuff from m5/__init__.py to m5/util/__init__.py Remove buildEnv from m5 and allow access only from m5.defines Rename AddToPath to addToPath while we're moving it to m5.util Rename read_command to readCommand while we're moving it Rename compare_versions to compareVersions while we're moving it. --HG-- rename : src/python/m5/convert.py => src/python/m5/util/convert.py rename : src/python/m5/smartdict.py => src/python/m5/util/smartdict.py
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-01-30Errors: Print a URL with a hash of the format string to find more ↵Ali Saidi
information about an error.
2008-09-29Make overriding port assignments in Python work,Steve Reinhardt
and print better error messages when it doesn't.
2008-06-15params: Prevent people from setting attributes on vector params.Nathan Binkert
2008-06-14params: Fix the memory bandwidth parameterNathan Binkert
2008-06-14params: Fix floating point parametersNathan Binkert
2008-06-12Params: Remove an unnecessary include.Gabe Black
2007-11-08Python: Allow a range to be a python tuple/list.Ali Saidi
--HG-- extra : convert_revision : 81cf805055e2f4d62e56a02ac82a0b230251f40b
2007-08-30python: Write configuration file without reassigning sys.stdout.Miles Kaufmann
Using print >>ini_file syntax instead of reassigning sys.stdout allows the python debugger to be used. --HG-- extra : convert_revision : 63fc268f2e80f338ad1a7abe54b9e979e2239609
2007-08-30python: Eliminate the Python use of eval() and frame manipulationMiles Kaufmann
--HG-- extra : convert_revision : 04520bcfab510580a1c7fb341afbd2487287d1ab
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
2007-05-11Float should have a c++ param typeNathan Binkert
--HG-- extra : convert_revision : 150bbe7f31aafb43a75195fc2a365fb3c0ec5673
2007-04-12Fix NextEthernetAddr.Nathan Binkert
unproxy() needs to return a new object otherwise all instances will use the same value. This fix is more or less unique to NextEthernetAddr because its use of the proxy stuff is a bit different than everything else. --HG-- extra : convert_revision : 2ce452e37d00b9ba76b6abfaec0ad2e0073920d7
2007-03-06Python parameters types need analogous C++ typesNathan Binkert
--HG-- extra : convert_revision : d068dfec69b28d48fc299a4108e165decfaaace7
2007-03-06Move all of the parameters of the Root SimObject so they areNathan Binkert
directly configured by python. Move stuff from root.(cc|hh) to core.(cc|hh) since it really belogs there now. In the process, simplify how ticks are used in the python code. --HG-- extra : convert_revision : cf82ee1ea20f9343924f30bacc2a38d4edee8df3
2007-03-02Factor code out of main.cc and main.i into a bunch of filesNathan Binkert
so things are organized in a more sensible manner. Take apart finalInit and expose the individual functions which are now called from python. Make checkpointing a bit easier to use. --HG-- extra : convert_revision : f470ddabbb47103e7b4734ef753c40089f2dcd9d
2007-01-25Instead of passing an int to represent time between python and C++Nathan Binkert
pass the tuple of python's struct_time and interpret that. Fixes a problem where the local timezone leaked into the time calculation. Also fix things so that the unix, python, and RTC data sheets all get the right time. Provide both years since 1900 and BCD two digit year. Put the date back at 1/1/2006 for now. --HG-- extra : convert_revision : 473244572f468de2cb579a3dd7ae296a6f81f5d7
2007-01-03Add 'Time' as a parameter type that can accept variousNathan Binkert
formats for time (strings, datetime objects, etc.) Advance system time to 1/1/2009 Clean up time management code a little bit --HG-- extra : convert_revision : 28ebecc7ea6b12f4345c77a9a6b4bdf2e752c4f8
2006-12-02Support better param conversions to/from numeric subclasses.Steve Reinhardt
--HG-- extra : convert_revision : 2ccb75b0912a384789458710fd9bbb65626f839e
2006-11-12Create a module called internal where swigged stuff goes.Nathan Binkert
Rename cc_main to internal.main --HG-- extra : convert_revision : e938005f600fbf8a43435e29426a948f4501f072
2006-11-09Get SPARC to the point that it starts running. Add ability to load the ROM ↵Ali Saidi
bin files, cleanup lockstep printing a bit Since we don't have a platform yet, you need to comment out the default responder stuff in Bus.py to make it work. SConstruct: Add TARGET_ISA to the list of environment variables that end up in the build_env for python configs/common/FSConfig.py: add a simple SPARC system to being testing with, you'll need to change makeLinuxAlphaSystem to makeSparcSystem in fs.py for now src/SConscript: add a raw file object, at least until we get more info about how to compile openboot properly src/arch/sparc/system.cc: src/arch/sparc/system.hh: add parameters for ROM files (OBP/Reset/Hypervisor), a ROM, load files into ROM src/base/loader/object_file.cc: src/base/loader/object_file.hh: add option to try raw when nothing works src/cpu/exetrace.cc: cleanup lockstep printing a little bit src/cpu/m5legion_interface.h: change the instruction to be 32 bits because it is src/mem/physical.cc: fix assert that doesn't work if memory starts somewhere above 0 src/python/m5/objects/BaseCPU.py: Add if statement to choose between sparc tlbs and alpha tlbs src/python/m5/objects/System.py: Add a sparc system that sets the rom addresses correctly src/python/m5/params.py: add the ability to add Addr() together --HG-- extra : convert_revision : bbbd8a56134f2dda2728091f740e2f7119b0c4af
2006-10-08Fixes for Port proxies and proxy parameters.Steve Reinhardt
--HG-- extra : convert_revision : 76b16fe2926611bd1c12c8ad7392355ad30a5138
2006-09-08Add support for assigning lists of ports or proxies to VectorPorts.Steve Reinhardt
Includes support for printing readable VectorPort and Proxy names (via __str__). --HG-- extra : convert_revision : c48534a498b3036fe6ac45ff1606656546c79afb
2006-09-05Enable proxies (Self/Parent) for specifying ports.Steve Reinhardt
Significant revamp of Port code. Some cleanup of SimObject code too, particularly to make the SimObject and MetaSimObject implementations of __setattr__ more consistent. Unproxy code split out of print_ini(). src/python/m5/multidict.py: Make get() return None by default, to match semantics of built-in dictionary objects. --HG-- extra : convert_revision : db73b6cdd004a82a08b2402afd1e16544cb902a4
2006-09-05Print ports in config.ini as well.Steve Reinhardt
--HG-- extra : convert_revision : 703d3a57250613315735709de8f40a9956cee6e2
2006-09-04More Python hacking to deal with config.py splitSteve Reinhardt
and resulting recursive import trickiness. --HG-- extra : convert_revision : 1ea93861eb8d260c9f3920dda0b8106db3e03705
2006-09-04Split config.py into multiple files.Steve Reinhardt
Some tweaking to deal with mutually recursive imports. --HG-- rename : src/python/m5/config.py => src/python/m5/SimObject.py extra : convert_revision : 166f7bfabfd20100e93d26a89382469465859988