cocotb_benches.dau_fixed_point_ln_tb

The rendered ln tile against the model it was rendered from.

Zero tolerance: the HDL mirrors LnDatapath.evaluate step for step, so any difference is a defect in one of them. Deviation from correctly rounded ln is a separate, measured question answered in test_fixed_point_ln – this operating point is FAITHFUL, not correctly rounded, and that is a fact about the model, not a licence for the device to differ from it.

The powers of two are here for the same reason they are in the model’s sweep: normalisation is what a ln datapath gets wrong if it gets anything wrong, and it fails at the exponent transitions or nowhere.

Attributes

_MASK32

_INT32_MAX

_ONE

_CORE

_GENERATOR

_POINT

_ERR_DOMAIN

Functions

_boundary_values() → list[int]

Every 2**k and its neighbours: the exponent transitions.

matches_the_model_on_directed_inputs(dut)

Values a human can check, so a wrong scale factor or a lost exponent

matches_the_model_across_the_domain(dut)

order_and_count_preserved_with_backpressure(dut)

non_positive_source_reports_domain_error(dut)

ln of zero or a negative has no value. The offending row must not come

sustained_ingest_meets_registry_floor(dut)

_signed32(value) → int

_pack(rows) → list[int]

_start(dut) → None

_reset(dut) → None

_run(dut, rows, *[, ready_pattern])

_send(dut, words) → None

_collect(dut, *, expect[, ready_pattern])

The proven quad-row collector: drive ready, sample in ReadOnly, and

_drain_and_record(dut, seen) → None

Drain the output, keeping what came out so a test can assert on it.

_expect_status(dut, *, code) → None

Module Contents

cocotb_benches.dau_fixed_point_ln_tb._MASK32 = 4294967295
cocotb_benches.dau_fixed_point_ln_tb._INT32_MAX = 2147483647
cocotb_benches.dau_fixed_point_ln_tb._ONE = 65536
cocotb_benches.dau_fixed_point_ln_tb._CORE = 'fixed-point-ln'
cocotb_benches.dau_fixed_point_ln_tb._GENERATOR
cocotb_benches.dau_fixed_point_ln_tb._POINT
cocotb_benches.dau_fixed_point_ln_tb._ERR_DOMAIN = 3
cocotb_benches.dau_fixed_point_ln_tb._boundary_values() → list[int]

Every 2**k and its neighbours: the exponent transitions.

async cocotb_benches.dau_fixed_point_ln_tb.matches_the_model_on_directed_inputs(dut)

Values a human can check, so a wrong scale factor or a lost exponent cannot hide behind a random sweep.

async cocotb_benches.dau_fixed_point_ln_tb.matches_the_model_across_the_domain(dut)
async cocotb_benches.dau_fixed_point_ln_tb.order_and_count_preserved_with_backpressure(dut)
async cocotb_benches.dau_fixed_point_ln_tb.non_positive_source_reports_domain_error(dut)

ln of zero or a negative has no value. The offending row must not come out with a substituted one, and the tile must recover for the next batch.

status_ready is held low for longer than the pipeline is deep on purpose: when the close-out is taken promptly it flushes the pipeline anyway, so the guard on the push is only load-bearing under status backpressure.

async cocotb_benches.dau_fixed_point_ln_tb.sustained_ingest_meets_registry_floor(dut)
cocotb_benches.dau_fixed_point_ln_tb._signed32(value: int) → int
cocotb_benches.dau_fixed_point_ln_tb._pack(rows) → list[int]
async cocotb_benches.dau_fixed_point_ln_tb._start(dut) → None
async cocotb_benches.dau_fixed_point_ln_tb._reset(dut) → None
async cocotb_benches.dau_fixed_point_ln_tb._run(dut, rows, *, ready_pattern=(1,))
async cocotb_benches.dau_fixed_point_ln_tb._send(dut, words) → None
async cocotb_benches.dau_fixed_point_ln_tb._collect(dut, *, expect: int, ready_pattern=(1,))

The proven quad-row collector: drive ready, sample in ReadOnly, and only count a beat that actually fired.

async cocotb_benches.dau_fixed_point_ln_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_ln_tb._expect_status(dut, *, code: int) → None