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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user