o1553_codec: Verification Report¶
1. Test results¶
Run with GHDL 6.0.0 (mcode), VUnit 5.0.0.dev7 and UVVM 2026.03.20 on commit 0380f24, whose sources and
testbenches are those of release 0.1.0 (0358bc8): python run.py -p 2 --xunit-xml results.xml, 201 tests of the
repository, 201 passed, 0 skipped. The event of line activity without a word (CD-DE-14) and TC-CD-21 ran on
418d8eb: python run.py -p 1 --xunit-xml results.xml "*o1553_codec_tb*", the 65 tests of o1553_codec_tb
below, 65 passed, 0 skipped; the test cases of before are unchanged. The faults N1 to N5 of section 7 ran on the
same commit.
The regression of release 0.3.0 (a2724fb) passes in GHDL, 424 of 424 tests, 0 skipped, and in QuestaSim with code
coverage and in the optimised run without it, 424 of 424 tests each, 0 skipped. The run with code coverage took
o1553_bm_tb and o1553_core_tb on a2724fb and the other testbenches on 42a9d29, which differs from a2724fb only in
hdl/o1553_bm (coverage, section 2); section 6 gives the code coverage.
| Testbench | Tests | Passed |
|---|---|---|
o1553_codec_tb |
65 (21 test cases: 11 in all five configurations c100, c16, c400, c100_s3 and c100_s4, 10 in c100) |
65 |
2. Summary¶
All test cases pass; every one of the 41 requirements of the specification is covered by a test case
(compliance matrix). VSG reports no errors and no warnings. The codec synthesises with
ghdl --synth without latches in the configurations of section 5.
Findings of the verification and their resolution:
| Finding | Resolution |
|---|---|
At 16 MHz a level of exactly F samples (155 ns between two zero windows of 200 ns) was never recorded as the last sample of its polarity; the next crossing took its midpoint from a sample before the previous crossing, and the word failed with a Manchester error (TC-CD-08) |
The accepting sample of a polarity is recorded as its last sample (architecture section 7.3) |
The word event came between 1.5 cycles before and 0 cycles after SyncStages_g + F + 3H + 2, outside +/- 1 cycle at 16 MHz (TC-CD-07) |
rxLatency = SyncStages_g + F + 3H + 1; the event lies 0.5 cycle before to one cycle after it (section 3) |
| A transmission with idle outputs (shutdown, fail-safe state, bus disabled) opened the own-transmission window, so a valid command of another terminal on that bus was reported as an own word | The window opens only while the bus is driven (CD-DE-10, architecture section 5); TC-CD-15 |
| The fail-safe timer restarted at every inhibit cycle, and the encoder is idle for one cycle between two transmissions: transmissions back to back never reached the limit | The timer restarts only after an inhibit of 2 us (CD-FS-01); TC-CD-16 with pauses of one cycle, 1.5 us and 4.0 us |
| A transmitter enabled again during a transmission whose outputs went idle resumed in the middle of a word | The outputs stay idle until the transmission ends (CD-BS-02, Cut in the bus selector); TC-CD-14, TC-CD-15 and TC-CD-16 |
| The first half of a sync after an idle line has no crossing before it, and the receiver threshold delays its start: with the start delay modelled (half the zero window) and sync halves shortened by 150 ns, the first word of a pair failed with a sync error in every configuration (TC-CD-08) | The first half of a sync after an idle line is recognised from 0.75 us; the second half and every later interval keep their classes (specification section 6, architecture section 7.4); TC-CD-19 |
| The recovery of an illegal state of the decoder was evaluated only at a crossing | The recovery is evaluated in every cycle |
The bus model sampled Bus_TxInh only in the middle of each half bit and missed an inhibit of one cycle between two transmissions (TC-CD-04) |
The model ends a transmission at the rising edge of Bus_TxInh |
| Four faults of the RTL passed every test (section 7): the data and the sync type compare of the transmission monitor (every echo fault also made the word invalid), the end of the own-transmission window, and the idle threshold | Echo faults that give a valid word with other data or the other sync type (TC-CD-18), words 0.6 us and 1.4 us after the end of a transmission (TC-CD-17), a word after a zero gap of 0.5 us (TC-CD-12) |
| The compliance matrix showed clauses as verified whose owner block, or a block also involved, has no testbench yet | Such clauses are partly verified (tools/compliance.py) |
Tx_Suppressed was valid only with Tx_Done: a user that ends a transmission before its end could not know whether its outputs were idle, and the RT recorded a status word as sent when a command on the other bus superseded its response on a shut-down bus |
Tx_Suppressed is a level (CD-IF-03); TC-CD-15 checks it at every clock edge, TC-RT-11 the record of the RT |
| The code coverage of a QuestaSim run showed five reachable cases that no test exercised: both receiver outputs at '1', a sync followed by an idle line, a crossing of class Q2 after the boundary crossing behind the parity bit, a parity error ended by the next sync before the check time, and a word of another source while the monitor waits for the own word | TC-CD-10, TC-CD-18 and TC-CD-20 extended; the design was correct in all five |
3. Measured timing¶
| Quantity | Requirement | Measured |
|---|---|---|
| Presentation of the first word to the start of its sync at the ports | txLatency = 2 cycles (CD-EN-06) |
2 cycles in every transmission of TC-CD-02 and TC-CD-03, all configurations of TC-CD-02 |
| Acceptance of a further word | first cycle of the parity bit (CD-EN-06) | in that cycle for every further word of TC-CD-03 |
| Word time | 20 us, no gap between contiguous words (CD-EN-02, CD-EN-05) | Bus_TxInh low for exactly 20 us per word |
| Fail-safe cut | 700 us of transmission (CD-FS-01) | 700 us to 700 us + 2 cycles (TC-CD-16) |
Word event after the reference crossing at the ports (TC-CD-07, 50 words with deviations within +/- 150 ns and zero
windows of 100 ns), relative to rxLatency = SyncStages_g + F + 3H + 1:
| Configuration | rxLatency |
Measured, relative to rxLatency |
|---|---|---|
c16 |
29 cycles | -0.14 to +0.73 cycles |
c100 |
159 cycles | +0.01 to +0.97 cycles |
c100_s3 |
160 cycles | +0.01 to +0.93 cycles |
c100_s4 |
161 cycles | +0.00 to +1.00 cycles |
c400 |
624 cycles | +0.05 to +0.96 cycles |
Line activity (TC-CD-20): Rx_Active after the start and after the end of the activity at the ports, against
SyncStages_g + F + 1 and SyncStages_g + ceil(0.8H) + 2 cycles:
| Configuration | Rise, expected | Rise, measured | Fall, expected | Fall, measured |
|---|---|---|---|---|
c16 |
5 cycles | 4.40 to 5.00 cycles | 11 cycles | 10.20 to 11.00 cycles |
c100 |
9 cycles | 9.00 cycles | 44 cycles | 44.00 cycles |
c100_s3 |
10 cycles | 10.00 cycles | 45 cycles | 45.00 cycles |
c100_s4 |
11 cycles | 11.00 cycles | 46 cycles | 46.00 cycles |
c400 |
24 cycles | 24.00 cycles | 164 cycles | 164.00 cycles |
At 100 MHz and 400 MHz the stimulus lies on the clock grid; at 16 MHz the sampling phase makes the indication up to one cycle earlier.
Line activity without a word (TC-CD-21): for bits without a sync and for pulses of 0.5, 3 and 30 us and of
2^16 + 1000 cycles on each bus, in all configurations, the event comes in the clock cycle in which Rx_Active
falls, and its count equals the cycles of Rx_Active = '1' (all ones for the longest pulse) (CD-DE-14).
4. Functional coverage¶
Every bin of the coverpoints of the verification plan (section 5) is reached, and each bin is checked on its own:
| Coverpoint | Reached by |
|---|---|
BIT_RATE, CROSSING_DEVIATION, ZERO_WINDOW |
TC-CD-08: 5 bit rates x 4 deviations x 4 zero windows, and 300 ns without deviation, in all configurations |
SYNC_MERGE |
TC-CD-06: 2 sync types x 2 x 2 merges, in all configurations |
FIRST_SYNC_HALF |
TC-CD-19: 0.65, 0.85, 1.0 and 1.2 us; every other test: 1.5 us |
DATA_BITS |
TC-CD-02 (encoded) and TC-CD-06 (decoded): every bit position at '0' and at '1' |
ERROR_KIND |
TC-CD-10 and TC-CD-19 |
TRANSMISSION_LENGTH |
TC-CD-03: 1, 2, 3, 32 and 33 words |
ECHO_FAULT |
TC-CD-18: one data bit, two data bits, parity bit, sync, missing word |
5. Generic ranges¶
| Generic | Declared range | Simulated | Synthesised |
|---|---|---|---|
ClkFreq_g |
16 MHz to 400 MHz, integer multiples of 2 MHz | 16, 100, 400 MHz | 16, 100, 400 MHz; 15, 125, 156.25 and 402 MHz stop with the message of CD-CF-01 |
SyncStages_g |
2 to 4 | 2, 3, 4 | 2, 3, 4 |
6. Code coverage¶
Statement, branch and state machine coverage of release 0.3.0 is collected with QuestaSim and reported in
docs/coverage.md, with a justification for every remaining miss. The recovery branches
of the state machines are marked as excluded (coverage off), since they cannot be reached through the ports.
7. Checks of the testbench¶
Each of the following faults, inserted one at a time into the RTL of the codec (the file restored after the run), fails the test cases listed; the RTL of the repository passes all of them. The table lists the failing test cases among those run for the fault.
| Block | Fault | Failing test case |
|---|---|---|
| Encoder | First sync half with the polarity of the second | TC-CD-02 |
| Encoder | Data and parity bits inverted | TC-CD-02 |
| Encoder | Further word accepted one cycle after the first cycle of the parity bit | TC-CD-03 |
| Encoder | Underrun reported as complete | TC-CD-04 |
| Encoder | Abort ignored | TC-CD-05 |
| Encoder | Transmission with idle outputs not reported as suppressed | TC-CD-15 |
| Encoder | Contiguous next word starts at half bit 1 | TC-CD-03 |
| Encoder | Tx_Suppressed '0' outside a transmission |
TC-CD-15 |
| Encoder | Tx_Suppressed without the cycle in progress (the register only) |
TC-CD-15 |
| Bus selector | Shutdown does not disable the transmitter | TC-CD-15 |
| Bus selector | Override of the shutdown ignored | TC-CD-15 |
| Bus selector | Fail-safe state not in the transmitter enable (outputs still forced idle) | TC-CD-16 |
| Bus selector | Bus selection inverted | TC-CD-02 |
| Bus selector | TxN equal to TxP |
TC-CD-02 |
| Bus selector | Cut transmission not latched (outputs resume when the transmitter is enabled again) | TC-CD-14, TC-CD-15, TC-CD-16 |
| Bus selector | Own-transmission window open during a transmission with idle outputs | TC-CD-15 |
| Fail-safe timer | Limit of 800 us | TC-CD-16 |
| Fail-safe timer | Counter not restarted between transmissions | TC-CD-03 |
| Fail-safe timer | Release ignored | TC-CD-16 |
| Fail-safe timer | Fail-safe state leaves Bus_TxInh to the encoder |
TC-CD-16 |
| Fail-safe timer | Timer restarted by every inhibit cycle | TC-CD-16 |
| Fail-safe timer | Timer restarted by an inhibit of two cycles | TC-CD-16 |
| Fail-safe timer | Timer restarted only by an inhibit of 10 us | TC-CD-16 |
| Transmission monitor | Deadline of the own word 8 us | TC-CD-18 |
| Transmission monitor | Data of the own word not compared | TC-CD-18 |
| Transmission monitor | Sync type of the own word not compared | TC-CD-18 |
| Transmission monitor | Monitor enable ignored | TC-CD-18 |
| Transmission monitor | Words with idle outputs expected | TC-CD-18 |
| Transmission monitor | A word that is not own taken as the own word | TC-CD-18 |
| Decoder | Glitch filter one sample shorter | TC-CD-09 (all configurations) |
| Decoder | Parity not checked | TC-CD-10 |
| Decoder | Sync type inverted | TC-CD-06 |
| Decoder | Error lock never set | TC-CD-10 |
| Decoder | Contiguous up to 2.6 us | TC-CD-12 |
| Decoder | Contiguous from 1.2 us | TC-CD-12 |
| Decoder | Gap counter wraps instead of saturating | TC-CD-12 |
| Decoder | An invalid word restarts the gap | TC-CD-12 |
| Decoder | Own-transmission window without the loop delay | TC-CD-17 (all configurations) |
| Decoder | Last sync half merged with bit 0 rejected | TC-CD-06 |
| Decoder | First sync half merged with the bit before rejected | TC-CD-06 |
| Decoder | First sync half after an idle line not widened | TC-CD-08, TC-CD-19 (all configurations) |
| Decoder | Every sync half recognised from 0.75 us | TC-CD-11 |
| Decoder | Second crossing after the parity bit accepted | TC-CD-10 |
| Decoder | Full-bit interval after the parity bit accepted | TC-CD-10 |
| Decoder | Full-bit interval accepted after a boundary crossing | TC-CD-10 |
| Decoder | Check timer one half bit shorter | TC-CD-07 |
| Decoder | Crossing time at the first sample of the new polarity | TC-CD-07 |
| Decoder | Accepting sample not recorded as the last sample of its polarity | TC-CD-08 (c16) |
| Decoder | Idle threshold 0.6 us | TC-CD-12 |
| Decoder | Early end of a word not reported | TC-CD-10 |
| Decoder | Wrong second sync half reported as a Manchester error | TC-CD-10 |
| Decoder | Falling mid-bit crossing decoded as zero | TC-CD-06 |
| Decoder | Line activity only while a word is decoded | TC-CD-20 (all configurations) |
| Decoder | Line activity ends at the first zero sample | TC-CD-20 |
| Decoder | Idle line after a sync not reported | TC-CD-10 |
| Decoder | Event of activity without a word also after a recognised sync half (N1) | TC-CD-21 |
| Decoder | Count of the activity one cycle short (N2) | TC-CD-21 |
| Decoder | Count of the activity wraps instead of saturating (N3) | TC-CD-21 |
| Decoder | Sync flag not cleared at the start of an activity (N4) | TC-CD-21 |
| Decoder | Count not cleared at the start of an activity (N5) | TC-CD-21 |
| Decoder | Parity error ended by an early sync reported valid | TC-CD-10 |
| Decoder | Every crossing after the boundary crossing behind the parity bit except a sync half a bit count error | TC-CD-10 |
| Top level | RxP and RxN of bus B swapped |
TC-CD-13 |
| Top level | Bus_RxEn always '1' |
TC-CD-14 |
| Top level | Both receiver outputs at '1' passed to the decoder as a line state | TC-CD-20 |
| Top level | Decoder enabled while its bus is disabled | TC-CD-14 |
| Package | Even parity | TC-CD-02 |
The recovery branches of the state machines (when others) cannot be reached through the ports and are not in the
table. The transmission monitor had a loopback error for a new expected word while one was still expected; it could
not be reached (the deadline of 4 us always ends before the next word of 20 us is complete, also after an upset of
the timer register) and was removed.