params.py (14052:8e23338327aa) params.py (14059:82b702b877df)
1# Copyright (c) 2012-2014, 2017-2019 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

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

752 val = long(value)
753 return "0x%x" % long(val)
754
755class AddrRange(ParamValue):
756 cxx_type = 'AddrRange'
757
758 def __init__(self, *args, **kwargs):
759 # Disable interleaving and hashing by default
1# Copyright (c) 2012-2014, 2017-2019 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

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

752 val = long(value)
753 return "0x%x" % long(val)
754
755class AddrRange(ParamValue):
756 cxx_type = 'AddrRange'
757
758 def __init__(self, *args, **kwargs):
759 # Disable interleaving and hashing by default
760 self.intlvHighBit = 0
761 self.xorHighBit = 0
762 self.intlvBits = 0
763 self.intlvMatch = 0
764 self.masks = []
765
766 def handle_kwargs(self, kwargs):
767 # An address range needs to have an upper limit, specified
768 # either explicitly with an end, or as an offset using the
769 # size keyword.

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

777 # Now on to the optional bit
778 if 'intlvMatch' in kwargs:
779 self.intlvMatch = int(kwargs.pop('intlvMatch'))
780
781 if 'masks' in kwargs:
782 self.masks = [ long(x) for x in list(kwargs.pop('masks')) ]
783 self.intlvBits = len(self.masks)
784 else:
760 self.intlvBits = 0
761 self.intlvMatch = 0
762 self.masks = []
763
764 def handle_kwargs(self, kwargs):
765 # An address range needs to have an upper limit, specified
766 # either explicitly with an end, or as an offset using the
767 # size keyword.

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

775 # Now on to the optional bit
776 if 'intlvMatch' in kwargs:
777 self.intlvMatch = int(kwargs.pop('intlvMatch'))
778
779 if 'masks' in kwargs:
780 self.masks = [ long(x) for x in list(kwargs.pop('masks')) ]
781 self.intlvBits = len(self.masks)
782 else:
785 if 'intlvHighBit' in kwargs:
786 intlv_high_bit = int(kwargs.pop('intlvHighBit'))
787 if 'xorHighBit' in kwargs:
788 xor_high_bit = int(kwargs.pop('xorHighBit'))
789 if 'intlvBits' in kwargs:
790 self.intlvBits = int(kwargs.pop('intlvBits'))
791 self.masks = [0] * self.intlvBits
783 if 'intlvBits' in kwargs:
784 self.intlvBits = int(kwargs.pop('intlvBits'))
785 self.masks = [0] * self.intlvBits
792 for i in range(0, self.intlvBits):
793 bit1 = intlv_high_bit - i
794 mask = 1 << bit1
795 if xor_high_bit != 0:
796 bit2 = xor_high_bit - i
797 mask |= 1 << bit2
798 self.masks[self.intlvBits - i - 1] = mask
786 if 'intlvHighBit' not in kwargs:
787 raise TypeError("No interleave bits specified")
788 intlv_high_bit = int(kwargs.pop('intlvHighBit'))
789 xor_high_bit = 0
790 if 'xorHighBit' in kwargs:
791 xor_high_bit = int(kwargs.pop('xorHighBit'))
792 for i in range(0, self.intlvBits):
793 bit1 = intlv_high_bit - i
794 mask = 1 << bit1
795 if xor_high_bit != 0:
796 bit2 = xor_high_bit - i
797 mask |= 1 << bit2
798 self.masks[self.intlvBits - i - 1] = mask
799
800 if len(args) == 0:
801 self.start = Addr(kwargs.pop('start'))
802 handle_kwargs(self, kwargs)
803
804 elif len(args) == 1:
805 if kwargs:
806 self.start = Addr(args[0])

--- 1387 unchanged lines hidden ---
799
800 if len(args) == 0:
801 self.start = Addr(kwargs.pop('start'))
802 handle_kwargs(self, kwargs)
803
804 elif len(args) == 1:
805 if kwargs:
806 self.start = Addr(args[0])

--- 1387 unchanged lines hidden ---