NMSIS-Core  Version 1.6.0
NMSIS-Core support for Nuclei processor-based devices
Cluster-Cache Functions

Functions that configure Cluster Cache by CCM. More...

Data Structures

struct  SMPCC_CMD_Type
 Cluster Cache Control and Command Registers. More...
 

Macros

#define SMPCC_CMD_CTRL_SUP_EN_Pos   9U
 SMPCC_CMD CC_CTRL SUP_EN Position. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_SUP_EN_Pos)
 SMPCC_CMD CC_CTRL SUP_EN Mask. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_ENABLE   1U
 SMPCC_CMD CC_CTRL SUP_EN Enable. More...
 
#define SMPCC_CMD_CTRL_SUP_EN_DISABLE   0U
 SMPCC_CMD CC_CTRL SUP_EN Disable. More...
 
#define SMPCC_CMD_CTRL_USE_EN_Pos   10U
 SMPCC_CMD CC_CTRL USE_EN Position. More...
 
#define SMPCC_CMD_CTRL_USE_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_USE_EN_Pos)
 SMPCC_CMD CC_CTRL USE_EN Mask. More...
 
#define SMPCC_CMD_CTRL_USE_EN_ENABLE   1U
 SMPCC_CMD CC_CTRL USE_EN Enable. More...
 
#define SMPCC_CMD_CTRL_USE_EN_DISABLE   0U
 SMPCC_CMD CC_CTRL USE_EN Disable. More...
 
#define SMPCC_CMD_xCMD_CMD_Pos   0U
 SMPCC_CMD register xCMD field CMD Position. More...
 
#define SMPCC_CMD_xCMD_CMD_Msk   (0x1FUL << SMPCC_CMD_xCMD_CMD_Pos)
 SMPCC_CMD register xCMD field CMD Mask. More...
 
#define SMPCC_CMD_xCMD_CMD_WB_ALL   0x7U
 SMPCC_CMD xCMD CMD WB_ALL. More...
 
#define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL   0x6U
 SMPCC_CMD xCMD CMD WBINVAL_ALL. More...
 
#define SMPCC_CMD_xCMD_STATUS_Pos   23U
 SMPCC_CMD register xCMD field RESC/FESC/BESC Position. More...
 
#define SMPCC_CMD_xCMD_STATUS_Msk   (0x7UL << SMPCC_CMD_xCMD_STATUS_Pos)
 SMPCC_CMD register xCMD field RESC/FESC/BESC Mask. More...
 
#define SMPCC_CMD_xCMD_RESULT_Pos   26U
 SMPCC_CMD xCMD RESULT Position. More...
 
#define SMPCC_CMD_xCMD_RESULT_Msk   (0x1FUL << SMPCC_CMD_xCMD_RESULT_Pos)
 SMPCC_CMD xCMD RESULT Mask. More...
 
#define SMPCC_CMD_xCMD_RESULT_SUCCESS   0x0U
 SMPCC_CMD xCMD RESULT Success. More...
 
#define SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT   0x1U
 SMPCC_CMD xCMD RESULT Exceed the upper entry num of lockable way. More...
 
#define SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR   0x3U
 SMPCC_CMD xCMD RESULT Refill Bus Error. More...
 
#define SMPCC_CMD_xCMD_RESULT_ECC_ERROR   0x4U
 SMPCC_CMD xCMD RESULT ECC Error. More...
 
#define SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR   0x5U
 SMPCC_CMD xCMD RESULT Copy Back Bus Error. More...
 
#define SMPCC_CMD_xCMD_COMPLETE_Pos   31U
 SMPCC_CMD xCMD COMPLETE Position. More...
 
#define SMPCC_CMD_xCMD_COMPLETE_Msk   (0x1UL << SMPCC_CMD_xCMD_COMPLETE_Pos)
 SMPCC_CMD xCMD COMPLETE Mask. More...
 
#define SMPCC_CMD_INVALID_ALL_Pos   0U
 SMPCC_CMD INVALID_ALL Position. More...
 
