Difference between revisions of "OCEOSmp/blank"

From wiki
Jump to navigation Jump to search
Line 7: Line 7:


SPARC:
SPARC:
In OCEOS system time is based on two chained 32-bit timers.
In OCEOS system time is based on two chained 32-bit timers.


Line 16: Line 17:


ARM Cortex-M:
ARM Cortex-M:
In OCEOS for ARM Cortex-M, system time is based on SysTick. The processor has a 24-bit system timer, SysTick, that counts down from the reload value to zero, reloads (wraps to) the value in the LOAD register on the next clock edge, then counts down on subsequent clocks.
In OCEOS for ARM Cortex-M, system time is based on SysTick. The processor has a 24-bit system timer, SysTick, that counts down from the reload value to zero, reloads (wraps to) the value in the LOAD register on the next clock edge, then counts down on subsequent clocks.


Line 24: Line 26:


RISC-V:
RISC-V:
TBD
TBD



Revision as of 15:06, 3 May 2024

Next Section

Timing directives

Introduction

SPARC:

In OCEOS system time is based on two chained 32-bit timers.

No interrupts are involved, the current system time is obtained by reading the two timer counter registers (in an atomic way) and then inverting the values since the timers count down.

The scaler associated with the timers is configured based on the system clock frequency to decrement the low order timer every microsecond. This decrements the high order timer when it rolls over, every 71.6 minutes approximately. The 64-bit time range is very long, over 584,000 years.

ARM Cortex-M:

In OCEOS for ARM Cortex-M, system time is based on SysTick. The processor has a 24-bit system timer, SysTick, that counts down from the reload value to zero, reloads (wraps to) the value in the LOAD register on the next clock edge, then counts down on subsequent clocks.

Note: When the processor is halted for debugging the counter does not decrement.

OCEOS initializes the timer to be driven from MCK and counting down to zero asserts SysTick exception request. OCEOS has 64 bit counter which is increased by 0xFFFFFF value every time timer reloads.

RISC-V:

TBD

The units of OCEOS system time are microseconds on SPARC and ARM and on RISC-V the period of the clock cycle.

The system time is reset to 0 by oceos_init()

oceos_time_sys_get64()

Header File
oceos_timer.h

Description
This function returns the current system time as a 64-bit number.

Prototype

**
 * Get the current system time (64-bit)
 *
 * @return U64_t
 */
U64_t oceos_time_sys_get64(void);

Parameters

There are no parameters to this function.

Returns
This function returns an S64_t with the current system time.

Example Usage

S64_t now;
...
// Get the time
now = oceos_time_sys_get64();

oceos_time_sys_get32()

Header File
oceos_timer.h

Description
This function returns the low 32 bits of the system time.

Prototype

/**
 * Get the current system time (low 32 bits of 64 bit value)
 *
 * @return U32_t
 */
U32_t oceos_time_sys_get32(void);

Parameters
There are no parameters to this function.

Returns
This function returns an S32_t with the current system time.

Example Usage

S32_t now;
...
// Get the time
now = oceos_time_sys_get32();


blank_function()

Header File
header.h

Description
This function does xyz...

Prototype

S32_t oceosmp_blank(
    U32_t param
);

Parameters

Parameter Description
param parameter to function

Returns
This function returns an S32_t with a value of OCEOS_SUCCESS (zero) or return code bits set as defined in the table below.

Error bit Description
Error_name description

Example Usage

S32_t status, param;
...
// Do xyz
status = oceosmp_blank(param));