Skip to content

Commit de3fbfe

Browse files
tbitcsoz-agent
andcommitted
fix(benchmarks): generate and check in C model tables for CI builds
kalman_benchmark and pid_benchmark reference ARBITER_generated_model which is produced by arbiterc compile. Generated the C tables from the canonical sample models: - kalman.arb.yaml → kalman_benchmark/src/arbiter_model.{c,h} - pid_engine.arb.yaml → pid_benchmark/src/arbiter_model.{c,h} Updated both CMakeLists.txt to include arbiter_model.c in the build. No arbiterc invocation required in CI — the tables are static fixtures. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent c6d2296 commit de3fbfe

6 files changed

Lines changed: 238 additions & 2 deletions

File tree

tests/benchmarks/kalman_benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ cmake_minimum_required(VERSION 3.20.0)
44
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
55
project(kalman_benchmark)
66

7-
target_sources(app PRIVATE src/main.c)
7+
target_sources(app PRIVATE src/main.c src/arbiter_model.c)
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* AUTO-GENERATED by arbiterc — do not edit */
3+
4+
#include "arbiter_model.h"
5+
#include <arbiter/arbiter.h>
6+
7+
static const struct ARBITER_fact_def model_facts[] = {
8+
{ .id = 0, .type = ARBITER_FACT_BOOL, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "in.enable" },
9+
{ .id = 1, .type = ARBITER_FACT_INT32, .range_min = -500000, .range_max = 500000, .default_value = 0, .stale_after_ms = 100, .safety_relevant = true, .name = "in.measurement" },
10+
{ .id = 2, .type = ARBITER_FACT_BOOL, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = true, .name = "in.sensor_valid" },
11+
{ .id = 3, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.correction" },
12+
{ .id = 4, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.denom" },
13+
{ .id = 5, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.innovation" },
14+
{ .id = 6, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 1000, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.k_gain" },
15+
{ .id = 7, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 10000, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.p_est" },
16+
{ .id = 8, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.p_factor" },
17+
{ .id = 9, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.p_pred" },
18+
{ .id = 10, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.x_est" },
19+
{ .id = 11, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "kf.x_pred" },
20+
{ .id = 12, .type = ARBITER_FACT_INT32, .range_min = 1, .range_max = 100000, .default_value = 100, .stale_after_ms = 0, .safety_relevant = false, .name = "param.q" },
21+
{ .id = 13, .type = ARBITER_FACT_INT32, .range_min = 1, .range_max = 500000, .default_value = 5000, .stale_after_ms = 0, .safety_relevant = false, .name = "param.r" },
22+
};
23+
24+
static const struct ARBITER_condition_def model_conditions[] = {
25+
{ .fact_id = 2, .op = ARBITER_OP_EQ, .value = 0, .group = ARBITER_COND_ANY, .group_index = 0, .next = UINT16_MAX },
26+
{ .fact_id = 1, .op = ARBITER_OP_STALE, .value = 100, .group = ARBITER_COND_ANY, .group_index = 0, .next = UINT16_MAX },
27+
{ .fact_id = 0, .op = ARBITER_OP_EQ, .value = 0, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
28+
{ .fact_id = 0, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
29+
{ .fact_id = 2, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
30+
{ .fact_id = 0, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
31+
{ .fact_id = 2, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
32+
{ .fact_id = 0, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
33+
{ .fact_id = 2, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
34+
{ .fact_id = 0, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
35+
};
36+
37+
static const struct ARBITER_action_def model_actions[] = {
38+
{ .id = 0, .type = ARBITER_ACTION_CALLBACK, .target_fact_id = 0, .target_value = 0, .callback = NULL, .must_complete_within_ms = 0, .safe_state_action = false, .name = "publish_estimate" },
39+
};
40+
41+
static const struct ARBITER_rule_def model_rules[] = {
42+
{ .id = 0, .rule_class = ARBITER_RULE_SAFETY_GUARD, .condition_start = 0, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 2, .safety_critical = true, .name = "01_fault.sensor", .explanation = "Sensor fault — hold last estimate." },
43+
{ .id = 1, .rule_class = ARBITER_RULE_MODE_GUARD, .condition_start = 2, .condition_count = 1, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 0, .safety_critical = false, .name = "02_check.disabled", .explanation = NULL },
44+
{ .id = 2, .rule_class = ARBITER_RULE_INFERENCE, .condition_start = 3, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 1, .safety_critical = false, .name = "10_predict", .explanation = "Predict: propagate state and covariance." },
45+
{ .id = 3, .rule_class = ARBITER_RULE_INFERENCE, .condition_start = 5, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = UINT16_MAX, .safety_critical = false, .name = "20_update.gain", .explanation = "Update: compute Kalman gain." },
46+
{ .id = 4, .rule_class = ARBITER_RULE_INFERENCE, .condition_start = 7, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = UINT16_MAX, .safety_critical = false, .name = "30_update.state", .explanation = "Update: correct state estimate and covariance." },
47+
{ .id = 5, .rule_class = ARBITER_RULE_OBLIGATION, .condition_start = 9, .condition_count = 1, .action_start = 0, .action_count = 1, .safety_goal_id = UINT16_MAX, .set_mode = UINT16_MAX, .safety_critical = false, .name = "40_output", .explanation = "Publish filtered estimate." },
48+
};
49+
50+
static const char *model_mode_names[] = {
51+
"mode.idle",
52+
"mode.running",
53+
"mode.sensor_fault",
54+
};
55+
56+
const struct ARBITER_model ARBITER_generated_model = {
57+
.name = "kalman_filter",
58+
.model_hash = { 0x10, 0x02, 0x58, 0x54, 0xfc, 0x10, 0x21, 0x0c, 0x74, 0x4c, 0x80, 0xb0, 0xbd, 0xbd, 0xdb, 0xe7, 0xf9, 0x00, 0xa3, 0x07, 0xd0, 0xb3, 0x6c, 0x33, 0x65, 0xa4, 0xde, 0x27, 0x3a, 0x5c, 0xb1, 0xcb },
59+
.schema_hash = { 0x0d, 0x55, 0x33, 0x65, 0xf3, 0x4e, 0x02, 0xf3, 0xf8, 0x94, 0xe8, 0x25, 0xbb, 0x47, 0x86, 0x45, 0xfd, 0x8b, 0x78, 0xb1, 0x27, 0xf5, 0x8c, 0x42, 0xba, 0xbd, 0x80, 0x1f, 0x77, 0x57, 0x1f, 0x35 },
60+
.fact_count = 14,
61+
.rule_count = 6,
62+
.condition_count = 10,
63+
.action_count = 1,
64+
.mode_count = 3,
65+
.facts = model_facts,
66+
.rules = model_rules,
67+
.conditions = model_conditions,
68+
.actions = model_actions,
69+
.mode_names = model_mode_names,
70+
};
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* AUTO-GENERATED by arbiterc — do not edit */
3+
4+
#pragma once
5+
6+
#include <stdint.h>
7+
#include <stddef.h>
8+
#include <arbiter/arbiter_model.h>
9+
10+
#define ARBITER_MODEL_NAME "kalman_filter"
11+
#define ARBITER_MODEL_HASH "10025854fc10210c744c80b0bdbddbe7f900a307d0b36c3365a4de273a5cb1cb"
12+
#define ARBITER_MODEL_FACT_COUNT 14u
13+
#define ARBITER_MODEL_RULE_COUNT 6u
14+
#define ARBITER_MODEL_CONDITION_COUNT 10u
15+
#define ARBITER_MODEL_ACTION_COUNT 1u
16+
#define ARBITER_MODEL_MAX_FACTS 14u
17+
#define ARBITER_MODEL_MAX_RULES 6u
18+
#define ARBITER_MODEL_MAX_CONDITIONS 10u
19+
#define ARBITER_MODEL_MAX_ACTIONS 1u
20+
#define ARBITER_MODEL_WCET_OP_COUNT 16u
21+
#define ARBITER_MODEL_TRACE_CAPACITY 6u
22+
23+
extern const struct ARBITER_model ARBITER_generated_model;
24+
25+
#define ARBITER_FACT_IN_ENABLE 0u
26+
#define ARBITER_FACT_IN_MEASUREMENT 1u
27+
#define ARBITER_FACT_IN_SENSOR_VALID 2u
28+
#define ARBITER_FACT_KF_CORRECTION 3u
29+
#define ARBITER_FACT_KF_DENOM 4u
30+
#define ARBITER_FACT_KF_INNOVATION 5u
31+
#define ARBITER_FACT_KF_K_GAIN 6u
32+
#define ARBITER_FACT_KF_P_EST 7u
33+
#define ARBITER_FACT_KF_P_FACTOR 8u
34+
#define ARBITER_FACT_KF_P_PRED 9u
35+
#define ARBITER_FACT_KF_X_EST 10u
36+
#define ARBITER_FACT_KF_X_PRED 11u
37+
#define ARBITER_FACT_PARAM_Q 12u
38+
#define ARBITER_FACT_PARAM_R 13u
39+
40+
#define ARBITER_MODE_MODE_IDLE 0u
41+
#define ARBITER_MODE_MODE_RUNNING 1u
42+
#define ARBITER_MODE_MODE_SENSOR_FAULT 2u

tests/benchmarks/pid_benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ cmake_minimum_required(VERSION 3.20.0)
44
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
55
project(pid_benchmark)
66

7-
target_sources(app PRIVATE src/main.c)
7+
target_sources(app PRIVATE src/main.c src/arbiter_model.c)
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* AUTO-GENERATED by arbiterc — do not edit */
3+
4+
#include "arbiter_model.h"
5+
#include <arbiter/arbiter.h>
6+
7+
static const struct ARBITER_fact_def model_facts[] = {
8+
{ .id = 0, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 100000, .default_value = 800, .stale_after_ms = 0, .safety_relevant = false, .name = "gain.kd" },
9+
{ .id = 1, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 100000, .default_value = 100, .stale_after_ms = 0, .safety_relevant = false, .name = "gain.ki" },
10+
{ .id = 2, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 100000, .default_value = 2500, .stale_after_ms = 0, .safety_relevant = false, .name = "gain.kp" },
11+
{ .id = 3, .type = ARBITER_FACT_UINT32, .range_min = 1, .range_max = 1000, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "in.dt_ms" },
12+
{ .id = 4, .type = ARBITER_FACT_BOOL, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "in.enable" },
13+
{ .id = 5, .type = ARBITER_FACT_INT32, .range_min = -180000, .range_max = 180000, .default_value = 0, .stale_after_ms = 50, .safety_relevant = true, .name = "in.process_value" },
14+
{ .id = 6, .type = ARBITER_FACT_BOOL, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = true, .name = "in.sensor_valid" },
15+
{ .id = 7, .type = ARBITER_FACT_INT32, .range_min = -180000, .range_max = 180000, .default_value = 0, .stale_after_ms = 200, .safety_relevant = false, .name = "in.setpoint" },
16+
{ .id = 8, .type = ARBITER_FACT_UINT32, .range_min = 0, .range_max = 360000, .default_value = 0, .stale_after_ms = 0, .safety_relevant = true, .name = "pid.abs_error" },
17+
{ .id = 9, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.d_term" },
18+
{ .id = 10, .type = ARBITER_FACT_INT32, .range_min = -360000, .range_max = 360000, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.error" },
19+
{ .id = 11, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.error_prev" },
20+
{ .id = 12, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.i_term" },
21+
{ .id = 13, .type = ARBITER_FACT_INT32, .range_min = -1000, .range_max = 1000, .default_value = 0, .stale_after_ms = 0, .safety_relevant = true, .name = "pid.output" },
22+
{ .id = 14, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.output_raw" },
23+
{ .id = 15, .type = ARBITER_FACT_INT32, .range_min = 0, .range_max = 0, .default_value = 0, .stale_after_ms = 0, .safety_relevant = false, .name = "pid.p_term" },
24+
};
25+
26+
static const struct ARBITER_condition_def model_conditions[] = {
27+
{ .fact_id = 6, .op = ARBITER_OP_EQ, .value = 0, .group = ARBITER_COND_ANY, .group_index = 0, .next = UINT16_MAX },
28+
{ .fact_id = 5, .op = ARBITER_OP_STALE, .value = 50, .group = ARBITER_COND_ANY, .group_index = 0, .next = UINT16_MAX },
29+
{ .fact_id = 8, .op = ARBITER_OP_GT, .value = 30000, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
30+
{ .fact_id = 4, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
31+
{ .fact_id = 4, .op = ARBITER_OP_EQ, .value = 0, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
32+
{ .fact_id = 4, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
33+
{ .fact_id = 6, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
34+
{ .fact_id = 4, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
35+
{ .fact_id = 6, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
36+
{ .fact_id = 14, .op = ARBITER_OP_GT, .value = 1000, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
37+
{ .fact_id = 14, .op = ARBITER_OP_LT, .value = -1000, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
38+
{ .fact_id = 4, .op = ARBITER_OP_EQ, .value = 1, .group = ARBITER_COND_ALL, .group_index = 0, .next = UINT16_MAX },
39+
};
40+
41+
static const struct ARBITER_action_def model_actions[] = {
42+
{ .id = 0, .type = ARBITER_ACTION_CALLBACK, .target_fact_id = 0, .target_value = 0, .callback = NULL, .must_complete_within_ms = 0, .safe_state_action = false, .name = "update_actuator" },
43+
};
44+
45+
static const struct ARBITER_rule_def model_rules[] = {
46+
{ .id = 0, .rule_class = ARBITER_RULE_SAFETY_GUARD, .condition_start = 0, .condition_count = 2, .action_start = 0, .action_count = 1, .safety_goal_id = UINT16_MAX, .set_mode = 4, .safety_critical = true, .name = "01_fault.sensor", .explanation = "Sensor fault — zero output." },
47+
{ .id = 1, .rule_class = ARBITER_RULE_SAFETY_GUARD, .condition_start = 2, .condition_count = 2, .action_start = 0, .action_count = 1, .safety_goal_id = UINT16_MAX, .set_mode = 2, .safety_critical = true, .name = "02_fault.following", .explanation = "Following error > 30 deg — fault." },
48+
{ .id = 2, .rule_class = ARBITER_RULE_MODE_GUARD, .condition_start = 4, .condition_count = 1, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 1, .safety_critical = false, .name = "03_check.disabled", .explanation = NULL },
49+
{ .id = 3, .rule_class = ARBITER_RULE_INFERENCE, .condition_start = 5, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 3, .safety_critical = false, .name = "10_pid.compute", .explanation = "PID compute: error, P, I+=, D." },
50+
{ .id = 4, .rule_class = ARBITER_RULE_INFERENCE, .condition_start = 7, .condition_count = 2, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = UINT16_MAX, .safety_critical = false, .name = "20_pid.output", .explanation = NULL },
51+
{ .id = 5, .rule_class = ARBITER_RULE_MODE_GUARD, .condition_start = 9, .condition_count = 1, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 0, .safety_critical = false, .name = "30_windup.pos", .explanation = "Output saturated — integral clamped." },
52+
{ .id = 6, .rule_class = ARBITER_RULE_MODE_GUARD, .condition_start = 10, .condition_count = 1, .action_start = 0, .action_count = 0, .safety_goal_id = UINT16_MAX, .set_mode = 0, .safety_critical = false, .name = "31_windup.neg", .explanation = NULL },
53+
{ .id = 7, .rule_class = ARBITER_RULE_OBLIGATION, .condition_start = 11, .condition_count = 1, .action_start = 0, .action_count = 1, .safety_goal_id = UINT16_MAX, .set_mode = UINT16_MAX, .safety_critical = false, .name = "40_actuate", .explanation = "Write pid.output to actuator." },
54+
};
55+
56+
static const char *model_mode_names[] = {
57+
"mode.anti_windup",
58+
"mode.disabled",
59+
"mode.following_fault",
60+
"mode.running",
61+
"mode.sensor_fault",
62+
};
63+
64+
const struct ARBITER_model ARBITER_generated_model = {
65+
.name = "pid_engine",
66+
.model_hash = { 0xc2, 0x13, 0x66, 0x7b, 0xc6, 0xdd, 0xaa, 0xb4, 0xe6, 0x94, 0x58, 0x36, 0xd5, 0xcd, 0x49, 0xce, 0x6c, 0x7e, 0x48, 0xd7, 0x8d, 0x08, 0x23, 0x33, 0x4e, 0x76, 0x51, 0x89, 0xb5, 0xcc, 0x65, 0xa2 },
67+
.schema_hash = { 0x0d, 0x55, 0x33, 0x65, 0xf3, 0x4e, 0x02, 0xf3, 0xf8, 0x94, 0xe8, 0x25, 0xbb, 0x47, 0x86, 0x45, 0xfd, 0x8b, 0x78, 0xb1, 0x27, 0xf5, 0x8c, 0x42, 0xba, 0xbd, 0x80, 0x1f, 0x77, 0x57, 0x1f, 0x35 },
68+
.fact_count = 16,
69+
.rule_count = 8,
70+
.condition_count = 12,
71+
.action_count = 1,
72+
.mode_count = 5,
73+
.facts = model_facts,
74+
.rules = model_rules,
75+
.conditions = model_conditions,
76+
.actions = model_actions,
77+
.mode_names = model_mode_names,
78+
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* AUTO-GENERATED by arbiterc — do not edit */
3+
4+
#pragma once
5+
6+
#include <stdint.h>
7+
#include <stddef.h>
8+
#include <arbiter/arbiter_model.h>
9+
10+
#define ARBITER_MODEL_NAME "pid_engine"
11+
#define ARBITER_MODEL_HASH "c213667bc6ddaab4e6945836d5cd49ce6c7e48d78d0823334e765189b5cc65a2"
12+
#define ARBITER_MODEL_FACT_COUNT 16u
13+
#define ARBITER_MODEL_RULE_COUNT 8u
14+
#define ARBITER_MODEL_CONDITION_COUNT 12u
15+
#define ARBITER_MODEL_ACTION_COUNT 1u
16+
#define ARBITER_MODEL_MAX_FACTS 16u
17+
#define ARBITER_MODEL_MAX_RULES 8u
18+
#define ARBITER_MODEL_MAX_CONDITIONS 12u
19+
#define ARBITER_MODEL_MAX_ACTIONS 1u
20+
#define ARBITER_MODEL_WCET_OP_COUNT 20u
21+
#define ARBITER_MODEL_TRACE_CAPACITY 8u
22+
23+
extern const struct ARBITER_model ARBITER_generated_model;
24+
25+
#define ARBITER_FACT_GAIN_KD 0u
26+
#define ARBITER_FACT_GAIN_KI 1u
27+
#define ARBITER_FACT_GAIN_KP 2u
28+
#define ARBITER_FACT_IN_DT_MS 3u
29+
#define ARBITER_FACT_IN_ENABLE 4u
30+
#define ARBITER_FACT_IN_PROCESS_VALUE 5u
31+
#define ARBITER_FACT_IN_SENSOR_VALID 6u
32+
#define ARBITER_FACT_IN_SETPOINT 7u
33+
#define ARBITER_FACT_PID_ABS_ERROR 8u
34+
#define ARBITER_FACT_PID_D_TERM 9u
35+
#define ARBITER_FACT_PID_ERROR 10u
36+
#define ARBITER_FACT_PID_ERROR_PREV 11u
37+
#define ARBITER_FACT_PID_I_TERM 12u
38+
#define ARBITER_FACT_PID_OUTPUT 13u
39+
#define ARBITER_FACT_PID_OUTPUT_RAW 14u
40+
#define ARBITER_FACT_PID_P_TERM 15u
41+
42+
#define ARBITER_MODE_MODE_ANTI_WINDUP 0u
43+
#define ARBITER_MODE_MODE_DISABLED 1u
44+
#define ARBITER_MODE_MODE_FOLLOWING_FAULT 2u
45+
#define ARBITER_MODE_MODE_RUNNING 3u
46+
#define ARBITER_MODE_MODE_SENSOR_FAULT 4u

0 commit comments

Comments
 (0)