2 * @file IxNpeDlNpeMgrUtils_p.h
4 * @author Intel Corporation
5 * @date 18 February 2002
6 * @brief This file contains the private API for the NpeMgr module.
10 * IXP400 SW Release version 2.0
12 * -- Copyright Notice --
15 * Copyright 2001-2005, Intel Corporation.
16 * All rights reserved.
19 * SPDX-License-Identifier: BSD-3-Clause
21 * -- End of Copyright Notice --
26 * @defgroup IxNpeDlNpeMgrUtils_p IxNpeDlNpeMgrUtils_p
28 * @brief The private API for the IxNpeDl NpeMgr Utils module
33 #ifndef IXNPEDLNPEMGRUTILS_P_H
34 #define IXNPEDLNPEMGRUTILS_P_H
38 * Put the user defined include files required.
41 #include "IxOsalTypes.h"
42 #include "IxNpeDlNpeMgrEcRegisters_p.h"
50 * @fn IX_STATUS ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress,
55 * @brief Writes a word to NPE Instruction memory
57 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
58 * @param UINT32 [in] insMemAddress - NPE instruction memory address to write
59 * @param UINT32 [in] insMemData - data to write to instruction memory
60 * @param BOOL [in] verify - if true, verify the memory location is
61 * written successfully.
63 * This function is used to write a single word of data to a location in NPE
64 * instruction memory. If the <i>verify</i> option is ON, NpeDl will read back
65 * from the memory location to verify that it was written successfully
72 * - IX_FAIL if verify is true and the memory location was not written
74 * - IX_SUCCESS otherwise
77 ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress, UINT32 insMemAddress,
78 UINT32 insMemData, BOOL verify);
82 * @fn IX_STATUS ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress,
83 UINT32 dataMemAddress,
87 * @brief Writes a word to NPE Data memory
89 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
90 * @param UINT32 [in] dataMemAddress - NPE data memory address to write
91 * @param UINT32 [in] dataMemData - data to write to NPE data memory
92 * @param BOOL [in] verify - if true, verify the memory location is
93 * written successfully.
95 * This function is used to write a single word of data to a location in NPE
96 * data memory. If the <i>verify</i> option is ON, NpeDl will read back from
97 * the memory location to verify that it was written successfully
104 * - IX_FAIL if verify is true and the memory location was not written
106 * - IX_SUCCESS otherwise
109 ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress, UINT32 dataMemAddress,
110 UINT32 dataMemData, BOOL verify);
114 * @fn void ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress,
118 * @brief Writes a word to an NPE Execution Access register
120 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
121 * @param UINT32 [in] regAddress - NPE Execution Access register address
122 * @param UINT32 [in] regData - data to write to register
124 * This function is used to write a single word of data to an NPE Execution
134 ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress, UINT32 regAddress,
139 * @fn UINT32 ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress,
142 * @brief Reads the contents of an NPE Execution Access register
144 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
145 * @param UINT32 [in] regAddress - NPE Execution Access register address
147 * This function is used to read the contents of an NPE Execution
154 * @return The value read from the Execution Access register
157 ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress, UINT32 regAddress);
161 * @fn void ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress,
164 * @brief Issues an NPE Execution Control command
166 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
167 * @param UINT32 [in] command - Command to issue
169 * This function is used to issue a stand-alone NPE Execution Control command
170 * (e.g. command to Stop NPE execution)
179 ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress, UINT32 command);
183 * @fn void ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress)
185 * @brief Prepare to executes one or more NPE instructions in the Debug
186 * Execution Stack level.
188 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
190 * This function should be called once before a sequence of calls to
191 * ixNpeDlNpeMgrDebugInstructionExec().
196 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called to restore
197 * registers values altered by this function
202 ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress);
206 * @fn IX_STATUS ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
207 UINT32 npeInstruction,
211 * @brief Executes a single instruction on the NPE at the Debug Execution Stack
214 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
215 * @param UINT32 [in] npeInstruction - Value to write to INSTR (Instruction)
217 * @param UINT32 [in] ctxtNum - context the instruction will be executed
218 * in and which context store it may access
219 * @param UINT32 [in] ldur - Long Immediate Duration, set to non-zero
220 * to use long-immediate mode instruction
222 * This function is used to execute a single instruction in the NPE pipeline at
223 * the debug Execution Context Stack level. It won't disturb the state of other
224 * executing contexts. Its useful for performing NPE operations, such as
225 * writing to NPE Context Store registers and physical registers, that cannot
226 * be carried out directly using the Configuration Bus registers. This function
227 * will return TIMEOUT status if NPE not responding due to NPS is hang / halt.
230 * - The NPE should be stopped and in a clean state
231 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
232 * a sequential of 1 or more calls to this function
235 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
236 * a sequence of calls to this function
239 * - IX_NPEDL_CRITICAL_NPE_ERR if execution of instruction failed / timeout
240 * - IX_SUCCESS otherwise
243 ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
244 UINT32 npeInstruction,
245 UINT32 ctxtNum, UINT32 ldur);
249 * @fn void ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress)
251 * @brief Clean up after executing one or more NPE instructions in the
254 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
256 * This function should be called once following a sequence of calls to
257 * ixNpeDlNpeMgrDebugInstructionExec().
260 * - ixNpeDlNpeMgrDebugInstructionPreExec() was called earlier
263 * - The Instruction Pipeline will cleared
268 ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress);
272 * @fn IX_STATUS ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress,
277 * @brief Write one of the 32* 32-bit physical registers in the NPE data
280 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
281 * @param UINT32 [in] regAddr - number of the physical register (0-31)*
282 * @param UINT32 [in] regValue - value to write to the physical register
283 * @param BOOL [in] verify - if true, verify the register is written
286 * This function writes a physical register in the NPE data register file.
287 * If the <i>verify</i> option is ON, NpeDl will read back the register to
288 * verify that it was written successfully
289 * *Note that release 1.0 of this software supports 32 physical
290 * registers, but 64 may be supported in future versions.
293 * - The NPE should be stopped and in a clean state
294 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
295 * a sequential of 1 or more calls to this function
298 * - Contents of REGMAP Context Store register for Context 0 will be altered
299 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
300 * a sequence of calls to this function
303 * - IX_FAIL if verify is true and the Context Register was not written
305 * - IX_SUCCESS if Context Register was written successfully
306 * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
307 * successfully due to timeout error where NPE is not responding
310 ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress, UINT32 regAddr,
311 UINT32 regValue, BOOL verify);
315 * @fn IX_STATUS ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress,
317 IxNpeDlCtxtRegNum ctxtReg,
321 * @brief Writes a value to a Context Store register on an NPE
323 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
324 * @param UINT32 [in] ctxtNum - context store to access
325 * @param IxNpeDlCtxtRegNum [in] ctxtReg - which Context Store reg to write
326 * @param UINT32 [in] ctxtRegVal - value to write to the Context Store
328 * @param BOOL [in] verify - if true, verify the register is
329 * written successfully.
331 * This function writes the contents of a Context Store register in the NPE
332 * register file. If the <i>verify</i> option is ON, NpeDl will read back the
333 * register to verify that it was written successfully
336 * - The NPE should be stopped and in a clean state
337 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
338 * a sequential of 1 or more calls to this function
341 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
342 * a sequence of calls to this function
345 * - IX_FAIL if verify is true and the Context Register was not written
347 * - IX_SUCCESS if Context Register was written successfully
348 * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
349 * successfully due to timeout error where NPE is not responding
352 ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress, UINT32 ctxtNum,
353 IxNpeDlCtxtRegNum ctxtReg, UINT32 ctxtRegVal,
358 * @fn void ixNpeDlNpeMgrUtilsStatsShow (void)
360 * @brief This function will display the statistics of the IxNpeDl NpeMgrUtils
366 ixNpeDlNpeMgrUtilsStatsShow (void);
370 * @fn void ixNpeDlNpeMgrUtilsStatsReset (void)
372 * @brief This function will reset the statistics of the IxNpeDl NpeMgrUtils
378 ixNpeDlNpeMgrUtilsStatsReset (void);
381 #endif /* IXNPEDLNPEMGRUTILS_P_H */