Loop Timing Witness
Native controller and runtime interfaces; hardware qualification pending
Loading...
Searching...
No Matches
amp_contract.h File Reference

Go to the source code of this file.

Classes

struct  witness_amp_platform_contract
struct  witness_amp_run_contract
struct  witness_amp_sample
struct  witness_amp_mailbox

Macros

#define WITNESS_AMP_ABI   UINT32_C(2)
#define WITNESS_AMP_CAPACITY   UINT32_C(256)

Enumerations

enum  witness_amp_status { WITNESS_AMP_INITIAL = 0 , WITNESS_AMP_ARMED = 1 , WITNESS_AMP_FINISHED , WITNESS_AMP_REFUSED = 3 }
enum  witness_amp_logger_status { WITNESS_AMP_LOGGER_WAITING , WITNESS_AMP_LOGGER_COMPLETE , WITNESS_AMP_LOGGER_READY = 2 }

Functions

_Noreturn void witness_amp_main (void)
void witness_amp_trap (uint64_t cause, uint64_t value)
_Noreturn void witness_amp_rust_panic (void)
_Noreturn void witness_amp_exit (void)

Variables

const witness_amp_platform_contract witness_amp_platform
const witness_amp_run_contract witness_amp_run

Detailed Description

dedicated hart and single producer telemetry contract.

Definition in file amp_contract.h.

Macro Definition Documentation

◆ WITNESS_AMP_ABI

#define WITNESS_AMP_ABI   UINT32_C(2)

Telemetry ABI and power-of-two capacity; fullness is never silent data loss.

Definition at line 18 of file amp_contract.h.

◆ WITNESS_AMP_CAPACITY

#define WITNESS_AMP_CAPACITY   UINT32_C(256)

Telemetry ring capacity; producer and consumer index it with a power-of-two mask.

Definition at line 20 of file amp_contract.h.

Enumeration Type Documentation

◆ witness_amp_logger_status

Logger owns readiness and final close acknowledgement after firmware publishes its fresh ABI.

Enumerator
WITNESS_AMP_LOGGER_WAITING 

Firmware waits for the sole logger to validate the fresh mailbox.

WITNESS_AMP_LOGGER_COMPLETE 

Logger has flushed and closed both completed output streams.

WITNESS_AMP_LOGGER_READY 

Logger owns the consumer and is ready to drain telemetry.

Definition at line 63 of file amp_contract.h.

◆ witness_amp_status

Status is monotonic: initial, armed, run finished or terminal refusal.

Enumerator
WITNESS_AMP_INITIAL 

Mailbox is initialised; the controller is not armed.

WITNESS_AMP_ARMED 

Controller interrupt service is armed for the configured run.

WITNESS_AMP_FINISHED 

The finite run completed and telemetry remains available for draining.

WITNESS_AMP_REFUSED 

Terminal refusal; trap cause and value retain the failure.

Definition at line 54 of file amp_contract.h.

Function Documentation

◆ witness_amp_exit()

_Noreturn void witness_amp_exit ( void )

Platform-specific termination after the real logger has flushed both completed streams.

◆ witness_amp_main()

_Noreturn void witness_amp_main ( void )

Validate the dedicated context, arm one IRQ source and wait for actual traps.

◆ witness_amp_rust_panic()

_Noreturn void witness_amp_rust_panic ( void )

Rust panic termination shares the original terminal telemetry refusal path.

◆ witness_amp_trap()

void witness_amp_trap ( uint64_t cause,
uint64_t value )

Service architectural machine external IRQs; other traps terminate controller service.

Variable Documentation

◆ witness_amp_platform

const witness_amp_platform_contract witness_amp_platform
extern

Platform and run data must be supplied by the complete firmware build, never defaulted.

◆ witness_amp_run

const witness_amp_run_contract witness_amp_run
extern

Immutable operator-supplied run data compiled into the hash-bound image.