Skip to content

o1553_bm: Verification Plan

1. Overview

The BM is verified through its ports and through the bus. The harness connects o1553_bm to the verified o1553_codec, so that every word reaches the BM as line states on the bus and every time is measured at the codec ports. The far ends are models written from the standards and the specifications, independently of the RTL:

  • The bus model of tb/ sends words on either bus with any timing and every fault of o1553_codec TC-CD-10, and line activity without a sync (pulse trains of chosen widths and lengths, new for this module). It logs every word and activity with its mid-sync and reference crossings, so that the bench knows the gap, the contiguity and the time of each word.
  • Message sequences are built in the bench from the formats of MIL 4.3.3.6: command words, data words of the BC, status words and data words of the RT with chosen response times, and every deviation of section 3. The expected record of each message, word and activity is computed from the sequence and the record formats of the architecture (section 4), not from the RTL.
  • To produce own words, the harness drives the encoder of the codec as the RT would (the bench presents the words), so that the decoders report them with the own-transmission flag.
  • A memory model on the memory port answers reads after MemLatency_g cycles, holds requests back for 0 or 1 cycles at random (host and RT accesses), holds every request for a chosen number of cycles in the throughput test, serves no request at all for longer than a word time (a partner that holds the port, BM-RG-05), injects single and double errors at chosen addresses, and checks every write of the BM against BM-RG-04 (ring words only) and every read (filter table only): a forbidden access is an error in every test. The test sequence writes the filter table and reads the records through the model (the host role).
  • The configuration inputs are driven by the test sequence; the state outputs and the events are logged with their clock cycle. A time base in the harness drives Time_Tag.

rxLatency, H and the bounds of section 3 of the specification are computed in the bench from the generics with the formulas of the architecture.

2. Test configuration

Testbench Harness DUT and environment
o1553_bm_tb o1553_bm_th o1553_bm with o1553_codec; the bus model on both buses; the memory model; the time base; drivers of the configuration inputs and of the encoder of the codec; logs of the state outputs and events
VUnit configuration ClkFreq_g (ClkFreqHz_g of the bench), SyncStages_g, MemLatency_g Purpose
c100 100 MHz, 2, 3 Nominal; all tests
c16 16 MHz, 2, 3 Lowest clock: throughput, response window in cycles
c16_s4 16 MHz, 4, 3 Largest rxLatency against the windows
c400 400 MHz, 2, 3 Highest clock: largest timers, saturation of durations
c100_l1, c100_l8 100 MHz, 2, 1 and 8 Range of MemLatency_g
c16_l8 16 MHz, 2, 8 Throughput at the lowest clock and the largest latency

The tests marked "all" run in every configuration, those marked "latency" in c100, c100_l1, c100_l8 and c16_l8, the others in c100. Every test runs under a VUnit watchdog, and every wait has a time-out.

3. Test cases

