IxNpeDlNpeMgrUtils_p.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /**
  2. * @file IxNpeDlNpeMgrUtils_p.h
  3. *
  4. * @author Intel Corporation
  5. * @date 18 February 2002
  6. * @brief This file contains the private API for the NpeMgr module.
  7. *
  8. *
  9. * @par
  10. * IXP400 SW Release version 2.0
  11. *
  12. * -- Copyright Notice --
  13. *
  14. * @par
  15. * Copyright 2001-2005, Intel Corporation.
  16. * All rights reserved.
  17. *
  18. * @par
  19. * SPDX-License-Identifier: BSD-3-Clause
  20. * @par
  21. * -- End of Copyright Notice --
  22. */
  23. /**
  24. * @defgroup IxNpeDlNpeMgrUtils_p IxNpeDlNpeMgrUtils_p
  25. *
  26. * @brief The private API for the IxNpeDl NpeMgr Utils module
  27. *
  28. * @{
  29. */
  30. #ifndef IXNPEDLNPEMGRUTILS_P_H
  31. #define IXNPEDLNPEMGRUTILS_P_H
  32. /*
  33. * Put the user defined include files required.
  34. */
  35. #include "IxNpeDl.h"
  36. #include "IxOsalTypes.h"
  37. #include "IxNpeDlNpeMgrEcRegisters_p.h"
  38. /*
  39. * Function Prototypes
  40. */
  41. /**
  42. * @fn IX_STATUS ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress,
  43. UINT32 insMemAddress,
  44. UINT32 insMemData,
  45. BOOL verify)
  46. *
  47. * @brief Writes a word to NPE Instruction memory
  48. *
  49. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  50. * @param UINT32 [in] insMemAddress - NPE instruction memory address to write
  51. * @param UINT32 [in] insMemData - data to write to instruction memory
  52. * @param BOOL [in] verify - if true, verify the memory location is
  53. * written successfully.
  54. *
  55. * This function is used to write a single word of data to a location in NPE
  56. * instruction memory. If the <i>verify</i> option is ON, NpeDl will read back
  57. * from the memory location to verify that it was written successfully
  58. *
  59. * @pre
  60. *
  61. * @post
  62. *
  63. * @return
  64. * - IX_FAIL if verify is true and the memory location was not written
  65. * successfully
  66. * - IX_SUCCESS otherwise
  67. */
  68. IX_STATUS
  69. ixNpeDlNpeMgrInsMemWrite (UINT32 npeBaseAddress, UINT32 insMemAddress,
  70. UINT32 insMemData, BOOL verify);
  71. /**
  72. * @fn IX_STATUS ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress,
  73. UINT32 dataMemAddress,
  74. UINT32 dataMemData,
  75. BOOL verify)
  76. *
  77. * @brief Writes a word to NPE Data memory
  78. *
  79. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  80. * @param UINT32 [in] dataMemAddress - NPE data memory address to write
  81. * @param UINT32 [in] dataMemData - data to write to NPE data memory
  82. * @param BOOL [in] verify - if true, verify the memory location is
  83. * written successfully.
  84. *
  85. * This function is used to write a single word of data to a location in NPE
  86. * data memory. If the <i>verify</i> option is ON, NpeDl will read back from
  87. * the memory location to verify that it was written successfully
  88. *
  89. * @pre
  90. *
  91. * @post
  92. *
  93. * @return
  94. * - IX_FAIL if verify is true and the memory location was not written
  95. * successfully
  96. * - IX_SUCCESS otherwise
  97. */
  98. IX_STATUS
  99. ixNpeDlNpeMgrDataMemWrite (UINT32 npeBaseAddress, UINT32 dataMemAddress,
  100. UINT32 dataMemData, BOOL verify);
  101. /**
  102. * @fn void ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress,
  103. UINT32 regAddress,
  104. UINT32 regData)
  105. *
  106. * @brief Writes a word to an NPE Execution Access register
  107. *
  108. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  109. * @param UINT32 [in] regAddress - NPE Execution Access register address
  110. * @param UINT32 [in] regData - data to write to register
  111. *
  112. * This function is used to write a single word of data to an NPE Execution
  113. * Access register.
  114. *
  115. * @pre
  116. *
  117. * @post
  118. *
  119. * @return none
  120. */
  121. void
  122. ixNpeDlNpeMgrExecAccRegWrite (UINT32 npeBaseAddress, UINT32 regAddress,
  123. UINT32 regData);
  124. /**
  125. * @fn UINT32 ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress,
  126. UINT32 regAddress)
  127. *
  128. * @brief Reads the contents of an NPE Execution Access register
  129. *
  130. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  131. * @param UINT32 [in] regAddress - NPE Execution Access register address
  132. *
  133. * This function is used to read the contents of an NPE Execution
  134. * Access register.
  135. *
  136. * @pre
  137. *
  138. * @post
  139. *
  140. * @return The value read from the Execution Access register
  141. */
  142. UINT32
  143. ixNpeDlNpeMgrExecAccRegRead (UINT32 npeBaseAddress, UINT32 regAddress);
  144. /**
  145. * @fn void ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress,
  146. UINT32 command)
  147. *
  148. * @brief Issues an NPE Execution Control command
  149. *
  150. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  151. * @param UINT32 [in] command - Command to issue
  152. *
  153. * This function is used to issue a stand-alone NPE Execution Control command
  154. * (e.g. command to Stop NPE execution)
  155. *
  156. * @pre
  157. *
  158. * @post
  159. *
  160. * @return none
  161. */
  162. void
  163. ixNpeDlNpeMgrCommandIssue (UINT32 npeBaseAddress, UINT32 command);
  164. /**
  165. * @fn void ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress)
  166. *
  167. * @brief Prepare to executes one or more NPE instructions in the Debug
  168. * Execution Stack level.
  169. *
  170. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  171. *
  172. * This function should be called once before a sequence of calls to
  173. * ixNpeDlNpeMgrDebugInstructionExec().
  174. *
  175. * @pre
  176. *
  177. * @post
  178. * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called to restore
  179. * registers values altered by this function
  180. *
  181. * @return none
  182. */
  183. void
  184. ixNpeDlNpeMgrDebugInstructionPreExec (UINT32 npeBaseAddress);
  185. /**
  186. * @fn IX_STATUS ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
  187. UINT32 npeInstruction,
  188. UINT32 ctxtNum,
  189. UINT32 ldur)
  190. *
  191. * @brief Executes a single instruction on the NPE at the Debug Execution Stack
  192. * level
  193. *
  194. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  195. * @param UINT32 [in] npeInstruction - Value to write to INSTR (Instruction)
  196. * register
  197. * @param UINT32 [in] ctxtNum - context the instruction will be executed
  198. * in and which context store it may access
  199. * @param UINT32 [in] ldur - Long Immediate Duration, set to non-zero
  200. * to use long-immediate mode instruction
  201. *
  202. * This function is used to execute a single instruction in the NPE pipeline at
  203. * the debug Execution Context Stack level. It won't disturb the state of other
  204. * executing contexts. Its useful for performing NPE operations, such as
  205. * writing to NPE Context Store registers and physical registers, that cannot
  206. * be carried out directly using the Configuration Bus registers. This function
  207. * will return TIMEOUT status if NPE not responding due to NPS is hang / halt.
  208. *
  209. * @pre
  210. * - The NPE should be stopped and in a clean state
  211. * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
  212. * a sequential of 1 or more calls to this function
  213. *
  214. * @post
  215. * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
  216. * a sequence of calls to this function
  217. *
  218. * @return
  219. * - IX_NPEDL_CRITICAL_NPE_ERR if execution of instruction failed / timeout
  220. * - IX_SUCCESS otherwise
  221. */
  222. IX_STATUS
  223. ixNpeDlNpeMgrDebugInstructionExec (UINT32 npeBaseAddress,
  224. UINT32 npeInstruction,
  225. UINT32 ctxtNum, UINT32 ldur);
  226. /**
  227. * @fn void ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress)
  228. *
  229. * @brief Clean up after executing one or more NPE instructions in the
  230. * Debug Stack Level
  231. *
  232. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  233. *
  234. * This function should be called once following a sequence of calls to
  235. * ixNpeDlNpeMgrDebugInstructionExec().
  236. *
  237. * @pre
  238. * - ixNpeDlNpeMgrDebugInstructionPreExec() was called earlier
  239. *
  240. * @post
  241. * - The Instruction Pipeline will cleared
  242. *
  243. * @return none
  244. */
  245. void
  246. ixNpeDlNpeMgrDebugInstructionPostExec (UINT32 npeBaseAddress);
  247. /**
  248. * @fn IX_STATUS ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress,
  249. UINT32 regAddr,
  250. UINT32 regValue,
  251. BOOL verify)
  252. *
  253. * @brief Write one of the 32* 32-bit physical registers in the NPE data
  254. * register file
  255. *
  256. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  257. * @param UINT32 [in] regAddr - number of the physical register (0-31)*
  258. * @param UINT32 [in] regValue - value to write to the physical register
  259. * @param BOOL [in] verify - if true, verify the register is written
  260. * successfully.
  261. *
  262. * This function writes a physical register in the NPE data register file.
  263. * If the <i>verify</i> option is ON, NpeDl will read back the register to
  264. * verify that it was written successfully
  265. * *Note that release 1.0 of this software supports 32 physical
  266. * registers, but 64 may be supported in future versions.
  267. *
  268. * @pre
  269. * - The NPE should be stopped and in a clean state
  270. * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
  271. * a sequential of 1 or more calls to this function
  272. *
  273. * @post
  274. * - Contents of REGMAP Context Store register for Context 0 will be altered
  275. * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
  276. * a sequence of calls to this function
  277. *
  278. * @return
  279. * - IX_FAIL if verify is true and the Context Register was not written
  280. * successfully
  281. * - IX_SUCCESS if Context Register was written successfully
  282. * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
  283. * successfully due to timeout error where NPE is not responding
  284. */
  285. IX_STATUS
  286. ixNpeDlNpeMgrPhysicalRegWrite (UINT32 npeBaseAddress, UINT32 regAddr,
  287. UINT32 regValue, BOOL verify);
  288. /**
  289. * @fn IX_STATUS ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress,
  290. UINT32 ctxtNum,
  291. IxNpeDlCtxtRegNum ctxtReg,
  292. UINT32 ctxtRegVal,
  293. BOOL verify)
  294. *
  295. * @brief Writes a value to a Context Store register on an NPE
  296. *
  297. * @param UINT32 [in] npeBaseAddress - Base Address of NPE
  298. * @param UINT32 [in] ctxtNum - context store to access
  299. * @param IxNpeDlCtxtRegNum [in] ctxtReg - which Context Store reg to write
  300. * @param UINT32 [in] ctxtRegVal - value to write to the Context Store
  301. * register
  302. * @param BOOL [in] verify - if true, verify the register is
  303. * written successfully.
  304. *
  305. * This function writes the contents of a Context Store register in the NPE
  306. * register file. If the <i>verify</i> option is ON, NpeDl will read back the
  307. * register to verify that it was written successfully
  308. *
  309. * @pre
  310. * - The NPE should be stopped and in a clean state
  311. * - ixNpeDlNpeMgrDebugInstructionPreExec() should be called once before
  312. * a sequential of 1 or more calls to this function
  313. *
  314. * @post
  315. * - ixNpeDlNpeMgrDebugInstructionPostExec() should be called after
  316. * a sequence of calls to this function
  317. *
  318. * @return
  319. * - IX_FAIL if verify is true and the Context Register was not written
  320. * successfully
  321. * - IX_SUCCESS if Context Register was written successfully
  322. * - IX_NPEDL_CRITICAL_NPE_ERR if Context Register was not written
  323. * successfully due to timeout error where NPE is not responding
  324. */
  325. IX_STATUS
  326. ixNpeDlNpeMgrCtxtRegWrite (UINT32 npeBaseAddress, UINT32 ctxtNum,
  327. IxNpeDlCtxtRegNum ctxtReg, UINT32 ctxtRegVal,
  328. BOOL verify);
  329. /**
  330. * @fn void ixNpeDlNpeMgrUtilsStatsShow (void)
  331. *
  332. * @brief This function will display the statistics of the IxNpeDl NpeMgrUtils
  333. * module
  334. *
  335. * @return none
  336. */
  337. void
  338. ixNpeDlNpeMgrUtilsStatsShow (void);
  339. /**
  340. * @fn void ixNpeDlNpeMgrUtilsStatsReset (void)
  341. *
  342. * @brief This function will reset the statistics of the IxNpeDl NpeMgrUtils
  343. * module
  344. *
  345. * @return none
  346. */
  347. void
  348. ixNpeDlNpeMgrUtilsStatsReset (void);
  349. #endif /* IXNPEDLNPEMGRUTILS_P_H */