diff options
author | spashabk-in <shakeebbk@in.ibm.com> | 2016-11-08 05:43:34 -0600 |
---|---|---|
committer | AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> | 2016-12-02 04:28:08 -0500 |
commit | 2dc7ab8f6d79749396dc913088e21fff6fc1822e (patch) | |
tree | 11b18eaa6b5648cd1c3d007c7aa0ce6cc73ec9fd /src | |
parent | 7e9ef2247c142869c58d7fe3ffac8a0bb1cdb12f (diff) | |
download | talos-sbe-2dc7ab8f6d79749396dc913088e21fff6fc1822e.tar.gz talos-sbe-2dc7ab8f6d79749396dc913088e21fff6fc1822e.zip |
SBE tracearray chip-op
Change-Id: Ic01d96424c2459c56d4cb7578cf87f592b748466
RTC:128332
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32359
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sbefw/sbe_sp_intf.H | 13 | ||||
-rw-r--r-- | src/sbefw/sbecmdparser.C | 22 | ||||
-rw-r--r-- | src/sbefw/sbecmdtracearray.C | 91 | ||||
-rw-r--r-- | src/sbefw/sbecmdtracearray.H | 55 | ||||
-rw-r--r-- | src/sbefw/sbefwfiles.mk | 1 | ||||
-rwxr-xr-x | src/test/testcases/test.xml | 1 | ||||
-rw-r--r-- | src/test/testcases/testArrayAccess.xml | 30 | ||||
-rw-r--r-- | src/test/testcases/testTraceArray.py | 60 |
8 files changed, 269 insertions, 4 deletions
diff --git a/src/sbefw/sbe_sp_intf.H b/src/sbefw/sbe_sp_intf.H index f3563f7a..348d50ba 100644 --- a/src/sbefw/sbe_sp_intf.H +++ b/src/sbefw/sbe_sp_intf.H @@ -137,8 +137,7 @@ enum sbeRegisterAccessCommands enum sbeArrayAccessCommands { SBE_CMD_GET_FAST_ARRAY = 0x01, /* Get Fast Array */ - SBE_CMD_GET_TRACE_ARRAY = 0x02, /* Get Trace Array */ - SBE_CMD_CONTROL_TRACE_ARRAY = 0x03, /* Control Trace Array */ + SBE_CMD_CONTROL_TRACE_ARRAY = 0x02, /* Control Trace Array */ }; /** @@ -268,8 +267,7 @@ enum GET_REGISTER_SUPPPORTED = 0xA5000001, PUT_REGISTER_SUPPPORTED = 0xA5000002, READ_FAST_ARRAY_SUPPPORTED = 0xA6000001, - READ_TRACE_ARRAY_SUPPPORTED = 0xA6000002, - COLLECT_TRACE_ARRAY_SUPPPORTED = 0xA6000004, + CONTROL_TRACE_ARRAY_SUPPPORTED = 0xA6000002, CONTROL_INSTRUCTIONS_SUPPPORTED = 0xA7000001, GET_SBE_FFDC_SUPPPORTED = 0xA8000001, GET_SBE_CAPABILITIES_SUPPPORTED = 0xA8000002, @@ -414,6 +412,13 @@ typedef enum /// to all hold types } sbeRingAccessModes_t; +// Trace array chip-op operation bitmaps +static const uint16_t SBE_TA_RESET = 0x0001; +static const uint16_t SBE_TA_RESTART = 0x0002; +static const uint16_t SBE_TA_STOP = 0x0004; +static const uint16_t SBE_TA_COLLECT_DUMP = 0x0008; +static const uint16_t SBE_TA_IGNORE_MUX_SETTING = 0x0010; + #ifdef __cplusplus } #endif diff --git a/src/sbefw/sbecmdparser.C b/src/sbefw/sbecmdparser.C index e5a3bd7f..4457321e 100644 --- a/src/sbefw/sbecmdparser.C +++ b/src/sbefw/sbecmdparser.C @@ -47,6 +47,7 @@ #include "sbestates.H" #include "sberegaccess.H" #include "sbecmdmpipl.H" +#include "sbecmdtracearray.H" // Declaration static const uint16_t HARDWARE_FENCED_STATE = @@ -217,6 +218,21 @@ static sbeCmdStruct_t g_sbeRingAccessCmdArray [] = }, }; +// @brief g_sbeArrayAccessCmdArray[] +// +//////////////////////////////////////////////////////////////// +static sbeCmdStruct_t g_sbeArrayAccessCmdArray[] = +{ + {NULL, + SBE_CMD_GET_FAST_ARRAY, + SBE_FENCE_AT_QUIESCE, + }, + {sbeControlTraceArray, + SBE_CMD_CONTROL_TRACE_ARRAY, + SBE_FENCE_AT_QUIESCE, + }, +}; + ////////////////////////////////////////////////////////////// // @brief g_sbeCoreStateControlCmdArray // @@ -320,6 +336,12 @@ uint8_t sbeGetCmdStructAttr (const uint8_t i_cmdClass, *o_ppCmd = (sbeCmdStruct_t*)g_sbeMpiplCmdArray; break; + case SBE_CMD_CLASS_ARRAY_ACCESS: + l_numCmds = sizeof(g_sbeArrayAccessCmdArray) / + sizeof(sbeCmdStruct_t); + *o_ppCmd = (sbeCmdStruct_t*)g_sbeArrayAccessCmdArray; + break; + // PSU Commands case SBE_PSU_CMD_CLASS_CORE_STATE: l_numCmds = sizeof(g_sbeCoreStateControlCmdArray) / diff --git a/src/sbefw/sbecmdtracearray.C b/src/sbefw/sbecmdtracearray.C new file mode 100644 index 00000000..e65b7e9a --- /dev/null +++ b/src/sbefw/sbecmdtracearray.C @@ -0,0 +1,91 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/sbefw/sbecmdtracearray.C $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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: ppe/sbe/sbefw/sbecmdtracearray.C + * + * @brief This file contains the SBE Control Tracearray chipOp + * + */ +#include "sbecmdtracearray.H" +#include "sbefifo.H" +#include "sbe_sp_intf.H" +#include "sbetrace.H" +#include "sbeFifoMsgUtils.H" +#include "sbeutil.H" +#include "fapi2.H" + +using namespace fapi2; + +static const uint32_t SIZE_OF_LENGTH_INWORDS = 1; + +uint32_t sbeControlTraceArray(uint8_t *i_pArg) +{ + #define SBE_FUNC " sbeControlTraceArray" + SBE_ENTER(SBE_FUNC); + uint32_t l_rc = SBE_SEC_OPERATION_SUCCESSFUL; + + sbeControlTraceArrayCMD_t l_req = {}; + sbeRespGenHdr_t respHdr; + respHdr.init(); + sbeResponseFfdc_t l_ffdc; + ReturnCode l_fapiRc; + uint32_t l_NumWordsRead = 0; + uint32_t l_len = 0; + + do + { + l_len = sizeof(sbeControlTraceArrayCMD_t)/sizeof(uint32_t); + l_rc = sbeUpFifoDeq_mult (l_len, (uint32_t *)&l_req); //EOT fetch + + // If FIFO access failure + CHECK_SBE_RC_AND_BREAK_IF_NOT_SUCCESS(l_rc); + + SBE_INFO(SBE_FUNC" targetType [0x%04X] chipletId [0x%02X]" + " traceArrayId [0x%04X] operation [0x%04X]", + l_req.targetType, + l_req.chipletId, + l_req.traceArrayId, + l_req.operation); + + // Call trace array HWP in a loop + + } while(false); + + // Now build and enqueue response into downstream FIFO + // If there was a FIFO error, will skip sending the response, + // instead give the control back to the command processor thread + if ( SBE_SEC_OPERATION_SUCCESSFUL == l_rc ) + { + l_len = SIZE_OF_LENGTH_INWORDS; + l_rc = sbeDownFifoEnq_mult (l_len, &(l_NumWordsRead)); + if(SBE_SEC_OPERATION_SUCCESSFUL == l_rc) + { + l_rc = sbeDsSendRespHdr( respHdr, &l_ffdc); + } + } + SBE_EXIT(SBE_FUNC); + return l_rc; + #undef SBE_FUNC +} diff --git a/src/sbefw/sbecmdtracearray.H b/src/sbefw/sbecmdtracearray.H new file mode 100644 index 00000000..ade451a4 --- /dev/null +++ b/src/sbefw/sbecmdtracearray.H @@ -0,0 +1,55 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/sbefw/sbecmdtracearray.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 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: ppe/sbe/sbefw/sbecmdtracearray.H + * + * @brief This file contains the Interfaces for the Tracearray Control chip-op + * + */ + +#ifndef __SBEFW_SBECMDTRACEARRAY_H +#define __SBEFW_SBECMDTRACEARRAY_H + +#include <stdint.h> + +typedef struct +{ + uint32_t targetType:16; + uint32_t reserved:8; + uint32_t chipletId:8; + uint32_t traceArrayId:16; + uint32_t operation:16; +} sbeControlTraceArrayCMD_t; + +/** + * @brief Control Trace Array Command (0xA602) + * + * @param[in] i_pArg Buffer to be passed to the function (not used as of now) + * + * @return RC from the FIFO access utility + */ +uint32_t sbeControlTraceArray(uint8_t *i_pArg); + +#endif //__SBEFW_SBECMDTRACEARRAY_H diff --git a/src/sbefw/sbefwfiles.mk b/src/sbefw/sbefwfiles.mk index 28e484b2..3e44a5af 100644 --- a/src/sbefw/sbefwfiles.mk +++ b/src/sbefw/sbefwfiles.mk @@ -45,6 +45,7 @@ SBEFW-CPP-SOURCES += sbescom.C SBEFW-CPP-SOURCES += sbecmdmpipl.C SBEFW-CPP-SOURCES += sbefapiutil.C SBEFW-CPP-SOURCES += sbeutil.C +SBEFW-CPP-SOURCES += sbecmdtracearray.C SBEFW-C-SOURCES = SBEFW-S-SOURCES = diff --git a/src/test/testcases/test.xml b/src/test/testcases/test.xml index c3f09f32..4bc43092 100755 --- a/src/test/testcases/test.xml +++ b/src/test/testcases/test.xml @@ -42,6 +42,7 @@ <include>../simics/targets/p9_nimbus/sbeTest/testStopClocks.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testExecutorPutRing.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testSystemFabricMap.xml</include> + <include>../simics/targets/p9_nimbus/sbeTest/testArrayAccess.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testGetRing.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testQuiesce.xml</include> <testcase> diff --git a/src/test/testcases/testArrayAccess.xml b/src/test/testcases/testArrayAccess.xml new file mode 100644 index 00000000..4c2bb321 --- /dev/null +++ b/src/test/testcases/testArrayAccess.xml @@ -0,0 +1,30 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/test/testcases/testArrayAccess.xml $ --> +<!-- --> +<!-- OpenPOWER sbe Project --> +<!-- --> +<!-- Contributors Listed Below - COPYRIGHT 2016 --> +<!-- --> +<!-- --> +<!-- 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 --> +<?xml version="1.0" encoding="UTF-8"?> + + <!-- Control Trace Array Test case --> + <testcase> + <simcmd>run-python-file targets/p9_nimbus/sbeTest/testTraceArray.py</simcmd> + <exitonerror>yes</exitonerror> + </testcase> diff --git a/src/test/testcases/testTraceArray.py b/src/test/testcases/testTraceArray.py new file mode 100644 index 00000000..02c8a9ce --- /dev/null +++ b/src/test/testcases/testTraceArray.py @@ -0,0 +1,60 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/test/testcases/testTraceArray.py $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 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 +import sys +sys.path.append("targets/p9_nimbus/sbeTest" ) +import testUtil +err = False + +CONTROL_TRACE_ARRAY_TESTDATA = [0, 0, 0, 0x04, + 0, 0, 0xA6, 0x02, + 0, 0, 0x04, 0x20, #Core chiplet + 0, 0x01, 0, 0x1D] #reset|collect|stop|ingore mux + +CONTROL_TRACE_ARRAY_VALID = [0, 0, 0, 0, #Number of Words + 0xC0, 0xDE, 0xA6, 0x02, + 0, 0, 0, 0, + 0, 0, 0, 0x03] + +# MAIN Test Run Starts Here... +#------------------------------------------------- +def main( ): + testUtil.runCycles( 10000000 ) + print ("\nStarting control tracearray test") + testUtil.writeUsFifo( CONTROL_TRACE_ARRAY_TESTDATA) + testUtil.writeEot( ) + testUtil.readDsFifo( CONTROL_TRACE_ARRAY_VALID) + testUtil.readEot( ) + +#------------------------------------------------- +# Calling all test code +#------------------------------------------------- +main() + +if err: + print ("\nTest Suite completed with error(s)") + #sys.exit(1) +else: + print ("\nTest Suite completed with no errors") + #sys.exit(0); |