QoSPolicy.py (12968:1c2b8dd9241f) QoSPolicy.py (13023:a379876f2244)
1# Copyright (c) 2018 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

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

76 master, int(priority))
77 else:
78 self.getCCObject().initMasterObj(
79 master.getCCObject(), priority)
80
81 # default fixed priority value for non-listed Masters
82 qos_fixed_prio_default_prio = Param.UInt8(0,
83 "Default priority for non-listed Masters")
1# Copyright (c) 2018 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

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

76 master, int(priority))
77 else:
78 self.getCCObject().initMasterObj(
79 master.getCCObject(), priority)
80
81 # default fixed priority value for non-listed Masters
82 qos_fixed_prio_default_prio = Param.UInt8(0,
83 "Default priority for non-listed Masters")
84
85class QoSPropFairPolicy(QoSPolicy):
86 type = 'QoSPropFairPolicy'
87 cxx_header = "mem/qos/policy_pf.hh"
88 cxx_class = 'QoS::PropFairPolicy'
89
90 cxx_exports = [
91 PyBindMethod('initMasterName'),
92 PyBindMethod('initMasterObj'),
93 ]
94
95 _mscores = None
96
97 def setInitialScore(self, master, score):
98 if not self._mscores:
99 self._mscores = []
100
101 self._mscores.append([master, score])
102
103 def init(self):
104 if not self._mscores:
105 print("Error, use setInitialScore to init masters/scores\n");
106 exit(1)
107 else:
108 for mprio in self._mscores:
109 master = mprio[0]
110 score = mprio[1]
111 if isinstance(master, basestring):
112 self.getCCObject().initMasterName(
113 master, float(score))
114 else:
115 self.getCCObject().initMasterObj(
116 master.getCCObject(), float(score))
117
118 weight = Param.Float(0.5, "Pf score weight")