Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .fusa-reqs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3351,6 +3351,78 @@
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-001",
"title": "message_timestamp-repurposing request_type decode/encode (mtv=0)",
"text": "rcp::sequencer::decode_request_type shall return SequencerErrc::timestamp_not_repurposed when mtv is true, shall return SequencerErrc::unknown_request_type when the top byte of message_timestamp is not one of the 8 defined opcodes, and shall otherwise recover the opcode and the remaining 7 parameter bytes exactly as produced by encode_request_type for the same inputs; rcp::sequencer::make_conditional_request shall always build an ACF_GBB AcfMessageInfo with mtv clear.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-002",
"title": "Request categories and execution-priority ordering",
"text": "rcp::sequencer::category_of shall map the 3 cancellation opcodes to RequestCategory::Cancellation, each of the 5 conditional opcodes to its own category, and std::nullopt to RequestCategory::Standard; rcp::sequencer::select_next_due shall pick the candidate with the lowest priority_rank among due candidates and shall break ties within a category by lowest arrival_seq (FIFO), returning std::nullopt for an empty input.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-003",
"title": "Compound/compound-wait optional-feature bundling",
"text": "rcp::sequencer::validate_feature_bundles shall return SequencerErrc::compound_bundle_incomplete whenever FeatureSet::compound or FeatureSet::compound_wait is set unless compound, compound_wait, clear_non_safestate, and sequencer_count >= kMinCompoundSequencers (4) are all simultaneously true, and shall accept every other combination of triggered/chained/timed/clear_single independently of compound support.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-004",
"title": "Sequencer-state default value and finalization advance rule",
"text": "rcp::sequencer::SequencerTable::ensure_size shall fill newly added slots with kDefaultState (1), never the storage's own zero-initialization default, shall never shrink existing storage, and try_advance shall increment a sequencer only when its current value equals the supplied expected_start, leaving it unchanged (and reporting out_advanced=false, not an error) otherwise; both accessors shall return SequencerErrc::index_out_of_range for an out-of-bounds index.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-005",
"title": "Cancellation kinds and shared cancellation semantics",
"text": "rcp::sequencer::RequestLedger::cancel_single shall cancel a Pending/Started request and cascade cancellation to every transitive chained successor, and shall return SequencerErrc::request_not_found for an unknown transaction or one that is UnderExecution/Finalized/already Canceled; cancel_all shall cancel every Pending/Started record (optionally skipping is_safety records when non_safestate_only is set) without disturbing any UnderExecution or Finalized record; a canceled request's outcome_of shall report SequencerErrc::request_canceled.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-006",
"title": "Request lifecycle state machine: pending -> started -> under_execution -> finalized",
"text": "rcp::sequencer::RequestLedger shall only permit the single-step forward sequence Pending->Started->UnderExecution->Finalized, returning SequencerErrc::invalid_lifecycle_transition for any other requested transition and SequencerErrc::unknown_transaction for an untracked id; submit shall return SequencerErrc::transaction_num_collision for a transaction_num already tracked; finalize shall drive SequencerTable::try_advance for a Compound/CompoundWait record's sequencer_index/expected_start_state as its side effect.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-007",
"title": "Chained-successor propagation on predecessor finalization",
"text": "rcp::sequencer::RequestLedger::finalize shall, for every record whose chained_predecessor equals the finalized transaction_num, cascade-cancel that successor iff rcp::sequencer::should_execute_chained(successor.cs, errored) is false, and shall leave every such successor untouched when the predecessor finalized with errored=false.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-008",
"title": "The cs field's dual meaning (compound-wait vs. chained)",
"text": "rcp::sequencer::compound_wait_check_of shall map cs=true to CompoundWaitCheck::Immediate and cs=false to CompoundWaitCheck::AfterChangeOnly; rcp::sequencer::should_execute_chained shall return true whenever cs is true regardless of predecessor_errored, and shall return true iff predecessor_errored is false when cs is false.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
},
{
"id": "REQ-SEQ-009",
"title": "SequencerErrc is a distinct error category with non-empty, distinct messages",
"text": "Every rcp::sequencer::SequencerErrc value shall report rcp::sequencer::sequencer_category() as its category and shall have a non-empty diagnostic message distinct from every other SequencerErrc value's message.",
"standard": "iso26262",
"level": "ASIL-B",
"asil": "ASIL-B"
}
]
}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.21)

