Deleted Added
sdiff udiff text old ( 9232:3bb99fab80d4 ) new ( 9235:5aa4896ed55a )
full compact
1# Copyright (c) 2012 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license

--- 536 unchanged lines hidden (view full) ---

545 self._check()
546 def __add__(self, other):
547 if isinstance(other, Addr):
548 return self.value + other.value
549 else:
550 return self.value + other
551
552class AddrRange(ParamValue):
553 cxx_type = 'Range<Addr>'
554
555 def __init__(self, *args, **kwargs):
556 def handle_kwargs(self, kwargs):
557 if 'end' in kwargs:
558 self.end = Addr(kwargs.pop('end'))
559 elif 'size' in kwargs:
560 self.end = self.start + Addr(kwargs.pop('size')) - 1
561 else:

--- 27 unchanged lines hidden (view full) ---

589 return '%s:%s' % (self.start, self.end)
590
591 def size(self):
592 return long(self.end) - long(self.start) + 1
593
594 @classmethod
595 def cxx_predecls(cls, code):
596 Addr.cxx_predecls(code)
597 code('#include "base/range.hh"')
598
599 @classmethod
600 def swig_predecls(cls, code):
601 Addr.swig_predecls(code)
602 code('%import "python/swig/range.i"')
603
604 def getValue(self):
605 from m5.internal.range import AddrRange
606
607 value = AddrRange()
608 value.start = long(self.start)
609 value.end = long(self.end)
610 return value
611
612# Boolean parameter type. Python doesn't let you subclass bool, since
613# it doesn't want to let you create multiple instances of True and
614# False. Thus this is a little more complicated than String.
615class Bool(ParamValue):
616 cxx_type = 'bool'
617 def __init__(self, value):
618 try:

--- 1013 unchanged lines hidden ---