dau_core.ln_generator ===================== .. py:module:: dau_core.ln_generator .. autoapi-nested-parse:: Renders the fixed-point ln tile from a declared operating point. The datapath is :class:`dau_core.fixed_point.LnDatapath` and the emitted SystemVerilog mirrors :meth:`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 ------- .. autoapisummary:: dau_core.ln_generator.LnTileGenerator Module Contents --------------- .. py:class:: LnTileGenerator(/, **data: Any) Bases: :py:obj:`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. .. py:attribute:: module :type: str :value: 'dau_fixed_point_ln' .. py:attribute:: datapath :type: dau_core.fixed_point.LnDatapath .. py:property:: source_name :type: str .. py:method:: __call__(context: dau_core.generators.RenderContext) -> dau_core.generators.RenderedCore 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.