History log of /gem5/src/python/m5/util/__init__.py
Revision Date Author Comments
# 13714:35636064b7a1 25-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Enforce absolute imports for Python 3 compatibility

Change-Id: Ia88d7fd472f7aed9b97df81468211384981bf6c6
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15983
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 13672:2969e4d5abf4 12-Feb-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Replace orderdict with collections.OrderedDict

Python 2.7 and newer has support for ordered dictionaries in the
standard library. Remove this custom class.

Change-Id: I4b720405aa3c4ce8d5c0b401eefe744a85ac3a3e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/16362
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>


# 13663:9b64aeabf9a5 25-Jan-2019 Andreas Sandberg <andreas.sandberg@arm.com>

python: Make exception handling Python 3 safe

Change-Id: I9c2cdfad20deb1ddfa224320cf93f2105d126652
Reviewed-on: https://gem5-review.googlesource.com/c/15980
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>


# 12563:8d59ed22ae79 06-Mar-2018 Gabe Black <gabeblack@google.com>

scons: Switch from the print statement to the print function.

Starting with version 3, scons imposes using the print function instead
of the print statement in code it processes. To get things building
again, this change moves all python code within gem5 to use the
function version. Another change by another author separately made this
same change to the site_tools and site_init.py files.

Change-Id: I2de7dc3b1be756baad6f60574c47c8b7e80ea3b0
Reviewed-on: https://gem5-review.googlesource.com/8761
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>


# 11923:d2f0605ac2af 28-Nov-2016 Andreas Sandberg <andreas.sandberg@arm.com>

python: Automatically disable listeners in batch setups

Determine if gem5 is running in a batch environment by checking if
STDIN is wired to a TTY or not. If the simulator is running in a batch
environment, disable all listeners by default. This behavior can be
overridden using the --enable-listeners option.

Change-Id: I404c709135339144216bf08a2769c016c543333c
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Sean McGoogan <sean.mcgoogan@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/2322
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>


# 11403:e8949ea6961f 30-Mar-2016 Andreas Sandberg <andreas.sandberg@arm.com>

style: Refactor the style checker as a Python package

Refactor the style checker into a Python module that can be reused by
command line tools that integrate with git. In particular:

* Create a style package in util
* Move style validators from style.py to the style/validators.py.
* Move style verifiers from style.py to the style/verifiers.py.
* Move utility functions (sort_includes, region handling,
file_types) into the style package
* Move generic code from style.py to style/style.py.

Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>


# 11320:42ecb523c64a 06-Feb-2016 Steve Reinhardt <steve.reinhardt@amd.com>

style: remove trailing whitespace

Result of running 'hg m5style --skip-all --fix-white -a'.


# 9528:d05714c2ab9c 15-Feb-2013 Sascha Bischoff <sascha.bischoff@arm.com>

base: Add warn() and inform() to m5.utils for use from python

This patch adds two fuctions to m5.util, warn and inform, which mirror those
found in the C++ side of gem5. These are added in addition to the already
existing m5.util.panic and m5.util.fatal which already mirror the C++
functionality. This ensures that warning and information messages generated
by python are in the same format as those generated by C++.

Occurrences of
print "Warning: %s..." % name
have been replaced with
warn("%s...", name)


# 8453:82fc1267d3bb 05-Jul-2011 Nathan Binkert <nate@binkert.org>

slicc: cleanup slicc code and make it less verbose


# 8328:03cfd2ecf6bb 30-May-2011 Gabe Black <gblack@eecs.umich.edu>

Misc: Remove the URL from warnings, fatals, panics, etc.


# 8224:75527411e636 15-Apr-2011 Nathan Binkert <nate@binkert.org>

region: add a utility class for keeping track of regions of some range

This is basically like the range_map stuff in src/base (range already
exists in Python). This code is like a set of ranges. I'm using it
to keep track of changed lines in source code, but it could be use to
keep track of memory ranges and holes in memory regions. It could
also be used in memory allocation type stuff. (Though it's not at all
optimized.)


# 7503:37da2c208f5f 21-Jul-2010 Nathan Binkert <nate@binkert.org>

python: add a sorted dictionary class
It would be nice if python had a tree class that would do this for real,
but since we don't, we'll just keep a sorted list of keys and update
it on demand.


# 7459:da32c2b05648 15-Jun-2010 Nathan Binkert <nate@binkert.org>

util: clean up attrdict and import multiattrdict into m5.util


# 6654:4c84e771cca7 22-Sep-2009 Nathan Binkert <nate@binkert.org>

python: Move more code into m5.util allow SCons to use that code.
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.


# 6502:6c7d9e9b3c83 16-Aug-2009 Nathan Binkert <nate@binkert.org>

code_formatter: Add a python class for writing code generator templates


# 6500:ee7587e7c71d 16-Aug-2009 Nathan Binkert <nate@binkert.org>

orderdict: Use DictMixin and add orderdict to m5.util


# 5873:67a6ea624776 15-Feb-2009 Nathan Binkert <nate@binkert.org>

traceflags: fix --trace-help


# 5467:6d9df90d70d7 14-Jun-2008 Nathan Binkert <nate@binkert.org>

python: Move various utility classes into a new m5.util package so
they're all in the same place. This also involves having just one
jobfile.py and moving it into the utils directory to avoid
duplication. Lots of improvements to the utility as well.