QoSMemCtrl.py revision 12966
112SN/A# Copyright (c) 2018 ARM Limited 21762SN/A# All rights reserved. 312SN/A# 412SN/A# The license below extends only to copyright in the software and shall 512SN/A# not be construed as granting a license to any other intellectual 612SN/A# property including but not limited to intellectual property relating 712SN/A# to a hardware implementation of the functionality of the software 812SN/A# licensed hereunder. You may use the software subject to the license 912SN/A# terms below provided that you ensure that this notice is replicated 1012SN/A# unmodified and in its entirety in all distributions of the software, 1112SN/A# modified or unmodified, in source code or in binary form. 1212SN/A# 1312SN/A# Redistribution and use in source and binary forms, with or without 1412SN/A# modification, are permitted provided that the following conditions are 1512SN/A# met: redistributions of source code must retain the above copyright 1612SN/A# notice, this list of conditions and the following disclaimer; 1712SN/A# redistributions in binary form must reproduce the above copyright 1812SN/A# notice, this list of conditions and the following disclaimer in the 1912SN/A# documentation and/or other materials provided with the distribution; 2012SN/A# neither the name of the copyright holders nor the names of its 2112SN/A# contributors may be used to endorse or promote products derived from 2212SN/A# this software without specific prior written permission. 2312SN/A# 2412SN/A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2512SN/A# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2612SN/A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 272665Ssaidi@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 282665Ssaidi@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2912SN/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3012SN/A# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3112SN/A# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3212SN/A# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3312SN/A# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 345070Ssaidi@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 355090Sgblack@eecs.umich.edu# 3612SN/A# Authors: Matteo Andreozzi 378229Snate@binkert.org 388229Snate@binkert.orgfrom m5.params import * 3912SN/Afrom AbstractMemory import AbstractMemory 4012SN/Afrom QoSTurnaround import * 4112SN/A 4212SN/A# QoS Queue Selection policy used to select packets among same-QoS queues 435090Sgblack@eecs.umich.educlass QoSQPolicy(Enum): vals = ["fifo", "lifo", "lrg"] 445090Sgblack@eecs.umich.edu 455090Sgblack@eecs.umich.educlass QoSMemCtrl(AbstractMemory): 462976Sgblack@eecs.umich.edu type = 'QoSMemCtrl' 472976Sgblack@eecs.umich.edu cxx_header = "mem/qos/mem_ctrl.hh" 482976Sgblack@eecs.umich.edu cxx_class = 'QoS::MemCtrl' 492976Sgblack@eecs.umich.edu abstract = True 502976Sgblack@eecs.umich.edu 515070Ssaidi@eecs.umich.edu ##### QoS support parameters #### 522976Sgblack@eecs.umich.edu 53468SN/A # Number of priorities in the system 547581SAli.Saidi@arm.com qos_priorities = Param.Unsigned(1, "QoS priorities") 55468SN/A 5612SN/A # QoS scheduler policy: tags request with QoS priority value 572479SN/A qos_policy = Param.QoSPolicy(NULL, 58360SN/A "Memory Controller Requests QoS arbitration policy") 5912SN/A 605070Ssaidi@eecs.umich.edu # Select QoS driven turnaround policy 615070Ssaidi@eecs.umich.edu # (direction switch triggered by highest priority buffer content) 625070Ssaidi@eecs.umich.edu qos_turnaround_policy = Param.QoSTurnaroundPolicy(NULL, 635090Sgblack@eecs.umich.edu "Selects QoS driven turnaround policy") 645090Sgblack@eecs.umich.edu 6512SN/A # QoS Queue Select policy: selects packets among same priority level 6612SN/A # (only supported in QoSMemSinkCtrl) 6712SN/A qos_q_policy = Param.QoSQPolicy('fifo', 685090Sgblack@eecs.umich.edu "Memory Controller Requests same-QoS selection policy") 695090Sgblack@eecs.umich.edu 703812Ssaidi@eecs.umich.edu # flag to select QoS syncronised scheduling 713812Ssaidi@eecs.umich.edu # (calls the scheduler on all masters at every packet arrival) 723812Ssaidi@eecs.umich.edu qos_syncro_scheduler = Param.Bool(False, 733812Ssaidi@eecs.umich.edu "Enables QoS syncronized scheduling") 7412SN/A 755070Ssaidi@eecs.umich.edu # flag to enable QoS priority escalation 765070Ssaidi@eecs.umich.edu qos_priority_escalation = Param.Bool(False, 773917Ssaidi@eecs.umich.edu "Enables QoS priority escalation") 7812SN/A 7912SN/A # Master ID to be mapped to service parameters in QoS schedulers 802976Sgblack@eecs.umich.edu qos_masters = VectorParam.String(['']* 16, 812976Sgblack@eecs.umich.edu "Master Names to be mapped to service parameters in QoS scheduler") 822976Sgblack@eecs.umich.edu