From 1ff9bbea76be1abe3a861706aa55ad1bd873a175 Mon Sep 17 00:00:00 2001 From: Benjamin Weisenbeck Date: Wed, 7 Sep 2016 14:38:13 -0500 Subject: PRD: Initial L3 Line Delete This commit performs L3 line deletes by setting the delete-on-next-ce bit. Change-Id: I542d9527b91640902c4d62a4fb2a4a2c69313819 RTC: 155327 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29338 Tested-by: Jenkins Server Reviewed-by: Caleb N. Palmer Reviewed-by: Brian J. Stegmiller Reviewed-by: Zane C. Shelley Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29973 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C | 90 +++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100755 src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C (limited to 'src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C') diff --git a/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C new file mode 100755 index 000000000..f8099ceb0 --- /dev/null +++ b/src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C @@ -0,0 +1,90 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/diag/prdf/common/plat/p9/prdfLineDelete.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2005,2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + +/** @file prdfLineDelete.C + * Contains the definitions needed for the line delete algorithms and the CE + * table. + */ + + +#include +#include +#include + +namespace PRDF +{ + +// See prdfLineDelete.H for full function documentation. +namespace LineDelete +{ + + /* PrdfCacheCETable::addAddress + * Insert address into CE table. + */ + bool PrdfCacheCETable::addAddress( PrdfCacheAddress i_addr, + STEP_CODE_DATA_STRUCT & i_sdc ) + { + // Get the time of the current error. + Timer timeOfError = i_sdc.service_data->GetTOE(); + + // Check if time interval has elapsed. If so, flush the table. + if ( (timeOfError > cv_flushTimer) || !cv_flushTimerInited ) + { + this->flushTable(); + cv_flushTimer = timeOfError + iv_thPolicy.interval; + cv_flushTimerInited = true; + } + + // Increment address hit count. + uint32_t count = ++cv_ceTable[i_addr]; + + // Return whether the address threshold has been reached or not. + return ( iv_thPolicy.threshold <= count ); + } + + /* PrdfCacheCETable::isIntervalElapsed() + */ + bool PrdfCacheCETable::isIntervalElapsed( STEP_CODE_DATA_STRUCT & i_sdc ) + { + bool o_rc = false; + if ( cv_flushTimerInited ) + o_rc = ( i_sdc.service_data->GetTOE() > cv_flushTimer ); + return o_rc; + } + + /* PrdfCacheCETable::flushTable() + * Clear all entries from CE table. + */ + void PrdfCacheCETable::flushTable() + { + // wipe interval timer and clear all hits. + cv_flushTimerInited = false; + cv_ceTable.clear(); + } + +}; + +} // end namespace PRDF + -- cgit v1.2.1