summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H
diff options
context:
space:
mode:
authorprem <premjha2@in.ibm.com>2012-12-04 08:51:19 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-02-15 07:17:34 -0600
commite3aa31e88b5074f67b9b145c224ef9613afee1e9 (patch)
treee9a1665048740ad735810cee9f23bb88b14c322a /src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H
parent22813205c0a225f01d8c6cb4e207687e7cc9ed42 (diff)
downloadblackbird-hostboot-e3aa31e88b5074f67b9b145c224ef9613afee1e9.tar.gz
blackbird-hostboot-e3aa31e88b5074f67b9b145c224ef9613afee1e9.zip
Design change for PRD Register
- Addressed the use case of attention in PLL Domain.RuleChip under analysis is pushed to stack at the beginning of all public function of RuleChip.Same is poped back at the end of function. - Scope of RuleChip stack is no longer bound to scope of ServiceDataCollector. Change-Id: I152e85332f5443dbef3efeebc7de530ee0fee241 RTC: 47515 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2543 Tested-by: Jenkins Server Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/3197
Diffstat (limited to 'src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H')
-rw-r--r--src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H b/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H
new file mode 100644
index 000000000..f3f61b4a8
--- /dev/null
+++ b/src/usr/diag/prdf/common/framework/register/prdfRegisterCache.H
@@ -0,0 +1,112 @@
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: prdfRegisterCache.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012,2013 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
+
+#ifndef REG_CACHE_H
+#define REG_CACHE_H
+
+/** @file prdfRegisterCache.H */
+
+#include <map>
+#include <targeting/common/target.H>
+#include <iipbits.h>
+#include <iipglobl.h>
+#include <prdfScanFacility.H>
+#include <prdfScomRegisterAccess.H>
+
+class BIT_STRING_CLASS;
+
+namespace PRDF
+{
+/**
+ * @brief Caches the contents of registers used during analysis.
+ *
+ * It maintains the latest content of a register in a map. If contents of the
+ * register remain unchanged, register read returns contents stored in
+ * cache rather than reading from hardware. Hence it brings efficiency in read.
+ * Whenever write to actual hardware takes place, it is expected that once write
+ * to hardware succeeds, the user of cache shall call flush. It drops the
+ * particular register from map. As a result, when read takes place from same
+ * register next time, read from cache fails and actual access to hardware
+ * takes place.
+ */
+class RegDataCache
+{
+ public:
+
+ /**
+ * @brief Constructor
+ */
+ RegDataCache()
+ { }
+
+ /**
+ * @brief Destructor
+ */
+ ~RegDataCache();
+
+ /**
+ * @brief Returns reference to singleton instance of the RegDataCache.
+ * @return The singleton reference.
+ */
+ static RegDataCache & getCachedRegisters();
+
+ /**
+ * @brief Returns the data buffer for the given target and address.
+ * @param i_pChip The target associated with the register.
+ * @param i_pRegister pointer to register to be read.
+ * @param o_readStat Returns true if the register does not exist in
+ * cache. In this case, the function will create and
+ * add an empty BIT_STRING_CLASS to the cache.It is
+ * the responsibilty of the user to update the data
+ * buffer by reading from hardware.
+ * @return A reference to the data buffer associated with the register.
+ */
+ BIT_STRING_CLASS & read( ExtensibleChip* i_pChip,
+ const SCAN_COMM_REGISTER_CLASS * i_pRegister,
+ bool & o_readStat );
+
+ /**
+ * @brief Flushes entire contents from cache.
+ */
+ void flush();
+
+ /**
+ * @brief Removes a single entry from the cache.
+ * @param i_pChip The rulechip associated with the register.
+ * @param i_pRegister points to the register to be flushed from cache.
+ */
+ void flush( ExtensibleChip* i_pChip,
+ const SCAN_COMM_REGISTER_CLASS * i_pRegister );
+ private: // data
+
+ typedef std::map<ScomRegisterAccess, BIT_STRING_CLASS *> CacheDump;
+ CacheDump iv_cachedRead;
+
+};
+
+PRDF_DECLARE_SINGLETON(RegDataCache, ReadCache);
+
+} // namespace PRDF
+
+#endif // REG_CACHE_H
+
OpenPOWER on IntegriCloud