MU Library
mu Namespace Reference

Namespaces

 vector
 

Classes

struct  function_traits
 
class  CallHelper
 
class  NDArray
 NDArray is a class that can be used in both host and device code. NDArray is automatically divided into multiple NDArrayViews for each task. More...
 
struct  function_traits_helper
 
struct  function_traits_helper< R(*)(void)>
 
struct  function_traits_helper< R(*)(T1)>
 
struct  function_traits_helper< R(*)(T1, T2)>
 
struct  function_traits_helper< R(*)(T1, T2, T3)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5, T6)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5, T6, T7)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5, T6, T7, T8)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)>
 
struct  function_traits_helper< R(*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
 
class  remove_member_pointer
 
class  remove_member_pointer< R T::* >
 
struct  is_reference
 
struct  is_reference< T & >
 
struct  is_reference< T && >
 
struct  add_pointer
 
struct  remove_reference
 
struct  remove_reference< T & >
 
struct  remove_reference< T && >
 
struct  is_pointer
 
struct  is_pointer< T * >
 
struct  is_pointer< T *const >
 
struct  is_pointer< T *volatile >
 
struct  is_pointer< T *const volatile >
 
struct  remove_pointer
 
struct  remove_pointer< T * >
 
struct  remove_pointer< T *const >
 
struct  remove_pointer< T *volatile >
 
struct  remove_pointer< T *const volatile >
 
struct  is_ndarray
 
struct  is_ndarray< mu::NDArray< T > >
 
struct  KernelInfo
 
union  DpeOutput_t
 
union  DpeResult_t
 
union  DpeScore_t
 
union  DpeCsrDpb_t
 
union  DpeCsrLdb_t
 

Enumerations

enum class  DpeMode {
  Bsw = 0 , Mate = 1 , Global = 2 , DB = 3 ,
  NumDpeMode = 3
}
 
enum class  DpeLaunch { Sync = 0 , Async = 1 }
 
enum class  DpeBuffer { DPB = 0 , LDB = 1 }
 
enum class  LogLevel {
  Trace , Debug , Info , Warn ,
  Error , Critical , None
}
 

Functions

void Assert (bool cond, const char *file=__builtin_FILE(), const char *func=__builtin_FUNCTION(), int line=__builtin_LINE())
 Assertion function for runtime checks. More...
 
void exit ()
 Terminates the MU kernel execution. More...
 
int32_t atomicAdd (int32_t *address, int32_t val)
 Atomically adds a value to memory. More...
 
int32_t atomicAddAsync (int32_t *address, int32_t val)
 Atomically adds a value to memory asynchronously. More...
 
uint32_t atomicAnd (uint32_t *address, uint32_t val)
 Atomically performs bitwise AND operation with memory. More...
 
uint32_t atomicAndAsync (uint32_t *address, uint32_t val)
 Atomically performs bitwise AND operation with memory asynchronously. More...
 
uint32_t atomicOr (uint32_t *address, uint32_t val)
 Atomically performs bitwise OR operation with memory. More...
 
uint32_t atomicOrAsync (uint32_t *address, uint32_t val)
 Atomically performs bitwise OR operation with memory asynchronously. More...
 
uint32_t atomicXor (uint32_t *address, uint32_t val)
 Atomically performs bitwise XOR operation with memory. More...
 
uint32_t atomicXorAsync (uint32_t *address, uint32_t val)
 Atomically performs bitwise XOR operation with memory asynchronously. More...
 
int32_t atomicInc (int32_t *address, int32_t val)
 Atomically increments memory value. More...
 
int32_t atomicIncAsync (int32_t *address, int32_t val)
 Atomically increments memory value asynchronously. More...
 
int32_t atomicDec (int32_t *address, int32_t val)
 Atomically decrements memory value. More...
 
int32_t atomicDecAsync (int32_t *address, int32_t val)
 Atomically decrements memory value asynchronously. More...
 
int32_t atomicMin (int32_t *address, int32_t val)
 Atomically sets memory to minimum of current and new value. More...
 
int32_t atomicMax (int32_t *address, int32_t val)
 Atomically sets memory to maximum of current and new value. More...
 
int32_t atomicSwap (int32_t *address, int32_t val)
 Atomically exchanges memory value with new value. More...
 
int32_t atomicCAS (int32_t *address, int32_t val, int32_t compare)
 Atomically compares and swaps memory value. More...
 
int64_t atomicSwap58 (int64_t *address, int64_t val)
 Atomically exchanges memory value with new value (58-bit) More...
 
uint64_t atomicOr58 (uint64_t *address, uint64_t val)
 Atomically performs bitwise OR operation with memory (58-bit) More...
 
uint64_t atomicAnd58 (uint64_t *address, uint64_t val)
 Atomically performs bitwise AND operation with memory (58-bit) More...
 
uint64_t atomicXor58 (uint64_t *address, uint64_t val)
 Atomically performs bitwise XOR operation with memory (58-bit) More...
 
int32_t atomicLoad (int32_t *address)
 Atomically reads a value from memory. More...
 
int64_t atomicLoad58 (int64_t *address)
 Atomically reads a value from memory (58-bit) More...
 
int32_t atomicStoreAsync (int32_t *address, int32_t val)
 Atomically stores a value to memory asynchronously. More...
 
int64_t atomicStore58Async (int64_t *address, int64_t val)
 Atomically stores a value to memory asynchronously (58-bit) More...
 
uint64_t readGlobal (const void *src)
 Read a value from global cache. More...
 
void writeGlobal (void *dst, uint64_t value)
 Write a value to global cache. More...
 
void memcpyGlobal (void *dst, const void *src, uint64_t size)
 Copy data to global cache. More...
 
void flushCache (const void *addr, uint64_t size=64)
 Flush cache lines for a memory region. More...
 
void flushCacheAll ()
 Flush all cache lines for current thread. More...
 
void prefetch (const void *addr, uint64_t size=64)
 Prefetch a contiguous memory region into cache. More...
 
void prefetchStride (const void *addr, uint64_t count, uint64_t offset=64)
 Prefetch multiple cache lines at regular stride intervals. More...
 
bool prefetchLinkedList (const void *addr, uint64_t count, uint64_t ptrOffset)
 Prefetch cache lines by traversing a linked list. More...
 
uint64_t getClockCycle ()
 Get the current clock cycle count. More...
 
bool isNormalMode (uint32_t mode)
 
 CALL_HELPER (0)
 
 CALL_HELPER (1)
 
 CALL_HELPER (2)
 
 CALL_HELPER (3)
 
 CALL_HELPER (4)
 
 CALL_HELPER (5)
 
 CALL_HELPER (6)
 
 CALL_HELPER (7)
 
 CALL_HELPER (8)
 
 CALL_HELPER (9)
 
template<typename FP >
void callMain (FP func, uint32_t mode, uint32_t ndarrayValueBit, char *buffer)
 
void muSetDpbMemory (uint32_t swId, uint8_t isSrc1Physical, uint64_t src1, uint8_t isSrc2Physical, uint64_t src2, uint32_t count)
 
void muSetLdbMemory (uint32_t swId, uint8_t isSrc1Physical, uint64_t src1, uint8_t isSrc2Physical, uint64_t src2, uint32_t count)
 
uint64_t muRunDpe (uint32_t swId, DpeMode mode, uint32_t tMask, uint32_t iLen, uint32_t jStart, uint32_t jLen, uint32_t weight, uint8_t isPhysical, uint64_t dstAddr, uint32_t tOffset, uint32_t tDelta, uint32_t maxStart, uint32_t skipVsb, DpeLaunch asyncMode)
 
uint64_t getId ()
 Return the id of Mu. More...
 
uint64_t getExecutionCount ()
 Return the execution count of Mu. More...
 
int logPrintf (const char *format,...)
 Prints a formatted log message. More...
 
int logPrintf (LogLevel level, const char *format,...)
 Prints a formatted log message with a specified log level. More...
 
void asyncMessage (void *src, uint64_t size)
 Send asynchronous message to host. More...
 
void syncMessage (void *src, uint64_t size)
 Send synchronous message to host and wait for response. More...
 
uint32_t getTaskIdx (void)
 Get the current task index. More...
 
uint32_t getTaskCount (void)
 Get the total number of tasks. More...
 
int uartPrintf (const char *format,...)
 Print a formatted string to UART. More...
 
int hostPrintf (const char *format,...)
 Print a formatted string to the host. More...
 
void profilerStart (const char *tag)
 Start the profiler. More...
 
void profilerEnd (const char *tag)
 End the profiler. More...
 

Variables

template<typename T >
constexpr bool is_ndarray_v = is_ndarray<T>::value
 
constexpr uint64_t DpeAddrAlignBit = 6
 

Enumeration Type Documentation

◆ DpeBuffer

enum mu::DpeBuffer
strong
Enumerator
DPB 
LDB 

Definition at line 27 of file dpe_common.hpp.

28 {
29  DPB = 0,
30  LDB = 1,
31 };

◆ DpeLaunch

enum mu::DpeLaunch
strong
Enumerator
Sync 
Async 

Definition at line 21 of file dpe_common.hpp.

22 {
23  Sync = 0,
24  Async = 1
25 };

◆ DpeMode

enum mu::DpeMode
strong
Enumerator
Bsw 
Mate 
Global 
DB 
NumDpeMode 

Definition at line 12 of file dpe_common.hpp.

13 {
14  Bsw = 0, // ksw_extend2
15  Mate = 1, // ksw_u8
16  Global = 2, // ksw_global2
17  DB = 3,
18  NumDpeMode = 3,
19 };

◆ LogLevel

enum mu::LogLevel
strong
Enumerator
Trace 
Debug 
Info 
Warn 
Error 
Critical 
None 

Definition at line 9 of file logger_const.hpp.

10 {
11  Trace,
12  Debug,
13  Info,
14  Warn,
15  Error,
16  Critical,
17  None,
18 };

Function Documentation

◆ Assert()

void mu::Assert ( bool  cond,
const char *  file = __builtin_FILE(),
const char *  func = __builtin_FUNCTION(),
int  line = __builtin_LINE() 
)

Assertion function for runtime checks.

This function performs runtime assertion checks in debug builds. When the condition is false, it triggers a kernel halt for debugging.

Parameters
condThe boolean condition to check
fileSource file where the assertion occurred (automatically filled)
funcFunction name where the assertion occurred (automatically filled)
lineLine number where the assertion occurred (automatically filled)

◆ asyncMessage()

void mu::asyncMessage ( void *  src,
uint64_t  size 
)

Send asynchronous message to host.

Sends a message to the host system without waiting for a response. This function returns immediately after sending the message.

Parameters
srcPointer to the source data to be sent
sizeSize of the data in bytes
Note
This is a non-blocking operation

◆ atomicAdd()

int32_t mu::atomicAdd ( int32_t *  address,
int32_t  val 
)

Atomically adds a value to memory.

Computes (old + val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to add
Returns
int32_t The old value before the operation

◆ atomicAddAsync()

int32_t mu::atomicAddAsync ( int32_t *  address,
int32_t  val 
)

Atomically adds a value to memory asynchronously.

Computes (old + val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to add
Returns
int32_t Always returns 0

◆ atomicAnd()

uint32_t mu::atomicAnd ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise AND operation with memory.

Computes (old & val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to AND with
Returns
uint32_t The old value before the operation

◆ atomicAnd58()

uint64_t mu::atomicAnd58 ( uint64_t *  address,
uint64_t  val 
)

Atomically performs bitwise AND operation with memory (58-bit)

Note
Supported since MX1S Computes (old & val) and stores the result in memory
Parameters
addressTarget memory address
valValue to AND with
Returns
uint64_t The old value before the operation

◆ atomicAndAsync()

uint32_t mu::atomicAndAsync ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise AND operation with memory asynchronously.

Computes (old & val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to AND with
Returns
uint32_t Always returns 0

◆ atomicCAS()

int32_t mu::atomicCAS ( int32_t *  address,
int32_t  val,
int32_t  compare 
)

Atomically compares and swaps memory value.

Computes ((old == compare) ? val : old) and stores the result in memory

Parameters
addressTarget memory address
valNew value to set if comparison succeeds
compareValue to compare with
Returns
int32_t The old value before the operation

◆ atomicDec()

int32_t mu::atomicDec ( int32_t *  address,
int32_t  val 
)

Atomically decrements memory value.

Computes (((old == 0) || (old > val)) ? val : (old - 1)) and stores the result in memory.

Parameters
addressTarget memory address
valMinimum value before wrapping
Returns
int32_t The old value before the operation

◆ atomicDecAsync()

int32_t mu::atomicDecAsync ( int32_t *  address,
int32_t  val 
)

Atomically decrements memory value asynchronously.

Computes (((old == 0) || (old > val)) ? val : (old - 1)) and stores the result in memory.

Parameters
addressTarget memory address
valMinimum value before wrapping
Returns
int32_t Always returns 0

◆ atomicInc()

int32_t mu::atomicInc ( int32_t *  address,
int32_t  val 
)

Atomically increments memory value.

Computes ((old >= val) ? 0 : (old + 1)) and stores the result in memory.

Parameters
addressTarget memory address
valMaximum value before wrapping
Returns
int32_t The old value before the operation

◆ atomicIncAsync()

int32_t mu::atomicIncAsync ( int32_t *  address,
int32_t  val 
)

Atomically increments memory value asynchronously.

Computes ((old >= val) ? 0 : (old + 1)) and stores the result in memory.

Parameters
addressTarget memory address
valMaximum value before wrapping
Returns
int32_t Always returns 0

◆ atomicLoad()

int32_t mu::atomicLoad ( int32_t *  address)

Atomically reads a value from memory.

Parameters
addressMemory address to read from
Returns
int32_t The value read from the address

◆ atomicLoad58()

int64_t mu::atomicLoad58 ( int64_t *  address)

Atomically reads a value from memory (58-bit)

Note
Supported since MX1S
Parameters
addressMemory address to read from
Returns
uint64_t The value read from the address

◆ atomicMax()

int32_t mu::atomicMax ( int32_t *  address,
int32_t  val 
)

Atomically sets memory to maximum of current and new value.

Computes max(old, val) and stores the result in memory

Parameters
addressTarget memory address
valValue to compare with
Returns
int32_t The old value before the operation

◆ atomicMin()

int32_t mu::atomicMin ( int32_t *  address,
int32_t  val 
)

Atomically sets memory to minimum of current and new value.

Computes min(old, val) and stores the result in memory

Parameters
addressTarget memory address
valValue to compare with
Returns
int32_t The old value before the operation

◆ atomicOr()

uint32_t mu::atomicOr ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise OR operation with memory.

Computes (old | val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to OR with
Returns
uint32_t The old value before the operation

◆ atomicOr58()

uint64_t mu::atomicOr58 ( uint64_t *  address,
uint64_t  val 
)

Atomically performs bitwise OR operation with memory (58-bit)

Note
Supported since MX1S Computes (old | val) and stores the result in memory
Parameters
addressTarget memory address
valValue to OR with
Returns
uint64_t The old value before the operation

◆ atomicOrAsync()

uint32_t mu::atomicOrAsync ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise OR operation with memory asynchronously.

Computes (old | val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to OR with
Returns
uint32_t Always returns 0

◆ atomicStore58Async()

int64_t mu::atomicStore58Async ( int64_t *  address,
int64_t  val 
)

Atomically stores a value to memory asynchronously (58-bit)

Stores a value to memory with atomic guarantees. This function performs the operation asynchronously.

Note
Supported since MX1S
Parameters
addressTarget memory address
valValue to store
Returns
int64_t Always returns 0

◆ atomicStoreAsync()

int32_t mu::atomicStoreAsync ( int32_t *  address,
int32_t  val 
)

Atomically stores a value to memory asynchronously.

Stores a value to memory with atomic guarantees. This function performs the operation asynchronously.

Note
Supported since MX1S
Parameters
addressTarget memory address
valValue to store
Returns
int32_t Always returns 0

◆ atomicSwap()

int32_t mu::atomicSwap ( int32_t *  address,
int32_t  val 
)

Atomically exchanges memory value with new value.

Parameters
addressTarget memory address
valValue to swap with
Returns
int32_t The old value before the operation

◆ atomicSwap58()

int64_t mu::atomicSwap58 ( int64_t *  address,
int64_t  val 
)

Atomically exchanges memory value with new value (58-bit)

Note
Supported since MX1S
Parameters
addressTarget memory address
valValue to swap with
Returns
int64_t The old value before the operation

◆ atomicXor()

uint32_t mu::atomicXor ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise XOR operation with memory.

Computes (old ^ val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to XOR with
Returns
uint32_t The old value before the operation

◆ atomicXor58()

uint64_t mu::atomicXor58 ( uint64_t *  address,
uint64_t  val 
)

Atomically performs bitwise XOR operation with memory (58-bit)

Note
Supported since MX1S Computes (old ^ val) and stores the result in memory
Parameters
addressTarget memory address
valValue to XOR with
Returns
uint64_t The old value before the operation

◆ atomicXorAsync()

uint32_t mu::atomicXorAsync ( uint32_t *  address,
uint32_t  val 
)

Atomically performs bitwise XOR operation with memory asynchronously.

Computes (old ^ val) and stores the result in memory.

Parameters
addressTarget memory address
valValue to XOR with
Returns
uint32_t Always returns 0

◆ CALL_HELPER() [1/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [2/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [3/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [4/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [5/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [6/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [7/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [8/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [9/10]

mu::CALL_HELPER ( )

◆ CALL_HELPER() [10/10]

mu::CALL_HELPER ( )

◆ callMain()

template<typename FP >
void mu::callMain ( FP  func,
uint32_t  mode,
uint32_t  ndarrayValueBit,
char *  buffer 
)
inline

Definition at line 141 of file call_main.hpp.

142 {
143  CallHelper<typename remove_pointer<FP>::type>::invoke(func, mode, ndarrayValueBit, buffer);
144 }

◆ exit()

void mu::exit ( )

Terminates the MU kernel execution.

Forces an immediate termination of the MU kernel's execution. This function is typically called after a critical assertion failure.

Note
This function does not return

◆ flushCache()

void mu::flushCache ( const void *  addr,
uint64_t  size = 64 
)

Flush cache lines for a memory region.

This function flushes all cache lines that contain data from the specified memory region, ensuring that modified data in those cache lines is written back to memory. The function will flush all cache lines that overlap with the memory range [addr, addr + size).

Parameters
addrStarting address of the memory region to flush
sizeSize of the memory region in bytes (default: 64 bytes)

◆ flushCacheAll()

void mu::flushCacheAll ( )

Flush all cache lines for current thread.

This function flushes all cache lines in the cache hierarchy associated with the current thread, ensuring that all modified data across all cache lines is written back to memory. This operation only affects the cache lines belonging to the current thread's cache hierarchy.

◆ getClockCycle()

uint64_t mu::getClockCycle ( )

Get the current clock cycle count.

Returns the current processor clock cycle count.

  • MX1P: Returns 32-bit value (will overflow periodically)
  • MX1S: Returns 64-bit value
Note
For MX1P on a 1 GHz processor:
  • Each cycle is 1 nanosecond
  • 2^32 cycles = ~4.29 seconds
  • Counter will overflow approximately every 4.29 seconds
Returns
uint64_t The current clock cycle count

◆ getExecutionCount()

uint64_t mu::getExecutionCount ( )

Return the execution count of Mu.

This function returns the execution count of Mu.

Returns
The execution count of Mu.

◆ getId()

uint64_t mu::getId ( )

Return the id of Mu.

This function returns the id of Mu.

Returns
The id of Mu.

◆ getTaskCount()

uint32_t mu::getTaskCount ( void  )

Get the total number of tasks.

This function returns the total number of tasks in the current execution.

Returns
uint32_t The total number of tasks.

◆ getTaskIdx()

uint32_t mu::getTaskIdx ( void  )

Get the current task index.

This function returns the index of the currently executing task.

Returns
uint32_t The index of the current task.

◆ hostPrintf()

int mu::hostPrintf ( const char *  format,
  ... 
)

Print a formatted string to the host.

This function sends a formatted string to the host interface. It behaves similarly to the standard printf function but targets the host.

Parameters
formatThe format string.
...Additional arguments specifying data to print.
Returns
int The number of characters printed.

◆ isNormalMode()

bool mu::isNormalMode ( uint32_t  mode)

◆ logPrintf() [1/2]

int mu::logPrintf ( const char *  format,
  ... 
)

Prints a formatted log message.

This function prints a formatted log message using the specified format string and additional arguments. The log information is stored in memory and can be accessed via a CLI.

Parameters
formatThe format string.
...Additional arguments for the format string.
Returns
The number of characters printed.

◆ logPrintf() [2/2]

int mu::logPrintf ( LogLevel  level,
const char *  format,
  ... 
)

Prints a formatted log message with a specified log level.

This function prints a formatted log message using the specified log level, format string, and additional arguments. The log information is stored in memory and can be accessed via a CLI.

Parameters
levelThe log level.
formatThe format string.
...Additional arguments for the format string.
Returns
The number of characters printed.

◆ memcpyGlobal()

void mu::memcpyGlobal ( void *  dst,
const void *  src,
uint64_t  size 
)

Copy data to global cache.

This function copies data from source to destination and writes it directly to the global cache for shared access across multiple cores.

Parameters
dstDestination address in global cache
srcSource address to copy from
sizeNumber of bytes to copy

◆ muRunDpe()

uint64_t mu::muRunDpe ( uint32_t  swId,
DpeMode  mode,
uint32_t  tMask,
uint32_t  iLen,
uint32_t  jStart,
uint32_t  jLen,
uint32_t  weight,
uint8_t  isPhysical,
uint64_t  dstAddr,
uint32_t  tOffset,
uint32_t  tDelta,
uint32_t  maxStart,
uint32_t  skipVsb,
DpeLaunch  asyncMode 
)

◆ muSetDpbMemory()

void mu::muSetDpbMemory ( uint32_t  swId,
uint8_t  isSrc1Physical,
uint64_t  src1,
uint8_t  isSrc2Physical,
uint64_t  src2,
uint32_t  count 
)

◆ muSetLdbMemory()

void mu::muSetLdbMemory ( uint32_t  swId,
uint8_t  isSrc1Physical,
uint64_t  src1,
uint8_t  isSrc2Physical,
uint64_t  src2,
uint32_t  count 
)

◆ prefetch()

void mu::prefetch ( const void *  addr,
uint64_t  size = 64 
)

Prefetch a contiguous memory region into cache.

This function prefetches memory starting from the specified address for the given size in bytes.

Parameters
addrStarting address for prefetch. Should be 64-byte aligned (cache line boundary) for optimal performance.
sizeNumber of bytes to prefetch (valid range: 64 to 512 bytes, default: 64 bytes)

◆ prefetchLinkedList()

bool mu::prefetchLinkedList ( const void *  addr,
uint64_t  count,
uint64_t  ptrOffset 
)

Prefetch cache lines by traversing a linked list.

This function prefetches cache lines by following a linked list structure. Starting from the given address, it reads the next pointer located at addr + ptrOffset and follows the chain, prefetching each node up to count times. The traversal stops early if a null pointer (0) is encountered at the next pointer location.

Parameters
addrStarting address of the linked list node. Must be 8-byte aligned.
countMaximum number of nodes to prefetch (valid range: 1 to 8)
ptrOffsetOffset to the next pointer in 8-byte units (valid range: 0 to 4088, must be 8-byte aligned)
Returns
true if prefetch succeeded, false if invalid parameters were provided

◆ prefetchStride()

void mu::prefetchStride ( const void *  addr,
uint64_t  count,
uint64_t  offset = 64 
)

Prefetch multiple cache lines at regular stride intervals.

This function prefetches cache lines starting from the specified address at regular intervals. The prefetch operation iterates from i = 0 to count - 1, prefetching the cache line at address: addr + offset * i.

Note
Only the cache line (64 bytes) at each calculated address is prefetched. Memory between stride intervals is NOT prefetched.
Parameters
addrStarting address for prefetch. Should be 64-byte aligned (cache line boundary) for optimal performance.
countNumber of cache lines to prefetch (valid range: 1 to 8)
offsetStride interval in bytes (valid range: 64 to 4088, must be 64-byte aligned, default: 64 bytes)

◆ profilerEnd()

void mu::profilerEnd ( const char *  tag)

End the profiler.

This function ends the profiler.

◆ profilerStart()

void mu::profilerStart ( const char *  tag)

Start the profiler.

This function starts the profiler.

◆ readGlobal()

uint64_t mu::readGlobal ( const void *  src)

Read a value from global cache.

This function reads a 64-bit value from the specified address in the global cache. It ensures that the data is read directly from the global cache for shared access.

Parameters
srcSource address in global cache
Returns
uint64_t The value read from the global cache

◆ syncMessage()

void mu::syncMessage ( void *  src,
uint64_t  size 
)

Send synchronous message to host and wait for response.

Sends a message to the host system and blocks until receiving a response. The function will not return until the host processes the message.

Parameters
srcPointer to the source data to be sent
sizeSize of the data in bytes
Note
This is a blocking operation
See also
asyncMessage() for non-blocking alternative

◆ uartPrintf()

int mu::uartPrintf ( const char *  format,
  ... 
)

Print a formatted string to UART.

This function sends a formatted string to the UART interface. It behaves similarly to the standard printf function but targets UART.

Parameters
formatThe format string.
...Additional arguments specifying data to print.
Returns
int The number of characters printed.

◆ writeGlobal()

void mu::writeGlobal ( void *  dst,
uint64_t  value 
)

Write a value to global cache.

This function writes a 64-bit value to the specified address in the global cache. It ensures that the data is written directly to the global cache for shared access.

Parameters
dstDestination address in global cache
valueValue to write

Variable Documentation

◆ DpeAddrAlignBit

constexpr uint64_t mu::DpeAddrAlignBit = 6
constexpr

Definition at line 11 of file dpe_common.hpp.

◆ is_ndarray_v

template<typename T >
constexpr bool mu::is_ndarray_v = is_ndarray<T>::value
constexpr

Definition at line 264 of file call_main_template.hpp.