From ffb6aec603c38e16ae91ea975c16fc3e8fb337e5 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 19 Sep 2012 06:15:44 -0400 Subject: AddrRange: Transition from Range 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 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 --- src/python/m5/params.py | 12 +++++------- src/python/swig/range.i | 7 ++----- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/python') 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' + 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 %rename(assign) *::operator=; -%include "base/range.hh" %include "base/types.hh" - -%template(AddrRange) Range; -%template(TickRange) Range; +%include "base/addr_range.hh" -- cgit v1.2.3