project(cpp-rcp
VERSION 2.4.0
VERSION 2.5.0
DESCRIPTION "Remote Control Protocol for automotive zonal architecture (C++)"
HOMEPAGE_URL "https://github.com/SoundMatt/cpp-RCP"
LANGUAGES CXX
Expand Down
42 changes: 42 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,48 @@ key off of. New coverage lives in `tests/test_i2c.cpp` (REQ-I2C-001..005),

### 49. Conditional-Request Taxonomy & Sequencers (v2.5.0)

**Done (v2.5.0):** `rcp/sequencer.hpp` implements the taxonomy and state
machine below entirely as a new decode/behavior layer over already-existing
substrate — no change to `rcp/wire.hpp`'s ACF_GBB codec or
`rcp/regmap.hpp`'s `sequencer_states` storage was needed. `decode_request_type`
/`encode_request_type` implement the `mtv=0` message_timestamp-repurposing
trick (`RequestTypeOpcode`'s 8 values: the 5 conditional kinds plus the 3
cancellation kinds), gated so a genuinely timestamped ACF_GBB message
(`mtv=1`) is rejected rather than misread; `make_conditional_request` builds
the matching `AcfMessageInfo` for `rcp::wire::encode_acf_gbb` to carry
unchanged. `RequestCategory`/`category_of`/`priority_rank`/`select_next_due`
implement the seven-way execution-priority ordering (cancellation →
triggered → timed → compound → compound-wait → chained → standard) with FIFO
tie-break. `FeatureSet`/`validate_feature_bundles` enforce the compound
bundle rule exactly as the roadmap states it: compound and compound-wait can
only be claimed together, alongside clear-non-safestate cancellation and
`sequencer_count >= kMinCompoundSequencers` (4) — triggered, chained, and
timed remain independently flaggable. `SequencerTable` is the behavior layer
over `regmap::RegisterMap::sequencer_states`: `kDefaultState` (1) fills newly
grown slots (not the vector's own zero default), and `try_advance` advances a
sequencer only while it still holds its expected start value, otherwise
leaving it untouched without erroring. `RequestState`/`RequestRecord`/
`RequestLedger` implement the forward-only pending → started →
under_execution → finalized lifecycle (mirroring `rcp/lifecycle.hpp`'s own
forward-only style), the three cancellation kinds' shared semantics
(`cancel_single`/`cancel_all`, `REQUEST_CANCELED`/`REQUEST_NOT_FOUND` via
`SequencerErrc`, already-executing requests left to finish, cascade-cancel
into chained successors), and `finalize`'s two integration points: driving
`SequencerTable::try_advance` for a Compound/CompoundWait record, and
`propagate_chain_completion` evaluating each chained successor's `cs`-gated
abort-on-predecessor-error rule via `should_execute_chained`.
`compound_wait_check_of` and `should_execute_chained` implement the `cs`
field's two independent meanings (compound-wait's immediate-vs-after-change
check; chained's execute-regardless-vs-abort-on-error). This header
deliberately does not run a scheduler thread — `select_next_due`'s output and
`RequestLedger`'s transition methods are primitives for the embedding
application to drive, same as every other endpoint header in this codebase.
New coverage lives in `tests/test_sequencer.cpp` (REQ-SEQ-001..009), traced
in `.fusa-reqs.json`. Full wire-level conformance (the safety-tagged `0x8x`
variants and E2E CRC safe points this milestone's cancellation model already
carries an `is_safety` field in anticipation of) remains a v2.6.0 concern per
the Phase 13 introduction above.

- Implement the `message_timestamp`-field-repurposing trick: when
`mtv=0` on an ACF_GBB message, the first byte of the otherwise-unused
64-bit timestamp slot becomes a `request_type` opcode, with the
Expand Down
Loading
Loading