#define SMPCC_CMD_INVALID_ALL_Msk   (0x1UL << SMPCC_CMD_INVALID_ALL_Pos)
 SMPCC_CMD INVALID_ALL Mask. More...
 
#define SMPCC_CMD_BASE   __SMPCC_BASEADDR
 SMPCC CMD Base Address. More...
 
#define SMPCC_CMD   ((SMPCC_CMD_Type *)SMPCC_CMD_BASE)
 SMPCC CMD configuration struct. More...
 
__STATIC_INLINE unsigned long MLockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in M-Mode. More...
 
__STATIC_INLINE unsigned long MLockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in M-Mode. More...
 
__STATIC_INLINE unsigned long SLockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in S-Mode. More...
 
__STATIC_INLINE unsigned long SLockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in S-Mode. More...
 
__STATIC_INLINE unsigned long ULockCCacheLine (unsigned long addr)
 Lock one Cluster Cache line specified by address in U-Mode. More...
 
__STATIC_INLINE unsigned long ULockCCacheLines (unsigned long addr, unsigned long cnt)
 Lock several Cluster Cache lines specified by address in U-Mode. More...
 
__STATIC_INLINE void MUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in M-Mode. More...
 
__STATIC_INLINE void MUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in M-Mode. More...
 
__STATIC_INLINE void SUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in S-Mode. More...
 
__STATIC_INLINE void SUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in S-Mode. More...
 
__STATIC_INLINE void UUnlockCCacheLine (unsigned long addr)
 Unlock one Cluster Cache line specified by address in U-Mode. More...
 
__STATIC_INLINE void UUnlockCCacheLines (unsigned long addr, unsigned long cnt)
 Unlock several Cluster Cache lines specified by address in U-Mode. More...
 

Detailed Description

Functions that configure Cluster Cache by CCM.

Macro Definition Documentation

◆ SMPCC_CMD

#define SMPCC_CMD   ((SMPCC_CMD_Type *)SMPCC_CMD_BASE)

SMPCC CMD configuration struct.

Definition at line 112 of file core_feature_cache.h.

◆ SMPCC_CMD_BASE

#define SMPCC_CMD_BASE   __SMPCC_BASEADDR

SMPCC CMD Base Address.

Definition at line 111 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_DISABLE

#define SMPCC_CMD_CTRL_SUP_EN_DISABLE   0U

SMPCC_CMD CC_CTRL SUP_EN Disable.

Definition at line 76 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_ENABLE

#define SMPCC_CMD_CTRL_SUP_EN_ENABLE   1U

SMPCC_CMD CC_CTRL SUP_EN Enable.

Definition at line 75 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_Msk

#define SMPCC_CMD_CTRL_SUP_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_SUP_EN_Pos)

SMPCC_CMD CC_CTRL SUP_EN Mask.

Definition at line 74 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_SUP_EN_Pos

#define SMPCC_CMD_CTRL_SUP_EN_Pos   9U

SMPCC_CMD CC_CTRL SUP_EN Position.

Definition at line 73 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_DISABLE

#define SMPCC_CMD_CTRL_USE_EN_DISABLE   0U

SMPCC_CMD CC_CTRL USE_EN Disable.

Definition at line 81 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_ENABLE

#define SMPCC_CMD_CTRL_USE_EN_ENABLE   1U

SMPCC_CMD CC_CTRL USE_EN Enable.

Definition at line 80 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_Msk

#define SMPCC_CMD_CTRL_USE_EN_Msk   (0x1UL << SMPCC_CMD_CTRL_USE_EN_Pos)

SMPCC_CMD CC_CTRL USE_EN Mask.

Definition at line 79 of file core_feature_cache.h.

◆ SMPCC_CMD_CTRL_USE_EN_Pos

#define SMPCC_CMD_CTRL_USE_EN_Pos   10U

SMPCC_CMD CC_CTRL USE_EN Position.

Definition at line 78 of file core_feature_cache.h.

◆ SMPCC_CMD_INVALID_ALL_Msk

