Implement AXIS parity UI and execution baseline
This commit is contained in:
58
wasm-core/include/sim_scheduler.h
Normal file
58
wasm-core/include/sim_scheduler.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#ifndef LINUXCNC_WEB_WASM_SIM_SCHEDULER_H
|
||||
#define LINUXCNC_WEB_WASM_SIM_SCHEDULER_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SIM_SCHEDULER_SCHEMA_VERSION 1U
|
||||
#define SIM_SCHEDULER_PHASE_COUNT 8U
|
||||
#define SIM_SCHEDULER_DEFAULT_BUDGET 1000000U
|
||||
#define SIM_SCHEDULER_CANONICAL_CAPACITY 512U
|
||||
|
||||
enum sim_scheduler_result {
|
||||
SIM_SCHEDULER_OK = 0,
|
||||
SIM_SCHEDULER_ERR_ARGUMENT = -1100,
|
||||
SIM_SCHEDULER_ERR_RANGE = -1101,
|
||||
SIM_SCHEDULER_ERR_BUDGET = -1102,
|
||||
SIM_SCHEDULER_ERR_OVERFLOW = -1103,
|
||||
SIM_SCHEDULER_ERR_BUFFER = -1104,
|
||||
};
|
||||
|
||||
enum sim_scheduler_phase {
|
||||
SIM_SCHEDULER_RECONCILE = 0,
|
||||
SIM_SCHEDULER_TASK = 1,
|
||||
SIM_SCHEDULER_TP = 2,
|
||||
SIM_SCHEDULER_KINEMATICS = 3,
|
||||
SIM_SCHEDULER_MOTION = 4,
|
||||
SIM_SCHEDULER_HAL_IO = 5,
|
||||
SIM_SCHEDULER_CALLBACKS = 6,
|
||||
SIM_SCHEDULER_PUBLISH = 7,
|
||||
};
|
||||
|
||||
typedef struct sim_scheduler {
|
||||
uint32_t tick;
|
||||
uint32_t budget;
|
||||
uint32_t last_cycles;
|
||||
uint32_t phase_trace[SIM_SCHEDULER_PHASE_COUNT];
|
||||
} sim_scheduler;
|
||||
|
||||
uint32_t sim_scheduler_size(void);
|
||||
int32_t sim_scheduler_init(sim_scheduler *scheduler, uint32_t budget);
|
||||
int32_t sim_scheduler_reset(sim_scheduler *scheduler);
|
||||
int32_t sim_scheduler_step(sim_scheduler *scheduler, uint32_t cycles);
|
||||
int32_t sim_scheduler_restore(sim_scheduler *scheduler, uint32_t tick, uint32_t budget,
|
||||
uint32_t last_cycles, const uint32_t *phase_trace,
|
||||
uint32_t phase_count);
|
||||
int32_t sim_scheduler_read(const sim_scheduler *scheduler, sim_scheduler *out);
|
||||
uint32_t sim_scheduler_tick(const sim_scheduler *scheduler);
|
||||
uint64_t sim_scheduler_state_hash(const sim_scheduler *scheduler);
|
||||
uint32_t sim_scheduler_canonical(const sim_scheduler *scheduler, char *output, uint32_t capacity);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user