cocotb_benches.dau_fixed_point_sqrt_tb¶
The fixed-point sqrt tile against its golden, with NO tolerance.
The root is exact by construction – isqrt(X << F) – so every comparison here is equality against sqrt_row_fields. If this tile ever grows a polynomial approximation, these tests are what will refuse it, and that is deliberate: an approximate root would need an error bound nobody in the stack currently has a way to state.
Attributes¶
Functions¶
The cases a human can check by hand, so a wrong scale factor cannot |
|
Digit recurrences fail at carries. Each power of two and its |
|
The whole reason the tile has its own error code: sqrt of a negative |
|
The domain guard is only load-bearing under status backpressure. |
|
In-place is legal, as it is for the map ALU: the source is captured |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drain the output, keeping what came out so a test can assert on it. |
|
|
|
|
|
|
|
Module Contents¶
- cocotb_benches.dau_fixed_point_sqrt_tb._MASK32 = 4294967295¶
- cocotb_benches.dau_fixed_point_sqrt_tb._INT32_MAX = 2147483647¶
- cocotb_benches.dau_fixed_point_sqrt_tb._ONE = 65536¶
- cocotb_benches.dau_fixed_point_sqrt_tb._ROWS¶
- cocotb_benches.dau_fixed_point_sqrt_tb._SQRT_VALUE¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.sustained_ingest_meets_registry_floor(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.perfect_squares_are_exact(dut)¶
The cases a human can check by hand, so a wrong scale factor cannot hide behind ‘close enough’.
- async cocotb_benches.dau_fixed_point_sqrt_tb.directed_rows_match_golden(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.every_dst_variant_passes_the_others_through(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.boundaries_around_every_power_of_two(dut)¶
Digit recurrences fail at carries. Each power of two and its neighbours put the recurrence’s remainder at its extremes.
- async cocotb_benches.dau_fixed_point_sqrt_tb.order_and_count_preserved_with_backpressure(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.constrained_random_batches_match_golden(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.negative_source_drains_batch_then_reports_domain_error(dut)¶
The whole reason the tile has its own error code: sqrt of a negative has no answer, and emitting one anyway would be a wrong number that looks right.
- async cocotb_benches.dau_fixed_point_sqrt_tb.negative_row_never_escapes_while_the_close_out_waits(dut)¶
The domain guard is only load-bearing under status backpressure.
When the close-out is taken promptly it flushes the pipeline, so a negative row that entered would be dropped before it retired and the guard would look redundant. Hold status_ready low for longer than the pipeline is deep and the row reaches the output instead – which is exactly the case that must not emit a root the tile does not have.
- async cocotb_benches.dau_fixed_point_sqrt_tb.dst_equal_to_src_updates_in_place(dut)¶
In-place is legal, as it is for the map ALU: the source is captured when the row is pushed and the destination written when it retires, so they may be the same field.
- async cocotb_benches.dau_fixed_point_sqrt_tb.torn_row_reports_stream_error(dut)¶
- async cocotb_benches.dau_fixed_point_sqrt_tb.error_status_survives_backpressure(dut)¶
- cocotb_benches.dau_fixed_point_sqrt_tb._signed32(value: int) int¶
- cocotb_benches.dau_fixed_point_sqrt_tb._drive_config(dut, config: dau_core.operators.RowSqrtConfig) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._start(dut) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._run(dut, rows, config: dau_core.operators.RowSqrtConfig, *, ready_pattern=(1,))¶
- cocotb_benches.dau_fixed_point_sqrt_tb._pack_rows(rows) list[int]¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._send_words(dut, words) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._send_rows(dut, rows) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._drain_and_record(dut, seen: list[int]) None¶
Drain the output, keeping what came out so a test can assert on it.
- async cocotb_benches.dau_fixed_point_sqrt_tb._drain_words(dut) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._collect_output(dut, ready_pattern, *, expect_words: int) list[int]¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._assert_quiescent(dut) None¶
- async cocotb_benches.dau_fixed_point_sqrt_tb._expect_status(dut, *, error: bool, code: int = 0) None¶