summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/hwas')
-rw-r--r--src/usr/hwas/common/deconfigGard.C784
-rw-r--r--src/usr/hwas/test/hwasGardTest.H1017
2 files changed, 1797 insertions, 4 deletions
diff --git a/src/usr/hwas/common/deconfigGard.C b/src/usr/hwas/common/deconfigGard.C
index fff247b6f..f76ce9ddd 100644
--- a/src/usr/hwas/common/deconfigGard.C
+++ b/src/usr/hwas/common/deconfigGard.C
@@ -120,8 +120,9 @@ DeconfigGard & theDeconfigGard()
}
//******************************************************************************
-DeconfigGard::DeconfigGard() :
- iv_platDeconfigGard(NULL)
+DeconfigGard::DeconfigGard()
+: iv_platDeconfigGard(NULL),
+ iv_XABusEndpointDeconfigured(false)
{
HWAS_INF("DeconfigGard Constructor");
HWAS_MUTEX_INIT(iv_mutex);
@@ -331,6 +332,15 @@ errlHndl_t DeconfigGard::deconfigureTargetsFromGardRecordsForIpl(
HWAS_MUTEX_UNLOCK(iv_mutex);
} // for
+ // Deconfigure procs based on fabric bus deconfigs and perform SMP
+ // node balancing
+ l_pErr = _invokeDeconfigureAssocProc();
+ if ( l_pErr )
+ {
+ HWAS_ERR("Error from _invokeDeconfigureAssocProc ");
+ break;
+ }
+
// check and see if we still have enough hardware to continue
l_pErr = checkMinimumHardware();
if ( l_pErr )
@@ -776,6 +786,242 @@ void findMcsInGroup(const Target *i_startMcs, TargetHandleList &o_McsInGroup)
} // findMcsInGroup
//******************************************************************************
+
+errlHndl_t DeconfigGard::deconfigureAssocProc()
+{
+ HWAS_INF("Deconfiguring chip resources "
+ "based on fabric bus deconfigurations");
+
+ HWAS_MUTEX_LOCK(iv_mutex);
+ // call _invokeDeconfigureAssocProc() to obtain state of system,
+ // call algorithm function, and then deconfigure targets
+ // based on output
+ errlHndl_t l_pErr = _invokeDeconfigureAssocProc();
+ HWAS_MUTEX_UNLOCK(iv_mutex);
+ return l_pErr;
+}
+
+//******************************************************************************
+errlHndl_t DeconfigGard::_invokeDeconfigureAssocProc()
+{
+ HWAS_INF("Preparing data for _deconfigureAssocProc ");
+ // Return error
+ errlHndl_t l_pErr = NULL;
+ // Define vector of ProcInfo structs to be used by
+ // _deconfigAssocProc algorithm. Declared here so
+ // "delete" can be used outside of do {...} while(0)
+ std::vector<ProcInfo *> l_procInfo;
+
+ do
+ {
+ // If flag indicating deconfigured bus endpoints is not set,
+ // then there's no work for _invokeDeconfigureAssocProc to do
+ // as this implies there are no deconfigured endpoints or
+ // processors.
+ if (!(iv_XABusEndpointDeconfigured))
+ {
+ HWAS_INF("_invokeDeconfigureAssocProc: No deconfigured x/a"
+ " bus endpoints. Deconfiguration of "
+ "associated procs unnecessary.");
+ break;
+ }
+
+ // Clear flag as this function is called multiple times
+ iv_XABusEndpointDeconfigured = false;
+
+ // Define and populate vector of present procs
+ // Define predicate
+ PredicateCTM predProc(CLASS_CHIP, TYPE_PROC);
+ PredicateHwas predPres;
+ predPres.present(true);
+ PredicatePostfixExpr presProc;
+ presProc.push(&predProc).push(&predPres).And();
+
+ // Get top level target
+ Target * l_pSys;
+ targetService().getTopLevelTarget(l_pSys);
+
+ // Find master proc
+ Target* l_pMasterProcTarget;
+ targetService().
+ masterProcChipTargetHandle(l_pMasterProcTarget);
+
+ // Populate vector
+ TargetHandleList l_presProcs;
+ targetService().getAssociated(l_presProcs,
+ l_pSys,
+ TargetService::CHILD,
+ TargetService::ALL,
+ &presProc);
+ // Sort by HUID
+ std::sort(l_presProcs.begin(),
+ l_presProcs.end(), compareTargetHuid);
+
+ // General predicate to determine if target is functional
+ PredicateIsFunctional isFunctional;
+
+ // Define and populate vector of present bus endpoint chiplets
+ PredicateCTM predXbus(CLASS_UNIT, TYPE_XBUS);
+ PredicateCTM predAbus(CLASS_UNIT, TYPE_ABUS);
+ PredicatePostfixExpr busPres;
+ busPres.push(&predXbus).push(&predAbus).Or().push(&predPres).And();
+
+ // Iterate through present procs and populate l_procInfo
+ // vector with system information regarding procs
+ for (TargetHandleList::const_iterator
+ l_procsIter = l_presProcs.begin();
+ l_procsIter != l_presProcs.end();
+ ++l_procsIter)
+ {
+ ProcInfo * l_ProcInfo = new ProcInfo();
+ // Iterate through present procs and populate structs in l_procInfo
+ // Target pointer
+ l_ProcInfo->iv_pThisProc =
+ *l_procsIter;
+ // HUID
+ l_ProcInfo->procHUID =
+ (*l_procsIter)->getAttr<ATTR_HUID>();
+ // FABRIC_NODE_ID
+ l_ProcInfo->procFabricNode =
+ (*l_procsIter)->getAttr<ATTR_FABRIC_NODE_ID>();
+ // FABRIC_CHIP_ID
+ l_ProcInfo->procFabricChip =
+ (*l_procsIter)->getAttr<ATTR_FABRIC_CHIP_ID>();
+ // HWAS state
+ l_ProcInfo->iv_deconfigured =
+ !(isFunctional(*l_procsIter));
+ // iv_isMaster
+ if (*l_procsIter == l_pMasterProcTarget)
+ {
+ l_ProcInfo->iv_isMaster = true;
+ }
+ else
+ {
+ l_ProcInfo->iv_isMaster = false;
+ }
+ l_procInfo.push_back(l_ProcInfo);
+ }
+ // Iterate through l_procInfo and populate child bus endpoint
+ // chiplet information
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = l_procInfo.begin();
+ l_procInfoIter != l_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Populate vector of bus endpoints associated with this proc
+ TargetHandleList l_presentBusChiplets;
+ targetService().getAssociated(l_presentBusChiplets,
+ (*l_procInfoIter)->iv_pThisProc,
+ TargetService::CHILD,
+ TargetService::IMMEDIATE,
+ &busPres);
+ // Sort by HUID
+ std::sort(l_presentBusChiplets.begin(),
+ l_presentBusChiplets.end(), compareTargetHuid);
+ // iv_pA/XProcs[] and iv_A/XDeconfigured[] indexes
+ uint8_t xBusIndex = 0;
+ uint8_t aBusIndex = 0;
+
+ // Iterate through present bus endpoint chiplets
+ for (TargetHandleList::iterator
+ l_busIter = l_presentBusChiplets.begin();
+ l_busIter != l_presentBusChiplets.end();
+ ++l_busIter)
+ {
+ // Declare peer endpoint target
+ const Target * l_pTarget = *l_busIter;
+ // Get peer endpoint target
+ const Target * l_pDstTarget = l_pTarget->
+ getAttr<ATTR_PEER_TARGET>();
+ // Only interested in endpoint chiplets which lead to a
+ // present proc:
+ // If no peer for this endpoint or peer endpoint
+ // is not present, continue
+ if ((!l_pDstTarget) ||
+ (!(l_pDstTarget->getAttr<ATTR_HWAS_STATE>().present)))
+ {
+ continue;
+ }
+ // Chiplet has a valid (present) peer
+ // Handle iv_pA/XProcs[]:
+ // Define target for peer proc
+ const Target* l_pPeerProcTarget;
+ // Get parent chip from xbus chiplet
+ l_pPeerProcTarget = getParentChip(l_pDstTarget);
+ // Find matching ProcInfo struct
+ for (std::vector<ProcInfo *>::const_iterator
+ l_matchProcInfoIter = l_procInfo.begin();
+ l_matchProcInfoIter != l_procInfo.end();
+ ++l_matchProcInfoIter)
+ {
+ // If Peer proc target matches this ProcInfo struct's
+ // Identifier target
+ if (l_pPeerProcTarget ==
+ (*l_matchProcInfoIter)->iv_pThisProc)
+ {
+ // Update struct of current proc to point to this
+ // struct, and also handle iv_A/XDeconfigured[]
+ // and increment appropriate index:
+ if (TYPE_XBUS == (*l_busIter)->getAttr<ATTR_TYPE>())
+ {
+ (*l_procInfoIter)->iv_pXProcs[xBusIndex] =
+ *l_matchProcInfoIter;
+ // HWAS state
+ (*l_procInfoIter)->iv_XDeconfigured[xBusIndex] =
+ !(isFunctional(*l_busIter));
+ xBusIndex++;
+ }
+ else if (TYPE_ABUS == (*l_busIter)->
+ getAttr<ATTR_TYPE>())
+ {
+ (*l_procInfoIter)->iv_pAProcs[aBusIndex] =
+ *l_matchProcInfoIter;
+ // HWAS state
+ (*l_procInfoIter)->iv_ADeconfigured[aBusIndex] =
+ !(isFunctional(*l_busIter));
+ aBusIndex++;
+ }
+ break;
+ }
+ }
+ }
+ }
+ // call _deconfigureAssocProc() to run deconfig algorithm
+ // based on current state of system obtained above
+ l_pErr = _deconfigureAssocProc(l_procInfo);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ break;
+ }
+ // Iterate through l_procInfo and deconfigure any procs
+ // which _deconfigureAssocProc marked for deconfiguration
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = l_procInfo.begin();
+ l_procInfoIter != l_procInfo.end();
+ ++l_procInfoIter)
+ {
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ // Deconfigure marked procs
+ HWAS_INF("_invokeDeconfigureAssocProc is "
+ "deconfiguring proc: %.8X",
+ get_huid((*l_procInfoIter)->iv_pThisProc));
+ _deconfigureTarget(*(*l_procInfoIter)->
+ iv_pThisProc, DECONFIGURED_BY_BUS_DECONFIG);
+ _deconfigureByAssoc(*(*l_procInfoIter)->
+ iv_pThisProc, DECONFIGURED_BY_BUS_DECONFIG);
+ }
+ }
+ }while(0);
+ // Free previously allocated memory
+ while(!l_procInfo.empty()) delete l_procInfo.back(),
+ l_procInfo.pop_back();
+ return l_pErr;
+}
+
+//******************************************************************************
+
void DeconfigGard::_deconfigureByAssoc(Target & i_target,
const uint32_t i_errlEid)
{
@@ -818,8 +1064,9 @@ void DeconfigGard::_deconfigureByAssoc(Target & i_target,
_deconfigureByAssoc(*pChild, i_errlEid);
} // for CHILD_BY_AFFINITY
- // Memory deconfigureByAssociation rules
- // depends on the type of this target - MEMBUF, MBA, DIMM
+ // Handles bus endpoint (TYPE_XBUS, TYPE_ABUS) and
+ // memory (TYPE_MEMBUF, TYPE_MBA, TYPE_DIMM)
+ // deconfigureByAssociation rules
switch (i_target.getAttr<ATTR_TYPE>())
{
case TYPE_MEMBUF:
@@ -1050,6 +1297,25 @@ void DeconfigGard::_deconfigureByAssoc(Target & i_target,
}
break;
} // TYPE_DIMM
+
+ // If target is a bus endpoint, deconfigure its peer
+ case TYPE_XBUS:
+ case TYPE_ABUS:
+ {
+ // Get peer endpoint target
+ const Target * l_pDstTarget = i_target.
+ getAttr<ATTR_PEER_TARGET>();
+ // If target is valid
+ if (l_pDstTarget)
+ {
+ // Deconfigure peer endpoint
+ HWAS_INF("deconfigByAssoc BUS Peer: %.8X",
+ get_huid(l_pDstTarget));
+ _deconfigureTarget(const_cast<Target &> (*l_pDstTarget),
+ i_errlEid);
+ }
+ break;
+ } // TYPE_XBUS, TYPE_ABUS
default:
// no action
break;
@@ -1090,6 +1356,14 @@ void DeconfigGard::_deconfigureTarget(Target & i_target,
_doDeconfigureActions(i_target);
}
+ // If target being deconfigured is an x/a bus endpoint
+ if ((TYPE_XBUS == i_target.getAttr<ATTR_TYPE>()) ||
+ (TYPE_ABUS == i_target.getAttr<ATTR_TYPE>()))
+ {
+ // Set flag indicating x/a bus endpoint deconfiguration
+ iv_XABusEndpointDeconfigured = true;
+ }
+
//HWAS_DBG("Deconfiguring Target %.8X exiting", get_huid(&i_target));
} // _deconfigureTarget
@@ -1201,4 +1475,506 @@ bool DeconfigGard::_processDeferredDeconfig()
return rc;
} // _processDeferredDeconfig
+//******************************************************************************
+errlHndl_t DeconfigGard::_deconfigureAssocProc(
+ std::vector<ProcInfo *> &io_procInfo)
+{
+ // Defined for possible use in future applications
+ errlHndl_t l_errlHdl = NULL;
+
+ do
+ {
+ // STEP 1:
+ // Find master proc and iterate through its bus endpoint chiplets.
+ // For any chiplets which are deconfigured, mark peer proc as
+ // deconfigured
+
+ // Find master proc
+ ProcInfo * l_pMasterProcInfo = NULL;
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ // Save for subsequent use
+ l_pMasterProcInfo = *l_procInfoIter;
+ // Iterate through bus endpoints, and if deconfigured,
+ // mark peer proc to be deconfigured
+ for (uint8_t i = 0; i < NUM_A_BUSES; i++)
+ {
+ if ((*l_procInfoIter)->iv_ADeconfigured[i])
+ {
+ HWAS_INF("deconfigureAssocProc marked proc: "
+ "%.8X for deconfiguration "
+ "due to deconfigured abus endpoint "
+ "on master proc.",
+ (*l_procInfoIter)->iv_pAProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pAProcs[i]->
+ iv_deconfigured = true;
+ }
+ }
+ for (uint8_t i = 0; i < NUM_X_BUSES; i++)
+ {
+ if ((*l_procInfoIter)->iv_XDeconfigured[i])
+ {
+ HWAS_INF("deconfigureAssocProc marked proc: "
+ "%.8X for deconfiguration "
+ "due to deconfigured xbus endpoint "
+ "on master proc.",
+ (*l_procInfoIter)->iv_pXProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ iv_deconfigured = true;
+ }
+ }
+ break;
+ }
+ } // STEP 1
+
+ // If no master proc found, abort
+ HWAS_ASSERT(l_pMasterProcInfo, "HWAS _deconfigureAssocProc:"
+ "Master proc not found");
+
+ // STEP 2:
+ // Iterate through procs, and mark deconfigured any
+ // non-master proc which has more than one bus endpoint
+ // chiplet deconfigured
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Don't deconfigure master proc
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ continue;
+ }
+ // Don't examine previously marked proc
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ continue;
+ }
+ // Deconfigured bus chiplet counter
+ uint8_t deconfigBusCounter = 0;
+ // Check and increment counter if A/X bus endpoints found
+ // which are deconfigured
+ for (uint8_t i = 0; i < NUM_A_BUSES; i++)
+ {
+ if ((*l_procInfoIter)->iv_ADeconfigured[i])
+ {
+ deconfigBusCounter++;
+ }
+ }
+ for (uint8_t i = 0; i < NUM_X_BUSES; i++)
+ {
+ if ((*l_procInfoIter)->iv_XDeconfigured[i])
+ {
+ deconfigBusCounter++;
+ }
+ }
+ // If number of endpoints deconfigured is > 1
+ if (deconfigBusCounter > 1)
+ {
+ // Mark current proc to be deconfigured
+ HWAS_INF("deconfigureAssocProc marked proc: "
+ "%.8X for deconfiguration "
+ "due to %d deconfigured bus endpoints "
+ "on this proc.",
+ (*l_procInfoIter)->procHUID,
+ deconfigBusCounter);
+ (*l_procInfoIter)->iv_deconfigured = true;
+ }
+ }// STEP 2
+
+
+ // STEP 3:
+ // If a deconfigured bus connects two non-master procs,
+ // both of which are in the master-containing logical node,
+ // mark proc with higher HUID to be deconfigured.
+
+ // Iterate through procs and check xbus chiplets
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Master proc handled in STEP 1
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ continue;
+ }
+ // Don't examine previously marked proc
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ continue;
+ }
+ // If current proc is on master logical node
+ if (l_pMasterProcInfo->procFabricNode ==
+ (*l_procInfoIter)->procFabricNode)
+ {
+ // Check xbus endpoints
+ for (uint8_t i = 0; i < NUM_X_BUSES; i++)
+ {
+ // If endpoint deconfigured and endpoint peer proc is
+ // not already marked deconfigured
+ if (((*l_procInfoIter)->iv_XDeconfigured[i]) &&
+ (!((*l_procInfoIter)->iv_pXProcs[i]->iv_deconfigured)))
+ {
+ // Mark proc with higher HUID to be deconfigured
+ if ((*l_procInfoIter)->iv_pXProcs[i]->procHUID >
+ (*l_procInfoIter)->procHUID)
+ {
+ HWAS_INF("deconfigureAssocProc marked remote proc:"
+ " %.8X for deconfiguration "
+ "due to higher HUID than peer "
+ "proc on same master-containing logical "
+ "node.",
+ (*l_procInfoIter)->iv_pXProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ iv_deconfigured = true;
+ }
+ else
+ {
+ HWAS_INF("deconfigureAssocProc marked proc: "
+ "%.8X for deconfiguration "
+ "due to higher HUID than peer "
+ "proc on same master-containing logical "
+ "node.",
+ (*l_procInfoIter)->procHUID);
+ (*l_procInfoIter)->iv_deconfigured = true;
+ }
+ }
+ }
+ }
+ }// STEP 3
+
+
+ // STEP 4:
+ // If a deconfigured bus connects two procs, both in the same
+ // non-master-containing logical node, mark current proc
+ // deconfigured if there is a same position proc marked deconfigured
+ // in the master logical node, else mark remote proc if there is
+ // a same position proc marked deconfigured in the master logical
+ // node otherwise, mark the proc with the higher HUID.
+
+ // Iterate through procs and, if in non-master
+ // logical node, check xbus chiplets
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Don't examine previously marked proc
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ continue;
+ }
+ // Don't examine procs on master logical node
+ if (l_pMasterProcInfo->procFabricNode ==
+ (*l_procInfoIter)->procFabricNode)
+ {
+ continue;
+ }
+ // Check xbuses because they connect procs which
+ // are in the same logical node
+ for (uint8_t i = 0; i < NUM_X_BUSES; i++)
+ {
+ // If endpoint deconfigured and endpoint peer proc
+ // is not already marked deconfigured
+ if (((*l_procInfoIter)->iv_XDeconfigured[i]) &&
+ (!((*l_procInfoIter)->iv_pXProcs[i]->iv_deconfigured)))
+ {
+ // Variable to indicate If this step results in
+ // finding a proc to mark deconfigured
+ bool l_chipIDmatch = false;
+ // Iterate through procs and examine ones found to
+ // be on the master-containing logical node
+ for (std::vector<ProcInfo *>::const_iterator
+ l_mNodeProcInfoIter = io_procInfo.begin();
+ l_mNodeProcInfoIter != io_procInfo.end();
+ ++l_mNodeProcInfoIter)
+ {
+ if (l_pMasterProcInfo->procFabricNode ==
+ (*l_mNodeProcInfoIter)->procFabricNode)
+ {
+ // If master logical node proc deconfigured with
+ // same FABRIC_CHIP_ID as current proc
+ if (((*l_mNodeProcInfoIter)->iv_deconfigured) &&
+ ((*l_mNodeProcInfoIter)->procFabricChip ==
+ (*l_procInfoIter)->procFabricChip))
+ {
+ // Mark current proc to be deconfigured
+ // and set chipIDmatch
+ HWAS_INF("deconfigureAssocProc marked proc: "
+ "%.8X for deconfiguration "
+ "due to same position deconfigured "
+ "proc on master-containing logical "
+ "node.",
+ (*l_procInfoIter)->procHUID);
+ (*l_procInfoIter)->iv_deconfigured =\
+ true;
+ l_chipIDmatch = true;
+ }
+ // If master logical node proc deconfigured with
+ // same FABRIC_CHIP_ID as current proc's xbus peer
+ // proc
+ else if (((*l_mNodeProcInfoIter)->
+ iv_deconfigured) &&
+ ((*l_mNodeProcInfoIter)->
+ procFabricChip ==
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ procFabricChip))
+ {
+ // Mark peer proc to be deconfigured
+ // and set chipIDmatch
+ HWAS_INF("deconfigureAssocProc marked remote "
+ "proc: %.8X for deconfiguration "
+ "due to same position deconfigured "
+ "proc on master-containing logical "
+ "node.",
+ (*l_procInfoIter)->iv_pXProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ iv_deconfigured = true;
+ l_chipIDmatch = true;
+ }
+ }
+ }
+ // If previous step did not find a proc to mark
+ if (!(l_chipIDmatch))
+ {
+ // Deconfigure proc with higher HUID
+ if ((*l_procInfoIter)->procHUID >
+ (*l_procInfoIter)->iv_pXProcs[i]->procHUID)
+ {
+ HWAS_INF("deconfigureAssocProc marked proc:"
+ " %.8X for deconfiguration "
+ "due to higher HUID than peer "
+ "proc on same non master-containing logical "
+ "node.",
+ (*l_procInfoIter)->procHUID);
+ (*l_procInfoIter)->iv_deconfigured =
+ true;
+ }
+ else
+ {
+ HWAS_INF("deconfigureAssocProc marked remote proc:"
+ " %.8X for deconfiguration "
+ "due to higher HUID than peer "
+ "proc on same non master-containing logical "
+ "node.",
+ (*l_procInfoIter)->iv_pXProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ iv_deconfigured = true;
+ }
+ }
+ }
+ }
+ }// STEP 4
+
+ // STEP 5:
+ // If a deconfigured bus conects two procs on different logical nodes,
+ // and neither proc is the master proc: If current proc's xbus peer
+ // proc is marked as deconfigured, mark current proc. Else, mark
+ // abus peer proc.
+
+ // Iterate through procs and check for deconfigured abus endpoints
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Master proc handled in STEP 1
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ continue;
+ }
+ // Don't examine procs which are already marked
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ continue;
+ }
+ // Check abuses because they connect procs which are in
+ // different logical nodes
+ for (uint8_t i = 0; i < NUM_A_BUSES; i++)
+ {
+ // If endpoint deconfigured and endpoint peer proc
+ // is not already marked deconfigured
+ if (((*l_procInfoIter)->iv_ADeconfigured[i]) &&
+ (!((*l_procInfoIter)->iv_pAProcs[i]->iv_deconfigured)))
+ {
+ // Check XBUS peer
+ bool l_xbusPeerProcDeconfigured = false;
+ for (uint8_t j = 0; j < NUM_X_BUSES; j++)
+ {
+ // If peer proc exists
+ if ((*l_procInfoIter)->iv_pXProcs[j])
+ {
+ // If xbus peer proc deconfigured
+ if ((*l_procInfoIter)->iv_pXProcs[j]->
+ iv_deconfigured)
+ {
+ // Set xbusPeerProcDeconfigured and deconfigure
+ // current proc
+ HWAS_INF("deconfigureAssocProc marked proc:"
+ " %.8X for deconfiguration "
+ "due to deconfigured xbus peer proc.",
+ (*l_procInfoIter)->procHUID);
+ l_xbusPeerProcDeconfigured = true;
+ (*l_procInfoIter)->iv_deconfigured = true;
+ break;
+ }
+ }
+ }
+ // If previous step did not result in marking a proc
+ // mark abus peer proc
+ if (!(l_xbusPeerProcDeconfigured))
+ {
+ HWAS_INF("deconfigureAssocProc marked "
+ "remote proc: %.8X for deconfiguration "
+ "due to functional xbus peer proc.",
+ (*l_procInfoIter)->iv_pAProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pAProcs[i]->
+ iv_deconfigured = true;
+ }
+ }
+ }
+ }// STEP 5
+ }while(0);
+ if (!l_errlHdl)
+ {
+ // Perform SMP node balancing
+ l_errlHdl = _symmetryValidation(io_procInfo);
+ }
+ return l_errlHdl;
+
+}
+
+//******************************************************************************
+
+errlHndl_t DeconfigGard::_symmetryValidation(
+ std::vector<ProcInfo *> &io_procInfo)
+{
+ // Defined for possible use in future applications
+ errlHndl_t l_errlHdl = NULL;
+
+ // Perform SMP node balancing
+ do
+ {
+ // STEP 1:
+ // If a proc is deconfigured in a logical node
+ // containing the master proc, iterate through all procs
+ // and mark as deconfigured those in other logical nodes
+ // with the same FABRIC_CHIP_ID (procFabricChip)
+
+ // Find master proc
+ ProcInfo * l_pMasterProcInfo = NULL;
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // If master proc
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ // Save for subsequent use
+ l_pMasterProcInfo = *l_procInfoIter;
+ break;
+ }
+ }
+ // If no master proc found, abort
+ HWAS_ASSERT(l_pMasterProcInfo, "HWAS _symmetryValidation:"
+ "Master proc not found");
+ // Iterate through procs and check if in master logical node
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // Skip master proc
+ if ((*l_procInfoIter)->iv_isMaster)
+ {
+ continue;
+ }
+ // If current proc is on master logical node
+ // and marked as deconfigured
+ if ((l_pMasterProcInfo->procFabricNode ==
+ (*l_procInfoIter)->procFabricNode) &&
+ ((*l_procInfoIter)->iv_deconfigured))
+ {
+ // Iterate through procs and mark any same-
+ // position procs as deconfigured
+ for (std::vector<ProcInfo *>::const_iterator
+ l_posProcInfoIter = io_procInfo.begin();
+ l_posProcInfoIter != io_procInfo.end();
+ ++l_posProcInfoIter)
+ {
+ if ((*l_procInfoIter)->procFabricChip ==
+ (*l_posProcInfoIter)->procFabricChip)
+ {
+ HWAS_INF("symmetryValidation step 1 marked proc: "
+ "%.8X for deconfiguration.",
+ (*l_posProcInfoIter)->procHUID);
+ (*l_posProcInfoIter)->iv_deconfigured = true;
+ }
+ }
+ }
+ }// STEP 1
+
+ // STEP 2:
+ // If a deconfigured proc is found on a non-master-containing node
+ // and has the same position (FABRIC_CHIP_ID) as a functional
+ // non-master chip on the master logical node,
+ // mark its xbus peer proc(s) for deconfiguration
+
+ // Iterate through procs, if marked deconfigured, compare chip
+ // position to functional chip on master node.
+ for (std::vector<ProcInfo *>::const_iterator
+ l_procInfoIter = io_procInfo.begin();
+ l_procInfoIter != io_procInfo.end();
+ ++l_procInfoIter)
+ {
+ // If proc is marked deconfigured
+ if ((*l_procInfoIter)->iv_deconfigured)
+ {
+ // Iterate through procs, examining those on
+ // the master logical node
+ for (std::vector<ProcInfo *>::const_iterator
+ l_mNodeProcInfoIter = io_procInfo.begin();
+ l_mNodeProcInfoIter != io_procInfo.end();
+ ++l_mNodeProcInfoIter)
+ {
+ // If proc found is on the master-containing logical node
+ // functional, and matches the position of the deconfigured
+ // proc from the outer loop
+ if ((l_pMasterProcInfo->procFabricNode ==
+ (*l_mNodeProcInfoIter)->procFabricNode) &&
+ (!((*l_mNodeProcInfoIter)->iv_deconfigured)) &&
+ ((*l_mNodeProcInfoIter)->procFabricChip ==
+ (*l_procInfoIter)->procFabricChip))
+ {
+ // Find xbus peer proc to mark deconfigured
+ for (uint8_t i = 0; i < NUM_X_BUSES; i++)
+ {
+ // If xbus peer proc exists, mark it
+ if ((*l_procInfoIter)->iv_pXProcs[i])
+ {
+ HWAS_INF("symmetryValidation step 2 "
+ "marked proc: %.8X for "
+ "deconfiguration.",
+ (*l_procInfoIter)->
+ iv_pXProcs[i]->procHUID);
+ (*l_procInfoIter)->iv_pXProcs[i]->
+ iv_deconfigured = true;
+ }
+ }
+ }
+ }
+ }
+ }// STEP 2
+ }while(0);
+ return l_errlHdl;
+}
+
} // namespce HWAS
+
diff --git a/src/usr/hwas/test/hwasGardTest.H b/src/usr/hwas/test/hwasGardTest.H
index 991982c22..c63ed3dcb 100644
--- a/src/usr/hwas/test/hwasGardTest.H
+++ b/src/usr/hwas/test/hwasGardTest.H
@@ -1796,6 +1796,1023 @@ public:
#endif
}
+
+ /**
+ * @brief Test Deconfigure Associated Proc1
+ */
+ void testDeconfigureAssocProc1()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc1: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 1: TULETA 4 System with Master proc's abus1
+ // and proc2 abus1 deconfigured
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 4;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_tuletaProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_tuletaProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Set proc options
+ // Proc0:
+ l_tuletaProcs[0]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[0]->procHUID = 0; // HUID
+ l_tuletaProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_tuletaProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_tuletaProcs[0]->iv_isMaster = true; // Master proc
+ l_tuletaProcs[0]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ // abus1 and 2 linked to proc2
+ l_tuletaProcs[0]->iv_pAProcs[0] = l_tuletaProcs[2];
+ l_tuletaProcs[0]->iv_pAProcs[1] = l_tuletaProcs[2];
+ // abus1 endpoint deconfigured
+ l_tuletaProcs[0]->iv_ADeconfigured[0] = true;
+ // XBus links and states
+ l_tuletaProcs[0]->iv_pXProcs[0] = l_tuletaProcs[1];
+
+ // Proc1:
+ l_tuletaProcs[1]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[1]->procHUID = 1; // HUID
+ l_tuletaProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_tuletaProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_tuletaProcs[1]->iv_isMaster = false; // Not master proc
+ l_tuletaProcs[1]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[1]->iv_pAProcs[0] = l_tuletaProcs[3];
+ l_tuletaProcs[1]->iv_pAProcs[1] = l_tuletaProcs[3];
+ // XBus links and states
+ l_tuletaProcs[1]->iv_pXProcs[0] = l_tuletaProcs[0];
+
+ // Proc2:
+ l_tuletaProcs[2]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[2]->procHUID = 2; // HUID
+ l_tuletaProcs[2]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_tuletaProcs[2]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_tuletaProcs[2]->iv_isMaster = false; // Not master proc
+ l_tuletaProcs[2]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[2]->iv_pAProcs[0] = l_tuletaProcs[0];
+ l_tuletaProcs[2]->iv_pAProcs[1] = l_tuletaProcs[0];
+ l_tuletaProcs[2]->iv_ADeconfigured[0] = true;
+ // XBus links and states
+ l_tuletaProcs[2]->iv_pXProcs[0] = l_tuletaProcs[3];
+
+ // Proc3:
+ l_tuletaProcs[3]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[3]->procHUID = 3; // HUID
+ l_tuletaProcs[3]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_tuletaProcs[3]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_tuletaProcs[3]->iv_isMaster = false; // Not master proc
+ l_tuletaProcs[3]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[3]->iv_pAProcs[0] = l_tuletaProcs[1];
+ l_tuletaProcs[3]->iv_pAProcs[1] = l_tuletaProcs[2];
+ // XBus links and states
+ l_tuletaProcs[3]->iv_pXProcs[0] = l_tuletaProcs[2];
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_tuletaProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_tuletaProcs[0]->iv_deconfigured == false &&
+ l_tuletaProcs[1]->iv_deconfigured == false &&
+ l_tuletaProcs[2]->iv_deconfigured == true &&
+ l_tuletaProcs[3]->iv_deconfigured == true)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc1: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc1: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_tuletaProcs.empty()) delete l_tuletaProcs.back(),
+ l_tuletaProcs.pop_back();
+ }
+
+
+ /**
+ * @brief Test Deconfigure Associated Proc2
+ */
+ void testDeconfigureAssocProc2()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc2: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 2: TULETA 4 System with Master proc's xbus1
+ // and proc3's xbus1 deconfigured, where the Master is
+ // proc2
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 4;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_tuletaProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_tuletaProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Proc0:
+ l_tuletaProcs[0]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[0]->procHUID = 0; // HUID
+ l_tuletaProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_tuletaProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_tuletaProcs[0]->iv_isMaster = false; // Note master proc
+ l_tuletaProcs[0]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[0]->iv_pAProcs[0] = l_tuletaProcs[2];
+ l_tuletaProcs[0]->iv_pAProcs[1] = l_tuletaProcs[2];
+ // XBus links and states
+ l_tuletaProcs[0]->iv_pXProcs[0] = l_tuletaProcs[1];
+
+ // Proc1:
+ l_tuletaProcs[1]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[1]->procHUID = 1; // HUID
+ l_tuletaProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_tuletaProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_tuletaProcs[1]->iv_isMaster = false; // Not master proc
+ l_tuletaProcs[1]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[1]->iv_pAProcs[0] = l_tuletaProcs[3];
+ l_tuletaProcs[1]->iv_pAProcs[1] = l_tuletaProcs[3];
+ // XBus links and states
+ l_tuletaProcs[1]->iv_pXProcs[0] = l_tuletaProcs[0];
+
+ // Proc2:
+ l_tuletaProcs[2]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[2]->procHUID = 2; // HUID
+ l_tuletaProcs[2]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_tuletaProcs[2]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_tuletaProcs[2]->iv_isMaster = true; // Master proc
+ l_tuletaProcs[2]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[2]->iv_pAProcs[0] = l_tuletaProcs[0];
+ l_tuletaProcs[2]->iv_pAProcs[1] = l_tuletaProcs[0];
+ // XBus links and states
+ l_tuletaProcs[2]->iv_pXProcs[0] = l_tuletaProcs[3];
+ l_tuletaProcs[2]->iv_XDeconfigured[0] = true;
+
+ // Proc3:
+ l_tuletaProcs[3]->iv_pThisProc = NULL; // Target *
+ l_tuletaProcs[3]->procHUID = 3; // HUID
+ l_tuletaProcs[3]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_tuletaProcs[3]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_tuletaProcs[3]->iv_isMaster = false; // Not master proc
+ l_tuletaProcs[3]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_tuletaProcs[3]->iv_pAProcs[0] = l_tuletaProcs[1];
+ l_tuletaProcs[3]->iv_pAProcs[1] = l_tuletaProcs[1];
+ // XBus links and states
+ l_tuletaProcs[3]->iv_pXProcs[0] = l_tuletaProcs[2];
+ l_tuletaProcs[3]->iv_XDeconfigured[0] = true;
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_tuletaProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_tuletaProcs[0]->iv_deconfigured == false &&
+ l_tuletaProcs[1]->iv_deconfigured == true &&
+ l_tuletaProcs[2]->iv_deconfigured == false &&
+ l_tuletaProcs[3]->iv_deconfigured == true)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc2: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc2: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_tuletaProcs.empty()) delete l_tuletaProcs.back(),
+ l_tuletaProcs.pop_back();
+ }
+
+ /**
+ * @brief Test Deconfigure Associated Proc3
+ */
+ void testDeconfigureAssocProc3()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc3: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 3: ORLENA System with Master and proc1's
+ // xbus1 deconfigured
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 8;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_orlenaProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_orlenaProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Proc0:
+ l_orlenaProcs[0]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[0]->procHUID = 0; // HUID
+ l_orlenaProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[0]->iv_isMaster = true; // Master proc
+ l_orlenaProcs[0]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[0]->iv_pAProcs[0] = l_orlenaProcs[2];
+ l_orlenaProcs[0]->iv_pAProcs[1] = l_orlenaProcs[4];
+ l_orlenaProcs[0]->iv_pAProcs[2] = l_orlenaProcs[6];
+ // XBus links and states
+ l_orlenaProcs[0]->iv_pXProcs[0] = l_orlenaProcs[1];
+ l_orlenaProcs[0]->iv_XDeconfigured[0] = true;
+
+ // Proc1:
+ l_orlenaProcs[1]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[1]->procHUID = 1; // HUID
+ l_orlenaProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[1]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[1]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[1]->iv_pAProcs[0] = l_orlenaProcs[5];
+ l_orlenaProcs[1]->iv_pAProcs[1] = l_orlenaProcs[7];
+ l_orlenaProcs[1]->iv_pAProcs[2] = l_orlenaProcs[3];
+ // XBus links and states
+ l_orlenaProcs[1]->iv_pXProcs[0] = l_orlenaProcs[0];
+ l_orlenaProcs[1]->iv_XDeconfigured[0] = true;
+
+ // Proc2:
+ l_orlenaProcs[2]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[2]->procHUID = 2; // HUID
+ l_orlenaProcs[2]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[2]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[2]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[2]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[2]->iv_pAProcs[0] = l_orlenaProcs[0];
+ l_orlenaProcs[2]->iv_pAProcs[1] = l_orlenaProcs[6];
+ l_orlenaProcs[2]->iv_pAProcs[2] = l_orlenaProcs[4];
+ // XBus links and states
+ l_orlenaProcs[2]->iv_pXProcs[0] = l_orlenaProcs[3];
+
+ // Proc3:
+ l_orlenaProcs[3]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[3]->procHUID = 3; // HUID
+ l_orlenaProcs[3]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[3]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[3]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[3]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[3]->iv_pAProcs[0] = l_orlenaProcs[7];
+ l_orlenaProcs[3]->iv_pAProcs[1] = l_orlenaProcs[5];
+ l_orlenaProcs[3]->iv_pAProcs[2] = l_orlenaProcs[1];
+ // XBus links and states
+ l_orlenaProcs[3]->iv_pXProcs[0] = l_orlenaProcs[2];
+
+ // Proc4:
+ l_orlenaProcs[4]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[4]->procHUID = 4; // HUID
+ l_orlenaProcs[4]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[4]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[4]->iv_isMaster = false; // Master proc
+ l_orlenaProcs[4]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[4]->iv_pAProcs[0] = l_orlenaProcs[6];
+ l_orlenaProcs[4]->iv_pAProcs[1] = l_orlenaProcs[0];
+ l_orlenaProcs[4]->iv_pAProcs[2] = l_orlenaProcs[2];
+ // XBus links and states
+ l_orlenaProcs[4]->iv_pXProcs[0] = l_orlenaProcs[5];
+
+ // Proc5:
+ l_orlenaProcs[5]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[5]->procHUID = 5; // HUID
+ l_orlenaProcs[5]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[5]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[5]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[5]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[5]->iv_pAProcs[0] = l_orlenaProcs[1];
+ l_orlenaProcs[5]->iv_pAProcs[1] = l_orlenaProcs[3];
+ l_orlenaProcs[5]->iv_pAProcs[2] = l_orlenaProcs[7];
+ // XBus links and states
+ l_orlenaProcs[5]->iv_pXProcs[0] = l_orlenaProcs[4];
+
+ // Proc6:
+ l_orlenaProcs[6]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[6]->procHUID = 6; // HUID
+ l_orlenaProcs[6]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[6]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[6]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[6]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[6]->iv_pAProcs[0] = l_orlenaProcs[4];
+ l_orlenaProcs[6]->iv_pAProcs[1] = l_orlenaProcs[2];
+ l_orlenaProcs[6]->iv_pAProcs[2] = l_orlenaProcs[0];
+ // XBus links and states
+ l_orlenaProcs[6]->iv_pXProcs[0] = l_orlenaProcs[7];
+
+ // Proc7:
+ l_orlenaProcs[7]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[7]->procHUID = 7; // HUID
+ l_orlenaProcs[7]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[7]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[7]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[7]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[7]->iv_pAProcs[0] = l_orlenaProcs[3];
+ l_orlenaProcs[7]->iv_pAProcs[1] = l_orlenaProcs[1];
+ l_orlenaProcs[7]->iv_pAProcs[2] = l_orlenaProcs[5];
+ // XBus links and states
+ l_orlenaProcs[7]->iv_pXProcs[0] = l_orlenaProcs[6];
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_orlenaProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_orlenaProcs[0]->iv_deconfigured == false &&
+ l_orlenaProcs[1]->iv_deconfigured == true &&
+ l_orlenaProcs[2]->iv_deconfigured == false &&
+ l_orlenaProcs[3]->iv_deconfigured == true &&
+ l_orlenaProcs[4]->iv_deconfigured == false &&
+ l_orlenaProcs[5]->iv_deconfigured == true &&
+ l_orlenaProcs[6]->iv_deconfigured == false &&
+ l_orlenaProcs[7]->iv_deconfigured == true)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc3: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc3: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_orlenaProcs.empty()) delete l_orlenaProcs.back(),
+ l_orlenaProcs.pop_back();
+ }
+
+
+ /**
+ * @brief Test Deconfigure Associated Proc4
+ */
+ void testDeconfigureAssocProc4()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc4: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 4: ORLENA System with proc6/7xbus1 and
+ // proc2/4 abus2 deconfigured
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 8;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_orlenaProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_orlenaProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Proc0:
+ l_orlenaProcs[0]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[0]->procHUID = 0; // HUID
+ l_orlenaProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[0]->iv_isMaster = true; // Master proc
+ l_orlenaProcs[0]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[0]->iv_pAProcs[0] = l_orlenaProcs[2];
+ l_orlenaProcs[0]->iv_pAProcs[1] = l_orlenaProcs[4];
+ l_orlenaProcs[0]->iv_pAProcs[2] = l_orlenaProcs[6];
+ // XBus links and states
+ l_orlenaProcs[0]->iv_pXProcs[0] = l_orlenaProcs[1];
+
+ // Proc1:
+ l_orlenaProcs[1]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[1]->procHUID = 1; // HUID
+ l_orlenaProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[1]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[1]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[1]->iv_pAProcs[0] = l_orlenaProcs[5];
+ l_orlenaProcs[1]->iv_pAProcs[1] = l_orlenaProcs[7];
+ l_orlenaProcs[1]->iv_pAProcs[2] = l_orlenaProcs[3];
+ // XBus links and states
+ l_orlenaProcs[1]->iv_pXProcs[0] = l_orlenaProcs[0];
+
+ // Proc2:
+ l_orlenaProcs[2]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[2]->procHUID = 2; // HUID
+ l_orlenaProcs[2]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[2]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[2]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[2]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[2]->iv_pAProcs[0] = l_orlenaProcs[0];
+ l_orlenaProcs[2]->iv_pAProcs[1] = l_orlenaProcs[6];
+ l_orlenaProcs[2]->iv_pAProcs[2] = l_orlenaProcs[4];
+ l_orlenaProcs[2]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[2]->iv_pXProcs[0] = l_orlenaProcs[3];
+
+ // Proc3:
+ l_orlenaProcs[3]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[3]->procHUID = 3; // HUID
+ l_orlenaProcs[3]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[3]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[3]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[3]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[3]->iv_pAProcs[0] = l_orlenaProcs[7];
+ l_orlenaProcs[3]->iv_pAProcs[1] = l_orlenaProcs[5];
+ l_orlenaProcs[3]->iv_pAProcs[2] = l_orlenaProcs[1];
+ // XBus links and states
+ l_orlenaProcs[3]->iv_pXProcs[0] = l_orlenaProcs[2];
+
+ // Proc4:
+ l_orlenaProcs[4]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[4]->procHUID = 4; // HUID
+ l_orlenaProcs[4]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[4]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[4]->iv_isMaster = false; // Master proc
+ l_orlenaProcs[4]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[4]->iv_pAProcs[0] = l_orlenaProcs[6];
+ l_orlenaProcs[4]->iv_pAProcs[1] = l_orlenaProcs[0];
+ l_orlenaProcs[4]->iv_pAProcs[2] = l_orlenaProcs[2];
+ l_orlenaProcs[4]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[4]->iv_pXProcs[0] = l_orlenaProcs[5];
+
+ // Proc5:
+ l_orlenaProcs[5]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[5]->procHUID = 5; // HUID
+ l_orlenaProcs[5]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[5]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[5]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[5]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[5]->iv_pAProcs[0] = l_orlenaProcs[1];
+ l_orlenaProcs[5]->iv_pAProcs[1] = l_orlenaProcs[3];
+ l_orlenaProcs[5]->iv_pAProcs[2] = l_orlenaProcs[7];
+ // XBus links and states
+ l_orlenaProcs[5]->iv_pXProcs[0] = l_orlenaProcs[4];
+
+ // Proc6:
+ l_orlenaProcs[6]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[6]->procHUID = 6; // HUID
+ l_orlenaProcs[6]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[6]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[6]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[6]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[6]->iv_pAProcs[0] = l_orlenaProcs[4];
+ l_orlenaProcs[6]->iv_pAProcs[1] = l_orlenaProcs[2];
+ l_orlenaProcs[6]->iv_pAProcs[2] = l_orlenaProcs[0];
+ // XBus links and states
+ l_orlenaProcs[6]->iv_pXProcs[0] = l_orlenaProcs[7];
+ l_orlenaProcs[6]->iv_XDeconfigured[0] = true;
+
+ // Proc7:
+ l_orlenaProcs[7]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[7]->procHUID = 7; // HUID
+ l_orlenaProcs[7]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[7]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[7]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[7]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[7]->iv_pAProcs[0] = l_orlenaProcs[3];
+ l_orlenaProcs[7]->iv_pAProcs[1] = l_orlenaProcs[1];
+ l_orlenaProcs[7]->iv_pAProcs[2] = l_orlenaProcs[5];
+ // XBus links and states
+ l_orlenaProcs[7]->iv_pXProcs[0] = l_orlenaProcs[6];
+ l_orlenaProcs[7]->iv_XDeconfigured[0] = true;
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_orlenaProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_orlenaProcs[0]->iv_deconfigured == false &&
+ l_orlenaProcs[1]->iv_deconfigured == false &&
+ l_orlenaProcs[2]->iv_deconfigured == false &&
+ l_orlenaProcs[3]->iv_deconfigured == false &&
+ l_orlenaProcs[4]->iv_deconfigured == true &&
+ l_orlenaProcs[5]->iv_deconfigured == true &&
+ l_orlenaProcs[6]->iv_deconfigured == true &&
+ l_orlenaProcs[7]->iv_deconfigured == true)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc4: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc4: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_orlenaProcs.empty()) delete l_orlenaProcs.back(),
+ l_orlenaProcs.pop_back();
+ }
+
+
+ /**
+ * @brief Test Deconfigure Associated Proc5
+ */
+ void testDeconfigureAssocProc5()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc5: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 5: ORLENA System with proc4 deconfigured (and
+ // proc4's chiplets and peers deconfigured by association),
+ // and proc5-abus2 / proc7-abus2 deconfigured.
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 8;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_orlenaProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_orlenaProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Proc0:
+ l_orlenaProcs[0]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[0]->procHUID = 0; // HUID
+ l_orlenaProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[0]->iv_isMaster = true; // Master proc
+ l_orlenaProcs[0]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[0]->iv_pAProcs[0] = l_orlenaProcs[2];
+ l_orlenaProcs[0]->iv_pAProcs[1] = l_orlenaProcs[4];
+ l_orlenaProcs[0]->iv_pAProcs[2] = l_orlenaProcs[6];
+ l_orlenaProcs[4]->iv_ADeconfigured[1] = true;
+ // XBus links and states
+ l_orlenaProcs[0]->iv_pXProcs[0] = l_orlenaProcs[1];
+
+ // Proc1:
+ l_orlenaProcs[1]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[1]->procHUID = 1; // HUID
+ l_orlenaProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_orlenaProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[1]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[1]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[1]->iv_pAProcs[0] = l_orlenaProcs[5];
+ l_orlenaProcs[1]->iv_pAProcs[1] = l_orlenaProcs[7];
+ l_orlenaProcs[1]->iv_pAProcs[2] = l_orlenaProcs[3];
+ // XBus links and states
+ l_orlenaProcs[1]->iv_pXProcs[0] = l_orlenaProcs[0];
+
+ // Proc2:
+ l_orlenaProcs[2]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[2]->procHUID = 2; // HUID
+ l_orlenaProcs[2]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[2]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[2]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[2]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[2]->iv_pAProcs[0] = l_orlenaProcs[0];
+ l_orlenaProcs[2]->iv_pAProcs[1] = l_orlenaProcs[6];
+ l_orlenaProcs[2]->iv_pAProcs[2] = l_orlenaProcs[4];
+ l_orlenaProcs[2]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[2]->iv_pXProcs[0] = l_orlenaProcs[3];
+
+ // Proc3:
+ l_orlenaProcs[3]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[3]->procHUID = 3; // HUID
+ l_orlenaProcs[3]->procFabricNode = 1; // FABRIC_NODE_ID
+ l_orlenaProcs[3]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[3]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[3]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[3]->iv_pAProcs[0] = l_orlenaProcs[7];
+ l_orlenaProcs[3]->iv_pAProcs[1] = l_orlenaProcs[5];
+ l_orlenaProcs[3]->iv_pAProcs[2] = l_orlenaProcs[1];
+ // XBus links and states
+ l_orlenaProcs[3]->iv_pXProcs[0] = l_orlenaProcs[2];
+
+ // Proc4:
+ l_orlenaProcs[4]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[4]->procHUID = 4; // HUID
+ l_orlenaProcs[4]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[4]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[4]->iv_isMaster = false; // Master proc
+ l_orlenaProcs[4]->iv_deconfigured = true; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[4]->iv_pAProcs[0] = l_orlenaProcs[6];
+ l_orlenaProcs[4]->iv_pAProcs[1] = l_orlenaProcs[0];
+ l_orlenaProcs[4]->iv_pAProcs[2] = l_orlenaProcs[2];
+ l_orlenaProcs[4]->iv_ADeconfigured[0] = true;
+ l_orlenaProcs[4]->iv_ADeconfigured[1] = true;
+ l_orlenaProcs[4]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[4]->iv_pXProcs[0] = l_orlenaProcs[5];
+ l_orlenaProcs[4]->iv_XDeconfigured[0] = true;
+
+ // Proc5:
+ l_orlenaProcs[5]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[5]->procHUID = 5; // HUID
+ l_orlenaProcs[5]->procFabricNode = 2; // FABRIC_NODE_ID
+ l_orlenaProcs[5]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[5]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[5]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[5]->iv_pAProcs[0] = l_orlenaProcs[1];
+ l_orlenaProcs[5]->iv_pAProcs[1] = l_orlenaProcs[3];
+ l_orlenaProcs[5]->iv_pAProcs[2] = l_orlenaProcs[7];
+ l_orlenaProcs[5]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[5]->iv_pXProcs[0] = l_orlenaProcs[4];
+ l_orlenaProcs[5]->iv_XDeconfigured[0] = true;
+
+ // Proc6:
+ l_orlenaProcs[6]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[6]->procHUID = 6; // HUID
+ l_orlenaProcs[6]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[6]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_orlenaProcs[6]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[6]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[6]->iv_pAProcs[0] = l_orlenaProcs[4];
+ l_orlenaProcs[6]->iv_pAProcs[1] = l_orlenaProcs[2];
+ l_orlenaProcs[6]->iv_pAProcs[2] = l_orlenaProcs[0];
+ l_orlenaProcs[6]->iv_ADeconfigured[0] = true;
+ // XBus links and states
+ l_orlenaProcs[6]->iv_pXProcs[0] = l_orlenaProcs[7];
+
+ // Proc7:
+ l_orlenaProcs[7]->iv_pThisProc = NULL; // Target *
+ l_orlenaProcs[7]->procHUID = 7; // HUID
+ l_orlenaProcs[7]->procFabricNode = 3; // FABRIC_NODE_ID
+ l_orlenaProcs[7]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_orlenaProcs[7]->iv_isMaster = false; // Not master proc
+ l_orlenaProcs[7]->iv_deconfigured = false; // HWAS state
+ // ABus links and states
+ l_orlenaProcs[7]->iv_pAProcs[0] = l_orlenaProcs[3];
+ l_orlenaProcs[7]->iv_pAProcs[1] = l_orlenaProcs[1];
+ l_orlenaProcs[7]->iv_pAProcs[2] = l_orlenaProcs[5];
+ l_orlenaProcs[7]->iv_ADeconfigured[2] = true;
+ // XBus links and states
+ l_orlenaProcs[7]->iv_pXProcs[0] = l_orlenaProcs[6];
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_orlenaProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_orlenaProcs[0]->iv_deconfigured == false &&
+ l_orlenaProcs[1]->iv_deconfigured == false &&
+ l_orlenaProcs[2]->iv_deconfigured == false &&
+ l_orlenaProcs[3]->iv_deconfigured == false &&
+ l_orlenaProcs[4]->iv_deconfigured == true &&
+ l_orlenaProcs[5]->iv_deconfigured == true &&
+ l_orlenaProcs[6]->iv_deconfigured == false &&
+ l_orlenaProcs[7]->iv_deconfigured == false)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc5: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc5: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_orlenaProcs.empty()) delete l_orlenaProcs.back(),
+ l_orlenaProcs.pop_back();
+ }
+
+
+ /**
+ * @brief Test Deconfigure Associated Proc6
+ */
+ void testDeconfigureAssocProc6()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc6: Started");
+
+ // This test populates structs which contain information
+ // regarding a processor and its child chiplet's linkage
+ // and states. A vector of these structs, effectively
+ // describing the system, is passed to the
+ // _deconfigureAssocProc algorithm which marks procs to
+ // be deconfigured based on existing bus deconfigurations.
+
+ // SCENARIO 6: BRAZOS System with proc0xbus0
+ // and proc1xbus3 deconfigured
+ // Note that procs in BRAZOS have xbus0,xbus1,
+ // and xbus3 chiplets as defined by the mrw.xml file.
+
+ // Return error for _deconfigureAssocProc
+ errlHndl_t l_pErr = NULL;
+
+ // User-defined number of procs
+ uint8_t NUM_PROCS = 4;
+
+ // Define and populate vector
+ std::vector<DeconfigGard::ProcInfo *> l_brazosProcs(NUM_PROCS);
+
+ for (uint8_t i = 0; i < NUM_PROCS; i++)
+ {
+ l_brazosProcs[i] = new DeconfigGard::ProcInfo();
+ }
+
+ // Set proc options
+ // Proc0:
+ l_brazosProcs[0]->iv_pThisProc = NULL; // Target *
+ l_brazosProcs[0]->procHUID = 0; // HUID
+ l_brazosProcs[0]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_brazosProcs[0]->procFabricChip = 0; // FABRIC_CHIP_ID
+ l_brazosProcs[0]->iv_isMaster = true; // Master proc
+ l_brazosProcs[0]->iv_deconfigured = false; // HWAS state
+ // XBus links and states
+ l_brazosProcs[0]->iv_pXProcs[0] = l_brazosProcs[1];
+ l_brazosProcs[0]->iv_pXProcs[1] = l_brazosProcs[2];
+ l_brazosProcs[0]->iv_pXProcs[3] = l_brazosProcs[3];
+ l_brazosProcs[0]->iv_XDeconfigured[0] = true;
+
+ // Proc1:
+ l_brazosProcs[1]->iv_pThisProc = NULL; // Target *
+ l_brazosProcs[1]->procHUID = 1; // HUID
+ l_brazosProcs[1]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_brazosProcs[1]->procFabricChip = 1; // FABRIC_CHIP_ID
+ l_brazosProcs[1]->iv_isMaster = false; // Not master proc
+ l_brazosProcs[1]->iv_deconfigured = false; // HWAS state
+ // XBus links and states
+ // XBus links and states
+ l_brazosProcs[1]->iv_pXProcs[0] = l_brazosProcs[2];
+ l_brazosProcs[1]->iv_pXProcs[1] = l_brazosProcs[3];
+ l_brazosProcs[1]->iv_pXProcs[3] = l_brazosProcs[0];
+ l_brazosProcs[1]->iv_XDeconfigured[3] = true;
+
+ // Proc2:
+ l_brazosProcs[2]->iv_pThisProc = NULL; // Target *
+ l_brazosProcs[2]->procHUID = 2; // HUID
+ l_brazosProcs[2]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_brazosProcs[2]->procFabricChip = 2; // FABRIC_CHIP_ID
+ l_brazosProcs[2]->iv_isMaster = false; // Not master proc
+ l_brazosProcs[2]->iv_deconfigured = false; // HWAS state
+ // XBus links and states
+ l_brazosProcs[2]->iv_pXProcs[0] = l_brazosProcs[3];
+ l_brazosProcs[2]->iv_pXProcs[1] = l_brazosProcs[0];
+ l_brazosProcs[2]->iv_pXProcs[3] = l_brazosProcs[1];
+
+ // Proc3:
+ l_brazosProcs[3]->iv_pThisProc = NULL; // Target *
+ l_brazosProcs[3]->procHUID = 3; // HUID
+ l_brazosProcs[3]->procFabricNode = 0; // FABRIC_NODE_ID
+ l_brazosProcs[3]->procFabricChip = 3; // FABRIC_CHIP_ID
+ l_brazosProcs[3]->iv_isMaster = false; // Not master proc
+ l_brazosProcs[3]->iv_deconfigured = false; // HWAS state
+ // XBus links and states
+ l_brazosProcs[3]->iv_pXProcs[0] = l_brazosProcs[0];
+ l_brazosProcs[3]->iv_pXProcs[1] = l_brazosProcs[1];
+ l_brazosProcs[3]->iv_pXProcs[3] = l_brazosProcs[2];
+
+ // Call _deconfigureAssocProc to determine which procs
+ // should be deconfigured based on state of system passed in
+ l_pErr = DeconfigGard::_deconfigureAssocProc(l_brazosProcs);
+ if (l_pErr)
+ {
+ HWAS_ERR("Error from _deconfigureAssocProc ");
+ }
+
+ // Check result
+ if (l_brazosProcs[0]->iv_deconfigured == false &&
+ l_brazosProcs[1]->iv_deconfigured == true &&
+ l_brazosProcs[2]->iv_deconfigured == false &&
+ l_brazosProcs[3]->iv_deconfigured == false)
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc6: Success");
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc6: incorrect configuration returned");
+ }
+ // Free previously allocated memory
+ while(!l_brazosProcs.empty()) delete l_brazosProcs.back(),
+ l_brazosProcs.pop_back();
+ }
+
+
+ /**
+ * @brief Test Deconfigure Associated Proc7
+ */
+ void testDeconfigureAssocProc7()
+ {
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc7: Started");
+#if 1
+ // This test deconfigures proc2-xbus1 and proc3-xbus1 in a
+ // TULETA-2S4U system. Even though this test
+ // restores their states after the test, since the cxxtests are
+ // all run in parallel, during the time that a target is non-
+ // functional due to this test, another test may be running that
+ // might be adversly affected.
+ // tests are left in the code so that a developer can enable them
+ // to test these specific functions - just keep in mind that there
+ // could be side effects in other cxxtests.
+ TS_TRACE( " - SKIPPING -- other tests could be adversly affected");
+#else
+
+ errlHndl_t l_pErr = NULL;
+
+ do
+ {
+ // Define and populate vector of present procs
+ // Get top level target
+ TARGETING::Target * l_pSys;
+ TARGETING::targetService().getTopLevelTarget(l_pSys);
+ // Define predicate
+ TARGETING::PredicateCTM predProc(TARGETING::CLASS_CHIP,
+ TARGETING::TYPE_PROC);
+ TARGETING::PredicateHwas predPres;
+ predPres.present(true);
+ TARGETING::PredicatePostfixExpr presProc;
+ presProc.push(&predProc).push(&predPres).And();
+ // Populate vector
+ TARGETING::TargetHandleList l_presProcs;
+ TARGETING::targetService().getAssociated(l_presProcs,
+ l_pSys,
+ TARGETING::TargetService::CHILD,
+ TARGETING::TargetService::ALL,
+ &presProc);
+ // Define HUIDs of targets to deconfigure based on
+ // 4-proc configuration in simics_MURANO.system.xml
+ ATTR_HUID_type l_proc2Xbus1HUID = 0x000E0009;
+ ATTR_HUID_type l_proc3Xbus1HUID = 0x000E000D;
+ // Define targeting*'s corresponding to HUIDs above
+ TARGETING::Target * l_pProc2Xbus1;
+ TARGETING::Target * l_pProc3Xbus1;
+ // Define targets' original states corresponding to HUIDs above
+ HwasState l_proc2Xbus1OrigState;
+ HwasState l_proc3Xbus1OrigState;
+ // Define vector of present bus endpoint chiplets
+ TARGETING::PredicateCTM predXbus(TARGETING::CLASS_UNIT,
+ TARGETING::TYPE_XBUS);
+ TARGETING::PredicateCTM predAbus(TARGETING::CLASS_UNIT,
+ TARGETING::TYPE_ABUS);
+ TARGETING::PredicatePostfixExpr busPres;
+ busPres.push(&predXbus).push(&predAbus).Or().push(&predPres).And();
+ // Counter to keep track of deconfigureTarget calls
+ uint8_t deconfigureTargetCallCounter = 0;
+ // Iterate through present procs
+ for (TARGETING::TargetHandleList::const_iterator
+ l_procsIter = l_presProcs.begin();
+ l_procsIter != l_presProcs.end();
+ ++l_procsIter)
+ {
+ // Populate vector of bus endpoints associated with this proc
+ TARGETING::TargetHandleList l_presentBusChiplets;
+ TARGETING::targetService().getAssociated(l_presentBusChiplets,
+ (*l_procsIter),
+ TARGETING::TargetService::CHILD,
+ TARGETING::TargetService::ALL,
+ &busPres);
+
+ // Iterate through present bus endpoint chiplets
+ for (TARGETING::TargetHandleList::iterator
+ l_busIter = l_presentBusChiplets.begin();
+ l_busIter != l_presentBusChiplets.end();
+ ++l_busIter)
+ {
+ if (l_proc2Xbus1HUID == get_huid(*l_busIter))
+ {
+ // Save target
+ l_pProc2Xbus1 = (*l_busIter);
+ // Get the original HWAS_STATE of the target
+ l_proc2Xbus1OrigState = l_pProc2Xbus1->
+ getAttr<ATTR_HWAS_STATE>();
+ // Deconfigure the target.
+ l_pErr = theDeconfigGard().
+ deconfigureTarget(*l_pProc2Xbus1,
+ DeconfigGard::DECONFIGURED_BY_BUS_DECONFIG);
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssocProc7: "
+ "Could not deconfigure proc2xbus1");
+ break;
+ }
+ deconfigureTargetCallCounter++;
+ }
+ if (l_proc3Xbus1HUID == get_huid(*l_busIter))
+ {
+ // Save target
+ l_pProc3Xbus1 = (*l_busIter);
+ // Get the original HWAS_STATE of the target
+ l_proc3Xbus1OrigState = l_pProc3Xbus1->
+ getAttr<ATTR_HWAS_STATE>();
+ // Deconfigure the target.
+ l_pErr = theDeconfigGard().
+ deconfigureTarget(*l_pProc3Xbus1,
+ DeconfigGard::DECONFIGURED_BY_BUS_DECONFIG);
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssocProc7: "
+ "Could not deconfigure proc3xbus1");
+ break;
+ }
+ deconfigureTargetCallCounter++;
+ }
+ }
+ }
+ // If both targets were deconfigured
+ if (2 == deconfigureTargetCallCounter)
+ {
+ // Call deconfigureAssocProc()
+ l_pErr = theDeconfigGard().deconfigureAssocProc();
+ if (l_pErr)
+ {
+ TS_FAIL("testDeconfigureAssocProc7: "
+ "Error from deconfigureAssocProc");
+ break;
+ }
+ TS_TRACE(INFO_MRK "testDeconfigureAssocProc7: Success");
+ // Reset the HWAS_STATE of the targets
+ l_pProc2Xbus1->setAttr<ATTR_HWAS_STATE>(l_proc2Xbus1OrigState);
+ l_pProc3Xbus1->setAttr<ATTR_HWAS_STATE>(l_proc3Xbus1OrigState);
+ }
+ else
+ {
+ TS_FAIL("testDeconfigureAssocProc7: "
+ "Not all xbuses were deconfigured");
+ }
+ }while (0);
+#endif
+ }
};
#endif
OpenPOWER on IntegriCloud