o1553_bm: Architecture and Design Description¶
1. Block diagram¶
| Entity | Function |
|---|---|
o1553_bm |
Top level: enable state, configuration taken at the activation, state outputs, events (sections 3, 8) |
o1553_bm_trk |
Message tracker, one per bus: reconstruction of the messages of its bus, completion of the records into its message buffer (sections 5, 6.1) |
o1553_bm_mem |
Record writer: queue of completed records, filter reads, sequence numbers, ring writes (section 6) |
o1553_bm_pkg |
Record formats, flag positions, timing constants |
The format of a command word, the words that the BC sends and those that the RT returns, comes from bcFormat of
o1553_bc_pkg, the function that the BC uses to send every format (o1553_bc architecture section 6.2). The BM uses it
unchanged; no part of the BC is instantiated.
2. Interfaces¶
2.1 Generics¶
| Generic | Type | Default | Range | Description |
|---|---|---|---|---|
ClkFreq_g |
real | (none) | 16.0e6 to 400.0e6, integer multiples of 2 MHz | Clock frequency, that of the codec |
SyncStages_g |
positive | 2 | 2 to 4 | Synchroniser stages of the codec, for rxLatency |
MemLatency_g |
positive | 3 | 1 to 8 | Latency of the memory port |
2.2 Ports¶
| Port | Width | Direction | Description |
|---|---|---|---|
Clk, Rst |
1 | in | Clock and synchronous high-active reset |
Rx_Valid, Rx_Sync, Rx_Contig, Rx_Own |
2 | in | Word events of o1553_codec, per bus |
Rx_Data, Rx_Gap |
32 | in | Data and gap of the word events, bus b in bits 16b+15 to 16b |
Rx_Error |
6 | in | Validation result, bus b in bits 3b+2 to 3b |
Rx_NoWord |
2 | in | Events of line activity without a word, per bus (o1553_codec CD-DE-14) |
Rx_NoWordLen |
32 | in | Their duration in clock cycles, bus b in bits 16b+15 to 16b |
Mem_Req_Valid, Mem_Req_Ready |
1 | out, in | Memory request stream |
Mem_Req_Addr |
13 | out | Word address |
Mem_Req_Write, Mem_Req_WrData |
1, 16 | out | Write flag and data |
Mem_Rsp_Valid, Mem_Rsp_Data, Mem_Rsp_Ded |
1, 16, 1 | in | Read response with the double error flag |
Mem_InitDone |
1 | in | The buffer memory is initialised |
Time_Tag |
32 | in | Time tag of the core time base, microseconds |
Stat_BcActive |
1 | in | The BC is active |
Cfg_Bm* |
in | Configuration inputs (section 3.1) | |
Cmd_BmLostClr |
1 | in | One-cycle command: clear the lost count |
Stat_Bm* |
out | State outputs (section 3.2) | |
Ev_BmRecord, Ev_BmOverflow, Ev_BmLevel |
1 | out | Events (BM-EV-01) |
ErrInj_BitFlip, ErrInj_Valid |
2 x 22, 2 | in | Error injection of the message buffers of bus A and bus B (olo_ft_ram_sdp) |
3. Configuration, state and events¶
3.1 Configuration inputs¶
| Input | Width | Register field | Taken | Description |
|---|---|---|---|---|
Cfg_BmEn |
1 | BM_CONTROL.EN |
at once | Enable (BM-EN-01) |
Cfg_BmFilter |
1 | BM_CONTROL.FILTER |
activation | Use the filter table (BM-FI-02) |
Cfg_BmOutside |
1 | BM_CONTROL.OUTSIDE |
activation | Record words outside a message (BM-RC-02) |
Cfg_BmActivity |
1 | BM_CONTROL.ACTIVITY |
activation | Record line activity without a word (BM-RC-03) |
Cfg_BmTimeout |
16 | BM_TIMEOUT |
activation | Response window in clock cycles, bounded to at least 28H (BM-CF-03); reset value 18.0 us as BC_TIMEOUT |
Cfg_BmRingBase |
13 | BM_RING_BASE |
activation | First memory word of the ring |
Cfg_BmRingSize |
14 | BM_RING_SIZE |
activation | Ring size S in words, bounded to 64 to 8192 |
Cfg_BmFilterBase |
13 | BM_FILTER_BASE |
activation | Filter table; bits 7 to 0 ignored (multiple of 256) |
Cfg_BmRdIdx |
13 | BM_READ_INDEX |
at once | Read index of the host, ring words from the base |
Cfg_BmIrqLevel |
13 | BM_IRQ_LEVEL |
at once | Fill level of the event "level" |
3.2 State outputs and events¶
| Output | Width | Register field | Description |
|---|---|---|---|
Stat_BmActive |
1 | BM_STATUS.ACTIVE |
The BM is active (BM-EN-01) |
Stat_BmWrIdx |
13 | BM_WRITE_INDEX |
Write index, ring words from the base |
Stat_BmLost |
16 | BM_LOST |
Lost count (BM-RG-03) |
Stat_BmSeq |
16 | BM_STATUS.SEQ |
Sequence number of the next record |
Ev_BmRecord |
1 | IRQ_FLAGS.BM_RECORD |
A record with its interrupt bit was written (BM-FI-03) |
Ev_BmOverflow |
1 | IRQ_FLAGS.BM_OVERFLOW |
A record did not fit into the ring |
Ev_BmLevel |
1 | IRQ_FLAGS.BM_LEVEL |
The unread words reached Cfg_BmIrqLevel |
The register names are those of register map 0.3 (o1553_host architecture section 3.3); Cmd_BmLostClr is
BM_COMMAND.LOST_CLR.
4. Records and the filter table in the buffer memory¶
4.1 Memory use¶
The BM writes only ring words and reads only the filter table (BM-RG-04). Both are placed by the host. In a core that runs as RT with the BM, the region 0x0200 to 0x07FF that the RT does not use holds them (core architecture section 7.7), shared with the bus profile of a backup BC as the host divides it, for example the filter table at 0x0200 and a ring of 1280 words at 0x0300 (the reset values of the registers). With the RT disabled, every region but the event log is free.
The first word of every record gives its type and length:
| Bits 15 to 14 of word 0 | Record | Length |
|---|---|---|
| "00" | Message record | 12 + number of data words (bits 12 to 7) |
| "01" | Word record | 6 |
| "10" | Activity record | 6 |
4.2 Message record¶
| Word | Content |
|---|---|
| 0 | Bits 15 to 14 "00"; bit 13 bus ('0' A, '1' B); bits 12 to 7 number of data words n (0 to 32); bits 6 to 0 zero |
| 1 | Sequence number (BM-RC-04) |
| 2 | Flags (section 4.6) |
| 3 | Bits 15 to 13 error class of the invalid word (o1553_codec Rx_Error code); bits 5 to 0 its position: the index of the word in the message on the bus, command word 1 = 0; zero without the flag "invalid word" |
| 4, 5 | Command word 1, command word 2 (RT to RT) |
| 6, 7 | Status word 1, status word 2 (receiving RT of an RT to RT transfer) |
| 8, 9 | Response time of status word 1 and 2 in clock cycles (the gap of the status word, 16 bits, saturating) |
| 10, 11 | Time tag of command word 1, bits 15 to 0 and 31 to 16 |
12 to 11 + n |
Data words in their order on the bus: the data words of the BC, the mode data word, the data words of the RT and those of the flag "word count high", at most 32 |
4.3 Word record¶
| Word | Content |
|---|---|
| 0 | Bits 15 to 14 "01"; bit 13 bus; bit 12 sync type ('1' command/status); bit 11 own; bit 10 contiguous; bits 9 to 7 error class; bit 6 buffer error (BM-FT-03); bits 5 to 0 zero |
| 1 | Sequence number |
| 2 | The 16 data bits of the word |
| 3 | Its gap in clock cycles |
| 4, 5 | Time tag of its word event |
4.4 Activity record¶
| Word | Content |
|---|---|
| 0 | Bits 15 to 14 "10"; bit 13 bus; bit 6 buffer error (BM-FT-03); the other bits zero |
| 1 | Sequence number |
| 2 | Duration of the line activity in clock cycles (Rx_NoWordLen, all ones when longer) |
| 3 | Zero |
| 4, 5 | Time tag of the event |
4.5 Filter table¶
256 words at Cfg_BmFilterBase (a multiple of 256). For RT address r, T/R bit t and subaddress s, word
r x 4 + t x 2 + s / 16 holds the record bit, word 128 + r x 4 + t x 2 + s / 16 the interrupt bit, both
in bit s mod 16. Address 31 selects the broadcast commands. The mode commands of an RT use the bits of subaddresses 0
and 31 of their T/R bit.
4.6 Flags¶
| Bit | Flag | Set by |
|---|---|---|
| 0 | Broadcast | Command word 1 with address 31 |
| 1 | RT to RT | Command word 2 (BM-MR-02) |
| 2, 3 | No response 1, 2 | BM-MR-04 |
| 4, 5 | Status address 1, 2 | BM-MR-05 |
| 6 | Word count low | BM-MR-06, BM-MR-08 |
| 7 | Word count high | BM-MR-07 |
| 8 | Invalid word | BM-MR-08 |
| 9 | Sync | BM-MR-08 |
| 10 | Gap | BM-MR-08 |
| 11 | Superseded | BM-MR-09 |
| 12 | Own | BM-MR-11 |
| 13 | Filter error | BM-FI-04 |
| 14 | Buffer error | BM-FT-03 |
| 15 | Zero |
5. Message tracker (o1553_bm_trk)¶
5.1 State machine¶
| State | Expects | Next |
|---|---|---|
Idle_s |
A valid word with command sync | Cmd2_s (receive command that is not a mode command), DataBc_s (mode command with a received data word), Status1_s (transmit command, mode command without or with a transmitted data word, not broadcast), Tail_s (broadcast mode command without data word) |
Cmd2_s |
Command word 2 or the first data word of the BC, contiguous | Status1_s (RT to RT), DataBc_s |
DataBc_s |
The data words of the BC, contiguous | Status1_s, or Tail_s for a broadcast |
Status1_s |
Status word 1 within the response window | DataRt_s, Status2_s (RT to RT without data words never occurs: 1 to 32 words), Tail_s |
DataRt_s |
The data words of the RT, contiguous | Status2_s (RT to RT, not broadcast), Tail_s |
Status2_s |
Status word 2 within the response window | Tail_s |
Tail_s |
A further contiguous data word (word count high) | End_s |
End_s |
The record goes to the writer; Idle_s |
5.2 Words of a format¶
bcFormat (o1553_bc_pkg) gives, from command word 1 and, for an RT to RT transfer, command word 2: the data words
of the BC (TxWords, or one with ModeWord), whether a status word follows (Resp1), the data words of the RT
(RxWords) and whether a second status word follows (Resp2). In Cmd2_s the tracker decides the RT to RT transfer
and calls it again with the RT to RT flag.
5.3 Decisions on a word event¶
| State | Word event | Action |
|---|---|---|
Idle_s |
Valid, command sync | Begin a message (command word 1, time tag), signal "superseded" to the other tracker |
Idle_s |
Valid with data sync, or invalid | Word record (with Cfg_BmOutside) |
Cmd2_s, DataBc_s, DataRt_s |
Valid, data sync, contiguous | Data word |
Cmd2_s |
Valid, command sync, contiguous, T/R = '1' | Command word 2 |
Status1_s, Status2_s |
Gap > Cfg_BmTimeout |
"No response"; end; the word again in Idle_s |
Status1_s, Status2_s |
Valid, command sync, gap <= Cfg_BmTimeout |
Status word, response time; "status address" when the address differs |
DataRt_s |
No data word after a status word with message error or busy | End without a flag (I25) |
| expected word | Invalid | "Invalid word" with error class and position; end; the word again in Idle_s |
| expected word | Wrong sync type | "Sync"; end; the word again in Idle_s |
| expected contiguous word | Not contiguous | "Gap"; end; the word again in Idle_s |
Tail_s |
Valid, data sync, contiguous | "Word count high", data word while fewer than 32 |
Tail_s |
Any other word | End; the word again in Idle_s |
any but Idle_s |
Command word 1 on the other bus | "Superseded" |
Where data words are missing at the end, "word count low" is set as well. A word "again in Idle_s" is handled in
the cycle after the end, from the registered word event; the decision takes one cycle and the next word event of the
bus comes at least 40H cycles later.
5.4 Timers¶
One timer per tracker counts the clock cycles since the word event of the last word of the message, saturating at
2^17 - 1. It ends the response window at Cfg_BmTimeout + 36H + rxLatency + 2 cycles (BM-MR-04: a status word
whose mid-sync crossing is at the time-out has its word event 36H + rxLatency cycles later, with one cycle of
margin for the event sampling) and the wait for a contiguous word at 40H + rxLatency + 2 cycles (BM-MR-07). Both
compare with >=.
6. Record writer (o1553_bm_mem)¶
6.1 Message buffers¶
Each tracker writes its records into its message buffer, an olo_ft_ram_sdp of 256 words of 16 bits with ECC, in four
slots of 64 words: the data words as they come, the header of a message from registers in the 12 cycles after its
end, a word or activity record in 6 cycles. A slot is taken when its record begins and given back when the writer has
written or discarded it. A word event and an activity event that come while the buffer is being written wait in one
register each. A record that begins while all four slots are taken, and an activity that comes while the one before
it still waits, are lost (BM-RG-05); section 7 shows when this can occur.
6.2 Order and filter¶
The completed records enter a queue of eight entries (two trackers, four slots) in the order of their completion. The
writer takes the oldest: for a message record with Cfg_BmFilter = '1' it reads the record word and the interrupt
word of command word 1 and, for an RT to RT transfer, of command word 2 (two or four reads), takes a bit read with a
double error as '1', and discards the record when no record bit is set. It gives the
record the next sequence number, checks that it fits (BM-RG-03), copies it word by word from the slot to the ring, with
the sequence number and the flags "filter error" and "buffer error" put in on the way, and then advances the write
index (BM-RG-02).
A record lost for want of ring space, like one lost for want of a slot, is counted and gives the event "overflow" only
while the BM is active (BM-EN-02, BM-EN-03). The check of the free space takes the sequence number also in the cycle in
which the BM becomes inactive, so Stat_BmSeq may advance by one in that cycle; it starts at 0 at the next activation
(BM-EN-01).
6.3 Ring addresses¶
Ring word i is at memory word (Cfg_BmRingBase + i) mod 8192; the writer advances its ring position modulo S
with each word. The free space of BM-RG-03 is computed once per record from the write index and Cfg_BmRdIdx.
7. Timing budget¶
At 16 MHz a word takes 40H = 320 cycles. A record takes at most 4 filter reads and 44 writes; each memory request
waits at most for one host access and for the requests of the RT. The RT issues its requests in jobs: per message a
lookup (2 reads), one or two accesses per data word, a publication (3) and an event record (8) (o1553_rt
architecture section 6.1); within one word time that is at most 20 requests, with commands on both buses. Per bus
and word time the trackers complete at most one message record, one word record and one activity record, so the writer
needs at most 2 x (4 + 44 + 6 + 6) = 120 requests, plus 120 host waits and 20 RT requests: 260 cycles, below the 320
cycles of a word. At every clock frequency from 16 MHz the writer therefore empties
the slots faster than the bus traffic fills them, and no record is lost for want of a slot. Only line activity without
words in bursts that come faster than the writer copies their records (a record of 6 words and its waits take up to 13
cycles, more than the shortest activity period of about 0.5 us at 16 MHz) can fill all slots of a bus; those records
are counted as lost.
8. Reset and fault tolerance¶
- The enable state, the configuration taken at the activation, the indexes and counters are registers; every state
machine has a
when othersbranch to its idle state (BM-FT-01). - The message buffers are
olo_ft_ram_sdpwith SECDED; a record is resident for less than a word time, so no scrubber is needed (BM-FT-03). - Every timer and counter saturates or wraps by design (section 3 of the specification) and ends its wait at or beyond its limit.
- The BM never transmits and has no input to the RT or the encoder: no upset of the BM reaches the bus (BM-IF-02). An upset of the write index or of a record is visible to the host through the record types, lengths and sequence numbers.
- All other logic relies on the TMR of the synthesis tool (protection scope of the user guide).