Redefining the checkstop attention type

ATTN_TYPE_CHECKSTOP previously had been used to indicate the system
has checkstopped. However, in hardware it really means that the chip has
checkstopped. It just happens to be when processor chips checkstop, the
entire system will checkstop. This does not work for memory buffer chips
because a memory buffer could checkstop, but it is not guaranteed the
system will checkstop like it does for processor chips. With memory
mirroring and other redundancies, it is possible for a system to recover
from a memory buffer chip checkstop. I added a new ATTN_TYPE_CHIP_CS
enum with the same value as its predecessor. The old enum will
eventually be removed once user applications have been given the time to
do so.

Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I884317d25630513eec45fbb2313bd6a274a84876
diff --git a/src/hei_isolation_data.hpp b/src/hei_isolation_data.hpp
index fbebc87..b20f629 100644
--- a/src/hei_isolation_data.hpp
+++ b/src/hei_isolation_data.hpp
@@ -138,9 +138,8 @@
     bool queryCheckstop() const
     {
         auto itr = std::find_if(
-            iv_sigList.begin(), iv_sigList.end(), [](const auto& s) {
-                return ATTN_TYPE_CHECKSTOP == s.getAttnType();
-            });
+            iv_sigList.begin(), iv_sigList.end(),
+            [](const auto& s) { return ATTN_TYPE_CHIP_CS == s.getAttnType(); });
 
         return iv_sigList.end() != itr;
     }
diff --git a/src/hei_signature.hpp b/src/hei_signature.hpp
index dbf63a8..0cb0444 100644
--- a/src/hei_signature.hpp
+++ b/src/hei_signature.hpp
@@ -56,7 +56,7 @@
     BitPosition_t iv_bit   = 0; ///< Target bit within this register.
 
     /** Attention type reported by this bit. */
-    AttentionType_t iv_attnType = ATTN_TYPE_CHECKSTOP;
+    AttentionType_t iv_attnType = ATTN_TYPE_CHIP_CS;
 
   public: // Member functions
     /** @return The chip containing this register. */
diff --git a/src/hei_types.hpp b/src/hei_types.hpp
index 530481a..bdbbffb 100644
--- a/src/hei_types.hpp
+++ b/src/hei_types.hpp
@@ -167,21 +167,37 @@
     // clang-format off
 
     /** System checkstop hardware attention. Unrecoverable, fatal error. */
+    // TODO: This is deprecated and will be removed. Use CHIP_CS instead.
     ATTN_TYPE_CHECKSTOP   = 1,
 
-    /** Unit checkstop hardware attention. A unit within the system is no longer
-     *  usable but the rest of the system should be able to recover. */
+    /**
+     * Hardware error event indicating that an entire chip has checkstopped and
+     * is no longer usable.
+     */
+    ATTN_TYPE_CHIP_CS     = 1,
+
+    /**
+     * Hardware error event indicating that a unit within a chip has
+     * checkstopped and is no longer usable. Other units within the chip should
+     * continue uninterrupted. Possible degraded functionality.
+     */
     ATTN_TYPE_UNIT_CS     = 2,
 
-    /** Recoverable hardware attention. The system should be able to continue
-     *  uninterrupted, possible degraded functionality. */
+    /**
+     * Hardware error event in which the hardware recovered. The system should
+     * be able to continue uninterrupted. Possible degraded functionality.
+     */
     ATTN_TYPE_RECOVERABLE = 3,
 
-    /** Software or hardware event requiring action by the service processor
-     *  firmware. */
+    /**
+     * Software or hardware event requiring action by the service processor
+     * firmware.
+     */
     ATTN_TYPE_SP_ATTN     = 4,
 
-    /** Software or hardware event requiring action by the host firmware. */
+    /**
+     * Software or hardware event requiring action by the host firmware.
+     */
     ATTN_TYPE_HOST_ATTN   = 5,
 
     // clang-format on
diff --git a/test/simulator/testcases/eq_core_fir.cpp b/test/simulator/testcases/eq_core_fir.cpp
index 242d818..c7fa4f1 100644
--- a/test/simulator/testcases/eq_core_fir.cpp
+++ b/test/simulator/testcases/eq_core_fir.cpp
@@ -27,9 +27,9 @@
 REG_SCOM(proc0, 0x27024447, 0xBDDC26C5FE1300CC) // EQ_CORE_FIR_ACT1
 REG_SCOM(proc0, 0x27024448, 0x0000000000000080) // EQ_CORE_FIR_WOF
 
-EXP_SIG(proc0, 0x682c, 28, 1, CHECKSTOP)
-EXP_SIG(proc0, 0x682c, 28, 26, CHECKSTOP)
-EXP_SIG(proc0, 0x682c, 29, 63, CHECKSTOP)
+EXP_SIG(proc0, 0x682c, 28, 1, CHIP_CS)
+EXP_SIG(proc0, 0x682c, 28, 26, CHIP_CS)
+EXP_SIG(proc0, 0x682c, 29, 63, CHIP_CS)
 EXP_SIG(proc0, 0x682c, 28, 56, RECOVERABLE)
 EXP_SIG(proc0, 0x682c, 29, 56, RECOVERABLE)
 
diff --git a/test/simulator/testcases/sample_test_case.cpp b/test/simulator/testcases/sample_test_case.cpp
index 91fff43..0378fbd 100644
--- a/test/simulator/testcases/sample_test_case.cpp
+++ b/test/simulator/testcases/sample_test_case.cpp
@@ -68,27 +68,27 @@
 REG_SCOM(proc0, 0x0000f207, 0x5000000000000000) // LFIR2_ACT1 inst 0
 
 // LFIR0
-EXP_SIG(proc0, 0xa776, 0, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa776, 0, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa776, 0, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa776, 1, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa776, 1, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa776, 1, 1, RECOVERABLE)
 
 // LFIR1
-EXP_SIG(proc0, 0xa876, 0, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 0, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 0, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa876, 1, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 1, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 1, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa876, 2, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 2, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 2, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa876, 3, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 3, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 3, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa876, 4, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 4, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 4, 1, RECOVERABLE)
-EXP_SIG(proc0, 0xa876, 5, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa876, 5, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa876, 5, 1, RECOVERABLE)
 
 // LFIR2
-EXP_SIG(proc0, 0xa976, 0, 0, CHECKSTOP)
+EXP_SIG(proc0, 0xa976, 0, 0, CHIP_CS)
 EXP_SIG(proc0, 0xa976, 0, 1, RECOVERABLE)
 
 END_ITERATION
diff --git a/test/simulator/testcases/tod_fault.cpp b/test/simulator/testcases/tod_fault.cpp
index 1d03883..cebf4f3 100644
--- a/test/simulator/testcases/tod_fault.cpp
+++ b/test/simulator/testcases/tod_fault.cpp
@@ -18,7 +18,7 @@
 REG_SCOM(proc0, 0x00040032, 0xc000000000000000) // TOD_ERROR_MASK
 REG_SCOM(proc0, 0x00040033, 0xa000000000000000) // TOD_ERROR_ROUTING
 
-EXP_SIG(proc0, 0x7d9b, 0, 3, CHECKSTOP)
+EXP_SIG(proc0, 0x7d9b, 0, 3, CHIP_CS)
 EXP_SIG(proc0, 0xdf2a, 0, 26, RECOVERABLE)
 
 END_ITERATION