summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2013-03-11 01:49:35 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-04-03 22:08:28 -0500
commit07ca82453c9066d218055ec9403e84be5d52957a (patch)
tree2faa8f6bb7aa1568f6cd236ba9ffd17b18049782 /src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C
parent393a4144ae5ba71810d5063e0c643efe565aaed6 (diff)
downloadblackbird-hostboot-07ca82453c9066d218055ec9403e84be5d52957a.tar.gz
blackbird-hostboot-07ca82453c9066d218055ec9403e84be5d52957a.zip
Change in design of GetBitString
- It is no longer necessary to call GetBitString function of a register only when it is read atleast once. RTC: 66086 Change-Id: Ia67903c03e4aea9cc5a128b05eecacdd9af59c89 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3501 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3856
Diffstat (limited to 'src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C')
-rw-r--r--src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C b/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C
index 228f34c0c..2c168e2e8 100644
--- a/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C
+++ b/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.C
@@ -48,22 +48,20 @@ BIT_STRING_CLASS & RegDataCache::read(
const SCAN_COMM_REGISTER_CLASS * i_pRegister,
bool & o_readStat )
{
- BIT_STRING_CLASS * l_pBitString = NULL;
- o_readStat = false;
ScomRegisterAccess l_scomAccessKey ( *i_pRegister,i_pChip );
- CacheDump::iterator itDump = iv_cachedRead.find( l_scomAccessKey );
- if( iv_cachedRead.end() != itDump )
- {
- o_readStat = true;
- l_pBitString = itDump->second ;
- }
- else
+ BIT_STRING_CLASS * l_pBitString = queryCache( l_scomAccessKey );
+ o_readStat = false;
+ if( NULL == l_pBitString )
{
// Creating new entry
l_pBitString = new BitStringBuffer( i_pRegister->GetBitLength( ) );
// Adding register in the cache
iv_cachedRead[l_scomAccessKey] = l_pBitString;
}
+ else
+ {
+ o_readStat = true;
+ }
return *l_pBitString;
}
@@ -101,4 +99,28 @@ void RegDataCache::flush( ExtensibleChip* i_pChip,
//------------------------------------------------------------------------------
+BIT_STRING_CLASS * RegDataCache::queryCache(
+ ExtensibleChip* i_pChip,
+ const SCAN_COMM_REGISTER_CLASS * i_pRegister )const
+{
+ ScomRegisterAccess l_scomAccessKey ( *i_pRegister,i_pChip );
+ return queryCache( l_scomAccessKey );
+}
+
+//------------------------------------------------------------------------------
+
+BIT_STRING_CLASS * RegDataCache::queryCache(
+ const ScomRegisterAccess & i_scomAccessKey ) const
+{
+ BIT_STRING_CLASS * l_pBitString = NULL;
+ CacheDump::const_iterator itDump = iv_cachedRead.find( i_scomAccessKey );
+ if( iv_cachedRead.end() != itDump )
+ {
+ l_pBitString = itDump->second ;
+ }
+
+ return l_pBitString;
+}
+
+//------------------------------------------------------------------------------
}// end namespace PRDF
OpenPOWER on IntegriCloud