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 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions
22 * 1. Redistributions of source code must retain the above copyright
23 * notice, this list of conditions and the following disclaimer.
24 * 2. Redistributions in binary form must reproduce the above copyright
25 * notice, this list of conditions and the following disclaimer in the
26 * documentation and/or other materials provided with the distribution.
27 * 3. Neither the name of the Intel Corporation nor the names of its contributors
28 * may be used to endorse or promote products derived from this software
29 * without specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
36 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45 * -- End of Copyright Notice --
50 * @defgroup IxNpeDlNpeMgrUtils_p IxNpeDlNpeMgrUtils_p
52 * @brief The private API for the IxNpeDl NpeMgr Utils module
57 #ifndef IXNPEDLNPEMGRUTILS_P_H
58 #define IXNPEDLNPEMGRUTILS_P_H
62 * Put the user defined include files required.
65 #include "IxOsalTypes.h"
66 #include "IxNpeDlNpeMgrEcRegisters_p.h"
74 * @fn IX_STATUS ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress,
79 * @brief Writes a word to NPE Instruction memory
81 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
82 * @param UINT32 [in] insMemAddress - NPE instruction memory address to write
83 * @param UINT32 [in] insMemData - data to write to instruction memory
84 * @param BOOL [in] verify - if true, verify the memory location is
85 * written successfully.
87 * This function is used to write a single word of data to a location in NPE
88 * instruction memory. If the <i>verify</i> option is ON, NpeDl will read back
89 * from the memory location to verify that it was written successfully
96 * - IX_FAIL if verify is true and the memory location was not written
98 * - IX_SUCCESS otherwise
101 ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress, UINT32 insMemAddress,
102 UINT32 insMemData, BOOL verify);
106 * @fn IX_STATUS ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress,
107 UINT32 dataMemAddress,
111 * @brief Writes a word to NPE Data memory
113 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
114 * @param UINT32 [in] dataMemAddress - NPE data memory address to write
115 * @param UINT32 [in] dataMemData - data to write to NPE data memory
116 * @param BOOL [in] verify - if true, verify the memory location is
117 * written successfully.
119 * This function is used to write a single word of data to a location in NPE
120 * data memory. If the <i>verify</i> option is ON, NpeDl will read back from
121 * the memory location to verify that it was written successfully
128 * - IX_FAIL if verify is true and the memory location was not written
130 * - IX_SUCCESS otherwise
133 ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress, UINT32 dataMemAddress,
134 UINT32 dataMemData, BOOL verify);
138 * @fn void ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress,
142 * @brief Writes a word to an NPE Execution Access register
144 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
145 * @param UINT32 [in] regAddress - NPE Execution Access register address
146 * @param UINT32 [in] regData - data to write to register
148 * This function is used to write a single word of data to an NPE Execution
158 ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress, UINT32 regAddress,
163 * @fn UINT32 ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress,
166 * @brief Reads the contents of an NPE Execution Access register
168 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
169 * @param UINT32 [in] regAddress - NPE Execution Access register address
171 * This function is used to read the contents of an NPE Execution
178 * @return The value read from the Execution Access register
181 ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress, UINT32 regAddress);
185 * @fn void ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress,
188 * @brief Issues an NPE Execution Control command
190 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
191 * @param UINT32 [in] command - Command to issue
193 * This function is used to issue a stand-alone NPE Execution Control command
194 * (e.g. command to Stop NPE execution)
203 ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress, UINT32 command);
207 * @fn void ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress)
209 * @brief Prepare to executes one or more NPE instructions in the Debug
210 * Execution Stack level.
212 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
214 * This function should be called once before a sequence of calls to
215 * ixNpeDlNpeMgrDebugInstructionExec().
220 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called to restore
221 * registers values altered by this function
226 ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress);
230 * @fn IX_STATUS ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
231 UINT32 npeInstruction,
235 * @brief Executes a single instruction on the NPE at the Debug Execution Stack
238 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
239 * @param UINT32 [in] npeInstruction - Value to write to INSTR (Instruction)
241 * @param UINT32 [in] ctxtNum - context the instruction will be executed
242 * in and which context store it may access
243 * @param UINT32 [in] ldur - Long Immediate Duration, set to non-zero
244 * to use long-immediate mode instruction
246 * This function is used to execute a single instruction in the NPE pipeline at
247 * the debug Execution Context Stack level. It won't disturb the state of other
248 * executing contexts. Its useful for performing NPE operations, such as
249 * writing to NPE Context Store registers and physical registers, that cannot
250 * be carried out directly using the Configuration Bus registers. This function
251 * will return TIMEOUT status if NPE not responding due to NPS is hang / halt.
254 * - The NPE should be stopped and in a clean state
255 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
256 * a sequential of 1 or more calls to this function
259 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
260 * a sequence of calls to this function
263 * - IX_NPEDL_CRITICAL_NPE_ERR if execution of instruction failed / timeout
264 * - IX_SUCCESS otherwise
267 ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
268 UINT32 npeInstruction,
269 UINT32 ctxtNum, UINT32 ldur);
273 * @fn void ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress)
275 * @brief Clean up after executing one or more NPE instructions in the
278 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
280 * This function should be called once following a sequence of calls to
281 * ixNpeDlNpeMgrDebugInstructionExec().
284 * - ixNpeDlNpeMgrDebugInstructionPreExec() was called earlier
287 * - The Instruction Pipeline will cleared
292 ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress);
296 * @fn IX_STATUS ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress,
301 * @brief Write one of the 32* 32-bit physical registers in the NPE data
304 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
305 * @param UINT32 [in] regAddr - number of the physical register (0-31)*
306 * @param UINT32 [in] regValue - value to write to the physical register
307 * @param BOOL [in] verify - if true, verify the register is written
310 * This function writes a physical register in the NPE data register file.
311 * If the <i>verify</i> option is ON, NpeDl will read back the register to
312 * verify that it was written successfully
313 * *Note that release 1.0 of this software supports 32 physical
314 * registers, but 64 may be supported in future versions.
317 * - The NPE should be stopped and in a clean state
318 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
319 * a sequential of 1 or more calls to this function
322 * - Contents of REGMAP Context Store register for Context 0 will be altered
323 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
324 * a sequence of calls to this function
327 * - IX_FAIL if verify is true and the Context Register was not written
329 * - IX_SUCCESS if Context Register was written successfully
330 * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
331 * successfully due to timeout error where NPE is not responding
334 ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress, UINT32 regAddr,
335 UINT32 regValue, BOOL verify);
339 * @fn IX_STATUS ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress,
341 IxNpeDlCtxtRegNum ctxtReg,
345 * @brief Writes a value to a Context Store register on an NPE
347 * @param UINT32 [in] npeBaseAddress - Base Address of NPE
348 * @param UINT32 [in] ctxtNum - context store to access
349 * @param IxNpeDlCtxtRegNum [in] ctxtReg - which Context Store reg to write
350 * @param UINT32 [in] ctxtRegVal - value to write to the Context Store
352 * @param BOOL [in] verify - if true, verify the register is
353 * written successfully.
355 * This function writes the contents of a Context Store register in the NPE
356 * register file. If the <i>verify</i> option is ON, NpeDl will read back the
357 * register to verify that it was written successfully
360 * - The NPE should be stopped and in a clean state
361 * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
362 * a sequential of 1 or more calls to this function
365 * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
366 * a sequence of calls to this function
369 * - IX_FAIL if verify is true and the Context Register was not written
371 * - IX_SUCCESS if Context Register was written successfully
372 * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
373 * successfully due to timeout error where NPE is not responding
376 ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress, UINT32 ctxtNum,
377 IxNpeDlCtxtRegNum ctxtReg, UINT32 ctxtRegVal,
382 * @fn void ixNpeDlNpeMgrUtilsStatsShow (void)
384 * @brief This function will display the statistics of the IxNpeDl NpeMgrUtils
390 ixNpeDlNpeMgrUtilsStatsShow (void);
394 * @fn void ixNpeDlNpeMgrUtilsStatsReset (void)
396 * @brief This function will reset the statistics of the IxNpeDl NpeMgrUtils
402 ixNpeDlNpeMgrUtilsStatsReset (void);
405 #endif /* IXNPEDLNPEMGRUTILS_P_H */