#define SMPCC_CMD_INVALID_ALL_Msk   (0x1UL << SMPCC_CMD_INVALID_ALL_Pos)

SMPCC_CMD INVALID_ALL Mask.

Definition at line 103 of file core_feature_cache.h.

◆ SMPCC_CMD_INVALID_ALL_Pos

#define SMPCC_CMD_INVALID_ALL_Pos   0U

SMPCC_CMD INVALID_ALL Position.

Definition at line 102 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_Msk

#define SMPCC_CMD_xCMD_CMD_Msk   (0x1FUL << SMPCC_CMD_xCMD_CMD_Pos)

SMPCC_CMD register xCMD field CMD Mask.

Definition at line 84 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_Pos

#define SMPCC_CMD_xCMD_CMD_Pos   0U

SMPCC_CMD register xCMD field CMD Position.

Definition at line 83 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_WB_ALL

#define SMPCC_CMD_xCMD_CMD_WB_ALL   0x7U

SMPCC_CMD xCMD CMD WB_ALL.

Definition at line 85 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_CMD_WBINVAL_ALL

#define SMPCC_CMD_xCMD_CMD_WBINVAL_ALL   0x6U

SMPCC_CMD xCMD CMD WBINVAL_ALL.

Definition at line 86 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_COMPLETE_Msk

#define SMPCC_CMD_xCMD_COMPLETE_Msk   (0x1UL << SMPCC_CMD_xCMD_COMPLETE_Pos)

SMPCC_CMD xCMD COMPLETE Mask.

Definition at line 100 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_COMPLETE_Pos

#define SMPCC_CMD_xCMD_COMPLETE_Pos   31U

SMPCC_CMD xCMD COMPLETE Position.

Definition at line 99 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR

#define SMPCC_CMD_xCMD_RESULT_CPBACK_BUS_ERROR   0x5U

SMPCC_CMD xCMD RESULT Copy Back Bus Error.

Definition at line 97 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_ECC_ERROR

#define SMPCC_CMD_xCMD_RESULT_ECC_ERROR   0x4U

SMPCC_CMD xCMD RESULT ECC Error.

Definition at line 96 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT

#define SMPCC_CMD_xCMD_RESULT_ENTRY_EXCEED_LIMIT   0x1U

SMPCC_CMD xCMD RESULT Exceed the upper entry num of lockable way.

Definition at line 94 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_Msk

#define SMPCC_CMD_xCMD_RESULT_Msk   (0x1FUL << SMPCC_CMD_xCMD_RESULT_Pos)

SMPCC_CMD xCMD RESULT Mask.

Definition at line 92 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_Pos

#define SMPCC_CMD_xCMD_RESULT_Pos   26U

SMPCC_CMD xCMD RESULT Position.

Definition at line 91 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR

#define SMPCC_CMD_xCMD_RESULT_REFILL_BUS_ERROR   0x3U

SMPCC_CMD xCMD RESULT Refill Bus Error.

Definition at line 95 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_RESULT_SUCCESS

#define SMPCC_CMD_xCMD_RESULT_SUCCESS   0x0U

SMPCC_CMD xCMD RESULT Success.

Definition at line 93 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_STATUS_Msk

#define SMPCC_CMD_xCMD_STATUS_Msk   (0x7UL << SMPCC_CMD_xCMD_STATUS_Pos)

SMPCC_CMD register xCMD field RESC/FESC/BESC Mask.

Definition at line 89 of file core_feature_cache.h.

◆ SMPCC_CMD_xCMD_STATUS_Pos

#define SMPCC_CMD_xCMD_STATUS_Pos   23U

SMPCC_CMD register xCMD field RESC/FESC/BESC Position.

Definition at line 88 of file core_feature_cache.h.

Function Documentation

◆ MLockCCacheLine()

__STATIC_INLINE unsigned long MLockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in M-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 258 of file core_feature_cache.h.

