params.py (10668:cefb03a42760) params.py (10676:f6c168692b20)
1# Copyright (c) 2012-2014 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

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

721 except TypeError:
722 val = long(value)
723 return "0x%x" % long(val)
724
725class AddrRange(ParamValue):
726 cxx_type = 'AddrRange'
727
728 def __init__(self, *args, **kwargs):
1# Copyright (c) 2012-2014 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

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

721 except TypeError:
722 val = long(value)
723 return "0x%x" % long(val)
724
725class AddrRange(ParamValue):
726 cxx_type = 'AddrRange'
727
728 def __init__(self, *args, **kwargs):
729 # Disable interleaving by default
729 # Disable interleaving and hashing by default
730 self.intlvHighBit = 0
730 self.intlvHighBit = 0
731 self.xorHighBit = 0
731 self.intlvBits = 0
732 self.intlvMatch = 0
733
734 def handle_kwargs(self, kwargs):
735 # An address range needs to have an upper limit, specified
736 # either explicitly with an end, or as an offset using the
737 # size keyword.
738 if 'end' in kwargs:
739 self.end = Addr(kwargs.pop('end'))
740 elif 'size' in kwargs:
741 self.end = self.start + Addr(kwargs.pop('size')) - 1
742 else:
743 raise TypeError, "Either end or size must be specified"
744
745 # Now on to the optional bit
746 if 'intlvHighBit' in kwargs:
747 self.intlvHighBit = int(kwargs.pop('intlvHighBit'))
732 self.intlvBits = 0
733 self.intlvMatch = 0
734
735 def handle_kwargs(self, kwargs):
736 # An address range needs to have an upper limit, specified
737 # either explicitly with an end, or as an offset using the
738 # size keyword.
739 if 'end' in kwargs:
740 self.end = Addr(kwargs.pop('end'))
741 elif 'size' in kwargs:
742 self.end = self.start + Addr(kwargs.pop('size')) - 1
743 else:
744 raise TypeError, "Either end or size must be specified"
745
746 # Now on to the optional bit
747 if 'intlvHighBit' in kwargs:
748 self.intlvHighBit = int(kwargs.pop('intlvHighBit'))
749 if 'xorHighBit' in kwargs:
750 self.xorHighBit = int(kwargs.pop('xorHighBit'))
748 if 'intlvBits' in kwargs:
749 self.intlvBits = int(kwargs.pop('intlvBits'))
750 if 'intlvMatch' in kwargs:
751 self.intlvMatch = int(kwargs.pop('intlvMatch'))
752
753 if len(args) == 0:
754 self.start = Addr(kwargs.pop('start'))
755 handle_kwargs(self, kwargs)

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

809 code('${ret} _ret;')
810
811 def getValue(self):
812 # Go from the Python class to the wrapped C++ class generated
813 # by swig
814 from m5.internal.range import AddrRange
815
816 return AddrRange(long(self.start), long(self.end),
751 if 'intlvBits' in kwargs:
752 self.intlvBits = int(kwargs.pop('intlvBits'))
753 if 'intlvMatch' in kwargs:
754 self.intlvMatch = int(kwargs.pop('intlvMatch'))
755
756 if len(args) == 0:
757 self.start = Addr(kwargs.pop('start'))
758 handle_kwargs(self, kwargs)

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

812 code('${ret} _ret;')
813
814 def getValue(self):
815 # Go from the Python class to the wrapped C++ class generated
816 # by swig
817 from m5.internal.range import AddrRange
818
819 return AddrRange(long(self.start), long(self.end),
817 int(self.intlvHighBit), int(self.intlvBits),
818 int(self.intlvMatch))
820 int(self.intlvHighBit), int(self.xorHighBit),
821 int(self.intlvBits), int(self.intlvMatch))
819
820# Boolean parameter type. Python doesn't let you subclass bool, since
821# it doesn't want to let you create multiple instances of True and
822# False. Thus this is a little more complicated than String.
823class Bool(ParamValue):
824 cxx_type = 'bool'
825 cmd_line_settable = True
826

--- 1285 unchanged lines hidden ---
822
823# Boolean parameter type. Python doesn't let you subclass bool, since
824# it doesn't want to let you create multiple instances of True and
825# False. Thus this is a little more complicated than String.
826class Bool(ParamValue):
827 cxx_type = 'bool'
828 cmd_line_settable = True
829

--- 1285 unchanged lines hidden ---