hwt.serializer package

This package contains serializers. Purpose of serializer class is to convert hwt representations of designed architecture to hdlConvertorAst to convert it to target language (VHDL/Verilog/SystemC…+xdc/ucf/…).

Rather than using serializer classes manually it is recommended to use hwt.synth.to_rtl()

The serialization process is usually a destructive operation as parts of AST can be rewritten to fit target language.

Subpackages

Submodules

hwt.serializer.exceptions module

exception hwt.serializer.exceptions.SerializerException[source]

Bases: Exception

exception hwt.serializer.exceptions.UnsupportedEventOpErr[source]

Bases: SerializerException

Target HDL can not use event operator in this context, it usually has to be replaced by correct expression of sensitivity list

hwt.serializer.ip_packager module

hwt.serializer.mode module

Serializer mode specifies if hdl objects derived from parent unit should be serialized to target HDL or not

use serialize* methods to specify serialization mode for unit class

@serializeExclude
class MyHwModule(HwModule):
    # ...
    pass
hwt.serializer.mode._serializeExclude_eval(parentModule: HwModule, priv)[source]

Always decide not to serialize obj

Parameters:

priv – private data for this function first unit of this class

Returns:

tuple (do serialize this object, next priv, replacement unit)

hwt.serializer.mode._serializeOnce_eval(parentModule: HwModule, priv)[source]

Decide to serialize only first obj of it’s class

Parameters:

priv – private data for this function (first object with class == obj.__class__)

Returns:

tuple (do serialize this object, next priv, replacement unit) where priv is private data for this function (first object with class == obj.__class__)

hwt.serializer.mode._serializeParamsUniq_eval(parentModule: HwModule, priv)[source]

Decide to serialize only objs with unique parameters and class

Parameters:

priv – private data for this function ({frozen_params: obj})

Returns:

tuple (do serialize this object, next priv, replacement unit)

hwt.serializer.mode.freeze_dict(data)[source]
hwt.serializer.mode.hwParamsToValTuple(module: HwModule)[source]
hwt.serializer.mode.serializeExclude(cls: Type[HwModule])[source]

Never serialize HDL objects from this class

hwt.serializer.mode.serializeOnce(cls: Type[HwModule])[source]

Serialize HDL objects only once per class

hwt.serializer.mode.serializeParamsUniq(cls: Type[HwModule])[source]

Decide to serialize only when parameters are unique

hwt.serializer.serializer_config module

hwt.serializer.serializer_filter module

hwt.serializer.store_manager module

hwt.serializer.utils module