259 {
262  FlushPipeCCM();
263  __RWMB();
265 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().

Referenced by SMPCC_CCacheDramErrInject(), SMPCC_CCacheErrRestore(), SMPCC_CCacheTramErrInject(), and SMPCC_CLMErrInject().

◆ MLockCCacheLines()

__STATIC_INLINE unsigned long MLockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in M-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 279 of file core_feature_cache.h.

280 {
281  if (cnt > 0) {
282  unsigned long i;
283  unsigned long fail_info = CCM_OP_SUCCESS;
285  for (i = 0; i < cnt; i++) {
287  FlushPipeCCM();
288  __RWMB();
289  fail_info = __RV_CSR_READ(CSR_CCM_MDATA);
290  if (CCM_OP_SUCCESS != fail_info) {
291  return fail_info;
292  }
293  }
294  }
295  return CCM_OP_SUCCESS;
296 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, CSR_CCM_MDATA, and FlushPipeCCM().

◆ MUnlockCCacheLine()

__STATIC_INLINE void MUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in M-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 407 of file core_feature_cache.h.

408 {
411  FlushPipeCCM();
412  __RWMB();
413 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().

◆ MUnlockCCacheLines()

__STATIC_INLINE void MUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in M-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_MCOMMAND.

Remarks
This function must be executed in M-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 426 of file core_feature_cache.h.

427 {
428  if (cnt > 0) {
429  unsigned long i;
431  for (i = 0; i < cnt; i++) {
433  }
434  FlushPipeCCM();
435  __RWMB();
436  }
437 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_MBEGINADDR, CSR_CCM_MCOMMAND, and FlushPipeCCM().

◆ SLockCCacheLine()

__STATIC_INLINE unsigned long SLockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in S-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 308 of file core_feature_cache.h.

309 {
312  FlushPipeCCM();
313  __RWMB();
315 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().

◆ SLockCCacheLines()

__STATIC_INLINE unsigned long SLockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in S-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 329 of file core_feature_cache.h.

330 {
331  if (cnt > 0) {
332  unsigned long i;
333  unsigned long fail_info = CCM_OP_SUCCESS;
335  for (i = 0; i < cnt; i++) {
337  FlushPipeCCM();
338  __RWMB();
339  fail_info = __RV_CSR_READ(CSR_CCM_SDATA);
340  if (CCM_OP_SUCCESS != fail_info) {
341  return fail_info;
342  }
343  }
344  }
345  return CCM_OP_SUCCESS;
346 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, CSR_CCM_SDATA, and FlushPipeCCM().

◆ SUnlockCCacheLine()

__STATIC_INLINE void SUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in S-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 448 of file core_feature_cache.h.

449 {
452  FlushPipeCCM();
453  __RWMB();
454 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().

◆ SUnlockCCacheLines()

__STATIC_INLINE void SUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in S-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_SCOMMAND.

Remarks
This function must be executed in M/S-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 467 of file core_feature_cache.h.

468 {
469  if (cnt > 0) {
470  unsigned long i;
472  for (i = 0; i < cnt; i++) {
474  }
475  FlushPipeCCM();
476  __RWMB();
477  }
478 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_SBEGINADDR, CSR_CCM_SCOMMAND, and FlushPipeCCM().

◆ ULockCCacheLine()

__STATIC_INLINE unsigned long ULockCCacheLine ( unsigned long  addr)

Lock one Cluster Cache line specified by address in U-Mode.

This function lock one Cluster Cache line specified by the address. Command CCM_CC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 358 of file core_feature_cache.h.

359 {
362  FlushPipeCCM();
363  __RWMB();
365 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().

◆ ULockCCacheLines()

__STATIC_INLINE unsigned long ULockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Lock several Cluster Cache lines specified by address in U-Mode.

This function lock several Cluster Cache lines specified by the address and line count. Command CCM_CC_LOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be locked
[in]cntcount of cache lines to be locked
Returns
result of CCM lock operation, see enum CCM_OP_FINFO

Definition at line 379 of file core_feature_cache.h.

380 {
381  if (cnt > 0) {
382  unsigned long i;
383  unsigned long fail_info = CCM_OP_SUCCESS;
385  for (i = 0; i < cnt; i++) {
387  FlushPipeCCM();
388  __RWMB();
389  fail_info = __RV_CSR_READ(CSR_CCM_UDATA);
390  if (CCM_OP_SUCCESS != fail_info) {
391  return fail_info;
392  }
393  }
394  }
395  return CCM_OP_SUCCESS;
396 }

References __RV_CSR_READ, __RV_CSR_WRITE, __RWMB, CCM_CC_LOCK, CCM_OP_SUCCESS, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, CSR_CCM_UDATA, and FlushPipeCCM().

◆ UUnlockCCacheLine()

__STATIC_INLINE void UUnlockCCacheLine ( unsigned long  addr)

Unlock one Cluster Cache line specified by address in U-Mode.

This function unlock one Cluster Cache line specified by the address. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be unlocked

Definition at line 489 of file core_feature_cache.h.

490 {
493  FlushPipeCCM();
494  __RWMB();
495 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().

◆ UUnlockCCacheLines()

__STATIC_INLINE void UUnlockCCacheLines ( unsigned long  addr,
unsigned long  cnt 
)

Unlock several Cluster Cache lines specified by address in U-Mode.

This function unlock several Cluster Cache lines specified by the address and line count. Command CCM_CC_UNLOCK is written to CSR CSR_CCM_UCOMMAND.

Remarks
This function must be executed in M/S/U-Mode only.
Parameters
[in]addrstart address to be unlocked
[in]cntcount of cache lines to be unlocked

Definition at line 508 of file core_feature_cache.h.

509 {
510  if (cnt > 0) {
511  unsigned long i;
513  for (i = 0; i < cnt; i++) {
515  }
516  FlushPipeCCM();
517  __RWMB();
518  }
519 }

References __RV_CSR_WRITE, __RWMB, CCM_CC_UNLOCK, CSR_CCM_UBEGINADDR, CSR_CCM_UCOMMAND, and FlushPipeCCM().

CSR_CCM_MBEGINADDR
#define CSR_CCM_MBEGINADDR
Definition: riscv_encoding.h:1129
CCM_CC_LOCK
@ CCM_CC_LOCK
Lock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.
Definition: core_feature_cache.h:166
__RV_CSR_WRITE
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
Definition: core_feature_base.h:725
FlushPipeCCM
__STATIC_FORCEINLINE void FlushPipeCCM(void)
Flush pipeline after CCM operation.
Definition: core_feature_cache.h:236
CSR_CCM_SDATA
#define CSR_CCM_SDATA
Definition: riscv_encoding.h:1135
CSR_CCM_UDATA
#define CSR_CCM_UDATA
Definition: riscv_encoding.h:1138
CCM_OP_SUCCESS
@ CCM_OP_SUCCESS
Lock Succeed.
Definition: core_feature_cache.h:143
CSR_CCM_MDATA
#define CSR_CCM_MDATA
Definition: riscv_encoding.h:1131
CSR_CCM_SBEGINADDR
#define CSR_CCM_SBEGINADDR
Definition: riscv_encoding.h:1133
__RV_CSR_READ
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
Definition: core_feature_base.h:707
CSR_CCM_SCOMMAND
#define CSR_CCM_SCOMMAND
Definition: riscv_encoding.h:1134
CCM_CC_UNLOCK
@ CCM_CC_UNLOCK
Unlock the specific Cluster Cache line specified by CSR CCM_XBEGINADDR.
Definition: core_feature_cache.h:167
CSR_CCM_MCOMMAND
#define CSR_CCM_MCOMMAND
Definition: riscv_encoding.h:1130
CSR_CCM_UCOMMAND
#define CSR_CCM_UCOMMAND
Definition: riscv_encoding.h:1137
__RWMB
#define __RWMB()
Read & Write Memory barrier.
Definition: core_feature_base.h:850
CSR_CCM_UBEGINADDR
#define CSR_CCM_UBEGINADDR
Definition: riscv_encoding.h:1136