Test ID Description Requirements
test_reset_state (TC-BM-01) After the reset: inactive, no memory request, no record, no event, state outputs at their reset values; Cfg_BmEn with the BC active and before Mem_InitDone: inactive until both allow it; the configuration marked "activation" changed while active has no effect until the next activation, Cfg_BmRdIdx and Cfg_BmIrqLevel act at once; Cfg_BmTimeout below 28H and ring sizes below 64 and above 8192 bounded; the codec transmits nothing in any test unless the harness drives its encoder (all) BM-EN-01, BM-EN-02, BM-IF-02, BM-IF-03, BM-IF-04, BM-IF-06, BM-CF-03, BM-FT-01
test_formats (TC-BM-02) Every format on bus A and on bus B: BC to RT and RT to BC with 1, 2, 31 and 32 data words, RT to RT, mode commands without data word, with a received and with a transmitted data word, and the broadcast forms of BC to RT, RT to RT and the mode commands; each record checked word by word: type, bus, data count, flags, command and status words, response times, time tag, data words in bus order (all) BM-MR-01, BM-MR-02, BM-MR-03, BM-MR-06, BM-RC-01, BM-RC-05, BM-IF-01, BM-IF-05
test_response_window (TC-BM-03) Status word 1 and status word 2 with their mid-sync crossing from 2 cycles before to 2 cycles after Cfg_BmTimeout, in steps of a quarter cycle at 18 us and of a cycle at 14 and 30 us: taken 2 cycles before the window, "no response" 2 cycles after it, one change between; the late status word then begins a message of its own; no word at all: the first write of the record comes after the bound of BM-MR-04 and within 60 cycles of it; response times of 4 and 12 us recorded; an RT to RT transfer without status word 2 and no word after the data word of the RT: "no response 2" when the window ends (all) BM-MR-04, BM-CF-03
test_status_errors (TC-BM-04) Status word of another address as status 1 of an RT to BC message, as status 1 (transmitting RT) and status 2 (receiving RT) of an RT to RT transfer: flag "status address" 1 or 2, words recorded; a data word in place of a status word: flag "sync", the word then outside a message BM-MR-05, BM-MR-08
test_word_count (TC-BM-05) One data word too few of the BC and of the RT: "word count low"; a receive command without any word after it, and a status word without message error or busy without the data words of the RT: "word count low" when the wait for a contiguous word ends; one and two words too many after the RT and after a broadcast, and words beyond 32: "word count high", at most 32 data words stored; a data word of the BC too many, where the status word is expected: "sync", the word outside the message, the status word a message of its own; a status word with message error, with busy and with both, without data words: no flag; with message error and its data words: recorded with them BM-MR-06, BM-MR-07, BM-MR-12
test_invalid_words (TC-BM-06) Each error class (sync, Manchester, bit count, parity) in command word 2, a data word of the BC, status word 1, a data word of the RT and status word 2: flag "invalid word", error class and position, "word count low" where data words are missing, the message ends, the invalid word as a word outside the message with its error class, sync type and contiguity; after the last word of a message: the message complete, the invalid word outside it BM-MR-08, BM-MR-10
test_gap (TC-BM-07) A data word of the BC with a gap of 1 us: "gap" with "word count low"; with a gap of 10 us the wait for the contiguous word ends first: "word count low" only; a data word of the RT with a gap of 1 us; a word with command sync in place of a data word: "sync" with "word count low"; where command word 2 is expected, a word with command sync after a gap of 1 us and a contiguous receive command: "sync" with "word count low"; the first data word of the BC with a gap of 1 us: "gap" with "word count low"; a word with command sync where the first data word of the RT is expected: "sync" with "word count low"; after the last word of a message a contiguous command word or a data word with a gap of 1 us: the message ends without a flag; each word then handled as with no message in progress (a word outside a message, or a message of its own) BM-MR-08, BM-MR-07
test_superseded (TC-BM-08) A command on the other bus while the message of one bus is in each of its states (after command word 1, among the data words of the BC, in the response window, among the data words of the RT, before status word 2), the first message then continuing or stopping: flag "superseded" on the first record, both records complete, in the order of their ends; both directions. A command on the other bus swept cycle by cycle across the end of a message (the end of the wait for a further data word, then the 12 cycles of its header): "superseded" while the message is in progress, never after its end, one change over the sweep BM-MR-09, BM-RC-05
test_outside_words (TC-BM-09) Data words (the first one of a bus with the gap unknown), invalid words and contiguous trains of data words with no message in progress, on both buses, with Cfg_BmOutside = '1' and '0': word records with sync type, error class, own and contiguous flags, data, gap and time tag, or no record; a status word without its command begins a message (BM-MR-01) BM-MR-10, BM-RC-02
test_activity (TC-BM-10) Line activity without a sync of 0.5 us, 3 us, 30 us and longer than the 16-bit duration (c16, c400) on both buses, with Cfg_BmActivity = '1' and '0': activity records with the duration of Rx_NoWordLen and the time tag, or no record; activity with a recognised sync half (a sync error word): no activity record; two activities 0.65 us apart swept cycle by cycle across the end of a message, whose header takes 12 cycles: at 16 MHz the second comes while the first waits and is lost, counted, without a sequence number, above 16 MHz none is lost; every activity recorded or counted (all) BM-RC-03, BM-IF-01, BM-RG-05
test_filter (TC-BM-11) Filter table with record bits for chosen RT addresses, T/R bits and subaddresses, broadcast and mode commands (subaddresses 0 and 31): only those messages recorded, filtered messages take no sequence number; RT to RT recorded by the bit of command word 1 or of command word 2; interrupt bits: event "record" for those records only; Cfg_BmFilter = '0': all recorded, no event "record"; a double error in the record word and the interrupt word of an entry: recorded with "filter error" and the event; word and activity records not filtered (latency) BM-FI-01, BM-FI-02, BM-FI-03, BM-FI-04, BM-RG-04
test_ring (TC-BM-12) Records across the end of the ring, ring sizes 64 and 8192, a ring that crosses memory word 8191; the host reads and advances the read index; event "level" exactly when the unread words reach the level; a full ring: records not written, lost count, event "overflow", gaps in the sequence numbers, write index unchanged; the host frees space: the next record written; lost count cleared; a ring of 64 words that the host does not read and 65590 activities lost on both buses: the lost count saturates at 2^16 - 1, stays there for further losses and is cleared by the host BM-RG-01, BM-RG-02, BM-RG-03, BM-RG-04, BM-RC-04, BM-EV-01
test_own (TC-BM-13) The harness sends the status word and the data words of an RT through the encoder of the codec, the bus model echoing them: the message has the flag "own"; an own word outside a message: word record with the own flag BM-MR-11, BM-RC-02
test_buffer_errors (TC-BM-14) Single and double errors injected through ErrInj_* into the message buffer of each bus while a record is held: a single error corrected, a double error in a data bit gives the word as read and the flag "buffer error"; a double error in a word of a word record other than word 0, which the writer copies last: bit 6 of word 0 set BM-FT-03, BM-IF-07
test_throughput (TC-BM-15) On both buses at once, per bus and word time a message record or a word record and an activity record, every memory request held for one cycle and no request served in 20 cycles of every word time: no record lost, consecutive sequence numbers; a burst of activity every 0.65 us: at 16 MHz records lost for want of a slot, counted, event "overflow", no sequence number taken, at 100 MHz none lost; every activity either recorded or counted. A memory that serves no request for longer than a word time: three activity records and then a message with a data word hold the four slots of bus A, a message with a data word and a word outside a message on that bus are lost, counted, with two overflow events and no sequence number; when the memory serves again the four records are written, the waiting message with its own data word, and the next record has the next number (c100, c100_l1, c100_l8, c16, c16_l8) BM-RG-05, BM-FT-02, BM-FT-04
test_disable (TC-BM-16) Cfg_BmEn = '0' during a message, during the record writing (each cycle of the copy of a record) and while records wait: no further record, the write index never advances over a part of a record; the BC becoming active has the same effect; activation again: write index and sequence number from 0. With a memory without waits, Cfg_BmEn = '0' swept cycle by cycle: across the cycles before the first write of a record (written whole or not at all); across the filter reads of a record, the BM active again two cycles later (the responses of the reads in flight dropped, the next records filtered by their own reads); across the loss of an activity for want of a slot and across the loss of a record that does not fit into the ring: from the clock edge at which Stat_BmActive falls no overflow event and no change of the lost count, the loss counted only when it comes before, one change over each sweep BM-EN-03, BM-EN-02, BM-EN-01
test_bench_checks (TC-BM-17) Checks of the testbench (section 4): the memory model with a ring one word shorter than a record and with the filter table elsewhere, the record checker with one data word changed in the expectation, a record that never comes and a record that comes where none is expected; each check fires, as an expected alert none
lint/synth_check.py Elaboration and synthesis of o1553_bm at 16, 100 and 400 MHz, with SyncStages_g 2 to 4 and MemLatency_g 1, 3 and 8, without latches; a clock frequency the codec does not accept stops with its message BM-CF-01, BM-CF-02

