From 38339e0a7f7ce119feefc95591703df2f851ee4d Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Thu, 3 Jan 2019 17:45:56 +0000 Subject: cpu-o3: Make the smtFetchPolicy a Param.ScopedEnum The smtFetchPolicy is a parameter in the o3 cpu that can have 5 different values. Previously this setting was done through a string and a parser function would turn it into a c++ enum value. This changeset turns the string into a python Param.ScopedEnum. Change-Id: Iafb4b4b27587541185ea912e5ed581bce09695f5 Signed-off-by: Nikos Nikoleris Reviewed-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/15396 Reviewed-by: Anthony Gutierrez Maintainer: Anthony Gutierrez --- src/cpu/o3/O3CPU.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/cpu/o3/O3CPU.py') diff --git a/src/cpu/o3/O3CPU.py b/src/cpu/o3/O3CPU.py index b8152f663..f6c395aed 100644 --- a/src/cpu/o3/O3CPU.py +++ b/src/cpu/o3/O3CPU.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 ARM Limited +# Copyright (c) 2016, 2019 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -48,6 +48,9 @@ from FUPool import * from O3Checker import O3Checker from BranchPredictor import * +class FetchPolicy(ScopedEnum): + vals = [ 'SingleThread', 'RoundRobin', 'Branch', 'IQCount', 'LSQCount' ] + class DerivO3CPU(BaseCPU): type = 'DerivO3CPU' cxx_header = 'cpu/o3/deriv.hh' @@ -147,7 +150,7 @@ class DerivO3CPU(BaseCPU): numROBEntries = Param.Unsigned(192, "Number of reorder buffer entries") smtNumFetchingThreads = Param.Unsigned(1, "SMT Number of Fetching Threads") - smtFetchPolicy = Param.String('SingleThread', "SMT Fetch policy") + smtFetchPolicy = Param.FetchPolicy('SingleThread', "SMT Fetch policy") smtLSQPolicy = Param.String('Partitioned', "SMT LSQ Sharing Policy") smtLSQThreshold = Param.Int(100, "SMT LSQ Threshold Sharing Parameter") smtIQPolicy = Param.String('Partitioned', "SMT IQ Sharing Policy") -- cgit v1.2.3