Open1553 Conventions¶
Open1553 follows the coding conventions of Open Logic and the module development process of the architecture document. This page lists the rules and the few Open1553-specific additions.
VHDL coding¶
- The Open Logic coding conventions apply in full: port names
<Interface>_<Signal>, generics_g, constants_c, variables_v, types_t, FSM types<Name>Fsm_twith states_s, functions inlowerCamelCase, four spaces of indentation, no tabs, no trailing whitespace. - Entities are named
o1553_<function>in full words (for exampleo1553_codec,o1553_codec_decoder). All Open1553 sources are compiled into the VHDL libraryopen1553; Open Logic is compiled into the libraryolo. - Language: VHDL-2008.
- Entities with non-trivial state use the two-process pattern of Open Logic: all registers in one
TwoProcess_rrecord, signalsrandr_next, a combinational process starting withv := r;and ending withr_next <= v;, a sequential process withr <= r_next;and the reset override at its end. - Resets are synchronous and high-active. Only state registers are reset.
- The actual of a port is a name (signal, constant, index or slice of one), never an expression such as
to_integer(...)or a concatenation: declare a signal or constant of the port's subtype and associate it. QuestaSim with full optimisation can give the implicit signal of an expression actual a range that matches neither the port nor the expression and stop the simulation. - A record field that is an array of arrays uses a fully constrained array type (
type T is array (0 to N - 1) of E), not an index constraint on an unconstrained array type (U : T(0 to N - 1)): through an alias of an element of an array of records, xsim 2025.2 can give such a field the element constraint of another field. Vectors of scalars (std_logic_vector,unsigned,signed) have no element constraint and are not affected. - Every data path between blocks is a valid / ready stream (AXI4-Stream handshake semantics) or a valid-only stream of one-cycle events where the receiver is never slower than the source.
- A MIL-STD-1553B word is a 16-bit
std_logic_vectorwhose bit 15 is the most significant bit, the first bit on the bus. Fields of ECSS-E-ST-50-13C, which numbers the most significant bit as bit 0, are mapped explicitly in the module specifications. - Standard functions (RAMs, scrubbers, crossings, synchronisers, arbiters, pipeline stages, AXI4-Lite slave) are
instantiated from Open Logic, never rewritten. RAMs and FIFOs use the fault-tolerant
olo_ft_*entities; every Open Logic reset generator and input synchroniser is instantiated withSyncTmr_g => true. - State machines have a
when othersbranch that returns to a defined recovery state; the reset leads to that state from any state. - Every line that implements a requirement is traceable through the module specification. Comments name the clause
where it helps the reader (for example
-- MIL 4.3.3.8or-- ECSS 8.7.4b). - File header: copyright line and authors, then a 1 to 2 sentence description that links to the module documentation. Never write "all rights reserved".
- Never use em-dashes in code, comments or documentation. Use UTF-8 only.
- VSG 3.27 with the Open Logic configuration in
lint/configmust report no errors and no warnings:python lint/lint.py. Safe automatic fixes:python lint/lint.py --fix. - The design must be synthesizable in a technology-independent way:
python lint/synth_check.pyelaborates the core top level with the synthesis of GHDL (afterpython run.py --compile) at the generic values of the verification report of the core and fails on errors and inferred latches; inconsistent configurations must stop with the message of the core. It runs in CI after the regression once the core top level exists. - Generic ranges are verified: every value of a generic that changes the structure is simulated, the ends of every
numeric range are at least synthesised, other values are excluded by an assertion or listed as unverified; the
verification report of the core has the table.
to_01and other simulation-only functions are not used in RTL. - The synthesis sources analyse with
ghdl -a --std=08without-frelaxedand without warnings. Attribute specifications use literals, because the expression of an attribute specification must be locally static. Only Open Logic and UVVM need-frelaxed. - The register map has one description,
hdl/o1553_host/regs/o1553_regs.yml.python tools/regmap.pygenerates the VHDL packageo1553_regs_pkg, the register map page and the C headersw/o1553_regs.hfrom it;python tools/regmap.py --checkfails in CI when a generated file is out of date. The C header prefixes the register names withO1553_. compile_order.txtlists the synthesis sources of the libraryopen1553in compile order. After adding, removing or renaming a source file, regenerate it withpython run.py --compile-order; the CI fails when it is out of date.- Traceability: every requirement of a specification is verified by at least one test case of the verification plan,
every clause of the traceability matrix (architecture section 10) by the test cases of its requirements, and every
test case of a plan is run by a testbench.
python tools/compliance.pywrites the compliance matrix;python tools/compliance.py --checkfails on a gap. A module without a testbench is in specification: its requirements and the clauses it owns are listed as planned until its testbench exists. A core is admitted only when every module of the released phases has its testbench.
The standards¶
- Open1553 implements MIL-STD-1553B (Notice 2) as used on spacecraft by ECSS-E-ST-50-13C. The documentation cites
both standards by clause number (
MIL 4.3.3.8,ECSS 8.2.1.2a), table and figure number. It never copies their text, tables or figures. - MIL-STD-1553C keeps the clause numbers of section 4 of MIL-STD-1553B; the appendix sections 10 and 30 of MIL-STD-1553B are the sections A.1 and A.2 of MIL-STD-1553C. The documentation uses the MIL-STD-1553B numbers, as ECSS-E-ST-50-13C does.
- Where a standard leaves a behaviour open, offers an option or the two standards differ, the architecture states the behaviour of Open1553 in its section "Interpretations of the standards", and the module specification repeats the interpretations that concern it.
Module development process¶
Every module goes through the seven phases of the architecture document (section 9):
| Phase | Output |
|---|---|
| A Requirements | hdl/<module>/docs/specification.md: requirements with IDs, each tracing to clauses of the standards |
| B Architecture | hdl/<module>/docs/architecture.md: blocks, ports, state machines, data formats |
| C Verification plan | hdl/<module>/docs/verification_plan.md: test cases with IDs, requirement coverage |
| D RTL | hdl/<module>/src/*.vhd |
| E Testbenches | hdl/<module>/tb/<entity>_th.vhd (harness) and <entity>_tb.vhd (VUnit runner) |
| F Verification | Regression green, hdl/<module>/docs/verification_report.md |
| G Integration | Tests at the next level that cross every seam the module touches |
A module is one group of blocks of the architecture (section 7). hdl/<module>/README.md links the four documents
and explains how to run the tests.
Diagrams¶
- Every architecture document has a block diagram; state machines and data formats have one where text alone is hard to follow.
- Diagrams are draw.io drawings stored as editable SVG with the drawing embedded (
<name>.drawio.svg) in theimg/folder next to the document. The SVG is the source: open it in draw.io to change it. It is exported with the light theme on an opaque white background, so that it reads in both colour schemes of the documentation site. - Blocks: light blue for Open1553 logic, white with a blue outline for an Open1553 entity instantiated as a whole,
light grey for an Open Logic entity, drawn inside the block that instantiates it. A dashed outline groups the
blocks of one entity instance; a dashed block belongs to a later phase or to a generic value. The title carries
the building block ID of the architecture (
CD-2 Encoder). - Connections: thick lines for streams and buses, thin lines for single signals. Every line is horizontal or vertical; a dot marks a branch or the junction of lines that share a segment. Ports cross the frame of the entity, inputs on the left, outputs on the right where the layout allows.
- State machines: states as rounded boxes, the reset entry as a filled dot, every transition labelled with its condition. State diagrams of the standards are not redrawn; the documents cite them by figure number.
- A diagram is at most about 1050 px wide, so that its text stays readable in the content column, and its alt text names the blocks it shows.
Verification¶
- VUnit runs every test (
run.py); UVVM supplies VVCs, BFMs, checks, randomisation and functional coverage. - The harness (
_th) contains clocks, reset, the DUT and the VVCs, the testbench (_tb) contains oneif run("<test id>") thenblock per test case of the verification plan. The test IDs of the plan and the names inrun(...)are identical. - A test passes only when UVVM reports no unexpected alerts and every expected alert occurred (the test end
procedure of
o1553_tb_pkg). - A timed wait (
wait until <condition> for <timeout>) ends with a check of its condition, so that a missing event fails the test instead of timing out silently. A condition that may hold already is tested before the wait, as the wait itself waits for an event. A bounded delay after which either outcome is fine says so in a comment. - Tests observe ports, registers and the buffer memory only, never internal signals.
- GHDL is the default simulator; QuestaSim (
python run.py --questa) runs at the time resolution of GHDL (1 fs) and collects the code coverage. Every test passes in both simulators. run.pygives every GHDL simulation its own copy of the optionghdl.sim_flagsand stops when a simulation command does not carry exactly the generics of its configuration (VUnit 5.0.0.dev7 shares that list between configurations).- A side effect is never obtained by calling an impure function and discarding its result: QuestaSim may remove such a call. Protected types offer a procedure for it.
- The far end of the bus is the bus model of
tb/: behavioural VHDL written independently of the RTL, in continuous time. It acts as bus controller, as a second remote terminal and as a monitor, and it checks timing at the ports of the core. - Negative tests inject the fault from the bench (word validation errors, gaps, late data words, illegal commands,
double errors through the
ErrInjports, ...) and expect the status word, the event record, the registers or the absence of a response. - Code coverage review: every miss of the QuestaSim coverage run is checked against its expression or condition row in the RTL before a test is written for it: which row a test has to reach, under which non-masking condition, and whether the row can be reached at all. A test written for a miss is proven by the next coverage run and by a mutation of the code behind the row. The misses that stay are justified in coverage, as unreachable or without an observable effect.
Git¶
developholds the integrated state andmainthe released state. Every module or change is developed on a branchfeature/<module>orbugfix/<topic>fromdevelopand merged intodevelopthrough a pull request once its regression is green.mainreceives only release branchesrelease/x.y.zcut fromdevelopand hotfix brancheshotfix/x.y.z. The full regression in QuestaSim, with and without code coverage, runs on the head of the release branch. Releases are taggedvX.Y.Zwith semantic versioning, below 1.0.0 until the hardware test.- Commit messages: imperative subject line, body explains what and why.