The memory model checks BM-RG-04 in every test. BM-FT-01 is shown by the when others branch of every state machine (code coverage exclusion, docs/coverage.md) and by inspection; the bounds of BM-FT-02 by the measured ends of TC-BM-03 and TC-BM-05 and by the timers of the architecture.

4. Negative tests

Check Proven by
The memory model flags a write outside the ring and a read outside the filter table TC-BM-17: one alert for the word outside the ring, one for each filter read
The record checker of the bench flags a wrong word, a missing and an extra record TC-BM-17: one alert each
The bench detects every RTL fault of the checks of the testbench (verification report section 7) Faults in the reconstruction decisions, the windows, the ring arithmetic and the filter, each simulated with the tests that must detect it

5. Functional coverage

Coverpoint Bins Test cases
FORMAT The ten formats of MIL 4.3.3.6 (addressed and broadcast) per bus TC-BM-02
WORD_COUNT 1, 2 to 16, 17 to 31, 32 data words, low and high TC-BM-02, TC-BM-05
RESPONSE_TIME 4 us, 12 us, around Cfg_BmTimeout, beyond it, none TC-BM-02, TC-BM-03
FLAG Each flag of architecture section 4.6 TC-BM-02 to TC-BM-14
ERROR_CLASS x POSITION Four error classes x six positions TC-BM-06
RECORD_TYPE Message, word, activity TC-BM-02, TC-BM-09, TC-BM-10
RING Plain, across the ring end, across memory word 8191, full, level reached TC-BM-12
SUPERSEDED_STATE The five states of TC-BM-08 per bus TC-BM-08

6. Generic coverage

Generic Range Simulated Synthesised
ClkFreq_g 16 MHz to 400 MHz, multiples of 2 MHz 16, 100, 400 MHz 16, 100, 400 MHz; a frequency that the codec refuses stops the elaboration
SyncStages_g 2 to 4 2, 4 2, 3, 4
MemLatency_g 1 to 8 1, 3, 8 1, 3, 8

7. Traceability

Every requirement of the specification is covered by a test case of section 3; for BM-FT-01 TC-BM-01 shows the reset values, and the recovery from an illegal state rests on the when others branches (code coverage exclusion). The compliance matrix (docs/compliance.md) is generated from this plan and the specification.