dau_core.ln_generator

Renders the fixed-point ln tile from a declared operating point.

The datapath is dau_core.fixed_point.LnDatapath and the emitted SystemVerilog mirrors LnDatapath.evaluate() step for step, so the cocotb bench compares against it with zero tolerance like every other tile. Generated rather than checked in for the same reason exp and the normal CDF are: the 256-entry tables of ln(1 + j/256) and 1/(1 + j/256) and the series coefficients are transcendental constants at the configured internal precision, and SystemVerilog cannot compute those at elaboration.

ln adds one thing exp does not have: LEADING-ZERO NORMALISATION. x is split as m * 2**e with m in [1, 2), and ln(x) = e*ln2 + ln(m). The exponent half is EXACT integer work – a priority encode, a barrel shift and one multiply by a constant – so only the mantissa series approximates. That is why the accuracy question is confined to the polynomial: the registered point is FAITHFUL (measured 1 ULP), and the deviation is a measured fact recorded in the registry, not a tolerance in the bench.

The lessons the exp tile paid for are repeated here rather than rediscovered: every product gets its own full-width wire, and every multiply gets its own pipeline stage.

Classes

LnTileGenerator

Renders dau_fixed_point_ln for one operating point.

Module Contents

class dau_core.ln_generator.LnTileGenerator(/, **data: Any)[source]

Bases: dau_core.generators.CoreGenerator

Renders dau_fixed_point_ln for one operating point.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

module: str = 'dau_fixed_point_ln'
datapath: dau_core.fixed_point.LnDatapath
property source_name: str
__call__(context: dau_core.generators.RenderContext) → dau_core.generators.RenderedCore[source]

This method produces the result for the given context.

Instead of passing the context, one can pass an object that pydantic will try to validate as the context. Additionally, if kwargs are passed instead of the context, it will use these to construct the context.