IxNpeDlNpeMgrUtils_p.h 13 KB

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