summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-09-19 06:15:44 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-09-19 06:15:44 -0400
commitffb6aec603c38e16ae91ea975c16fc3e8fb337e5 (patch)
treefdf6e12bea9788f46589a9bcb15a8fe67581786f /src/python
parentc34df76272c17401955f6daf30ca9c7e7671ae56 (diff)
downloadgem5-ffb6aec603c38e16ae91ea975c16fc3e8fb337e5.tar.xz
AddrRange: Transition from Range<T> to AddrRange
This patch takes the final plunge and transitions from the templated Range class to the more specific AddrRange. In doing so it changes the obvious Range<Addr> to AddrRange, and also bumps the range_map to be AddrRangeMap. In addition to the obvious changes, including the removal of redundant includes, this patch also does some house keeping in preparing for the introduction of address interleaving support in the ranges. The Range class is also stripped of all the functionality that is never used. --HG-- rename : src/base/range.hh => src/base/addr_range.hh rename : src/base/range_map.hh => src/base/addr_range_map.hh
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/params.py12
-rw-r--r--src/python/swig/range.i7
2 files changed, 7 insertions, 12 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index 46c3d028c..cabb91b28 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -550,7 +550,7 @@ class Addr(CheckedInt):
return self.value + other
class AddrRange(ParamValue):
- cxx_type = 'Range<Addr>'
+ cxx_type = 'AddrRange'
def __init__(self, *args, **kwargs):
def handle_kwargs(self, kwargs):
@@ -594,20 +594,18 @@ class AddrRange(ParamValue):
@classmethod
def cxx_predecls(cls, code):
Addr.cxx_predecls(code)
- code('#include "base/range.hh"')
+ code('#include "base/addr_range.hh"')
@classmethod
def swig_predecls(cls, code):
Addr.swig_predecls(code)
- code('%import "python/swig/range.i"')
def getValue(self):
+ # Go from the Python class to the wrapped C++ class generated
+ # by swig
from m5.internal.range import AddrRange
- value = AddrRange()
- value.start = long(self.start)
- value.end = long(self.end)
- return value
+ return AddrRange(long(self.start), long(self.end))
# Boolean parameter type. Python doesn't let you subclass bool, since
# it doesn't want to let you create multiple instances of True and
diff --git a/src/python/swig/range.i b/src/python/swig/range.i
index d8da677bb..e3a794310 100644
--- a/src/python/swig/range.i
+++ b/src/python/swig/range.i
@@ -31,15 +31,12 @@
%module(package="m5.internal") range
%{
-#include "base/range.hh"
#include "base/types.hh"
+#include "base/addr_range.hh"
%}
%include <stdint.i>
%rename(assign) *::operator=;
-%include "base/range.hh"
%include "base/types.hh"
-
-%template(AddrRange) Range<Addr>;
-%template(TickRange) Range<Tick>;
+%include "base/addr_range.hh"