cocotb_benches.dau_datetime_format_tb¶
The datetime formatter against its golden, character for character.
This tile shipped without a bench, which an audit caught: its only test read constants out of the SystemVerilog and exercised the Python golden, so the HDL was never instantiated. A resource number for a module nobody ran is a number about an unverified design, and that is what this file fixes.
Every case compares the 152-bit output beat against format_datetime_rows
by decoding it back to a string, so a wrong character fails with the two
strings side by side rather than with a hex mismatch.
The dates chosen are the ones the era arithmetic gets wrong when it is
written by hand: 2000 is a leap year (divisible by 400), 2100 is not
(divisible by 100 but not 400), and 2024-02-29 must exist. The range ends
are here because a formatter that silently truncates the year is exactly the
failure DOMAIN exists to prevent.
Attributes¶
Functions¶
|
The 152-bit beat back to text: character i in bits [8*i+7:8*i]. |
|
|
|
Drive rows, one handshake at a time. |
|
Send |
The cases a hand-written civil-from-days gets wrong. |
|
A formatter that truncated the year instead of refusing would pass |
|
The sink stalls on a fixed pattern; nothing may be lost or reordered. |
|
Repeated runs without an intervening reset: state must not carry. |
|
Reset mid-batch, then run a clean one: the interrupted rows must not |
|
Module Contents¶
- cocotb_benches.dau_datetime_format_tb._CHARS = 19¶
- cocotb_benches.dau_datetime_format_tb._EDGE_ROWS¶
- cocotb_benches.dau_datetime_format_tb._decode(beat: int) str¶
The 152-bit beat back to text: character i in bits [8*i+7:8*i].
- async cocotb_benches.dau_datetime_format_tb._start(dut)¶
- async cocotb_benches.dau_datetime_format_tb._send(dut, rows) None¶
Drive rows, one handshake at a time.
Sampling happens in ReadOnly and the cycle advances on RisingEdge, which is the palette’s shape. Combining send, drain and status-watch into one loop deadlocks – the sender holds input_valid while the same loop is trying to observe the output, so neither side ever fires.
- async cocotb_benches.dau_datetime_format_tb._run(dut, rows, *, expect: int | None = None, ready_pattern=None)¶
Send
rowsconcurrently while draining.This tile declares ``success_close_out: False``, so a clean batch is contractually SILENT – there is no status beat to wait for, and a bench that waits for one hangs forever. That is not a tile defect; 23 of the 45 registered operators are silent on success, and the registry fact is the authority. So the drain ends when the expected rows have arrived, and only an ERROR produces a close-out.
expectis how many rendered rows to wait for (default: all of them).ready_patternstalls the sink, which is the backpressure case.
- async cocotb_benches.dau_datetime_format_tb.renders_every_row_exactly(dut)¶
- async cocotb_benches.dau_datetime_format_tb.leap_rules_and_range_ends_are_exact(dut)¶
The cases a hand-written civil-from-days gets wrong.
- async cocotb_benches.dau_datetime_format_tb.a_value_past_the_range_closes_out_domain(dut)¶
A formatter that truncated the year instead of refusing would pass every other test in this file, which is why this one exists.
- async cocotb_benches.dau_datetime_format_tb.backpressure_does_not_drop_or_reorder(dut)¶
The sink stalls on a fixed pattern; nothing may be lost or reordered.
- async cocotb_benches.dau_datetime_format_tb.a_second_batch_matches_the_first(dut)¶
Repeated runs without an intervening reset: state must not carry.
- async cocotb_benches.dau_datetime_format_tb.reset_clears_a_batch_in_flight(dut)¶
Reset mid-batch, then run a clean one: the interrupted rows must not appear in the next batch’s output.
- async cocotb_benches.dau_datetime_format_tb.randomized_instants_match_the_golden(dut)¶
- async cocotb_benches.dau_datetime_format_tb.sustained_ingest_meets_registry_floor(dut)¶