hdlConvertorAst.to package¶
This package contains the classes which do convert hdlConvertorAst.hdlAst to a target language (e.g. Verilog/SystemVerilog/VHDL)
note: | The convertors in this package do not modify the AST itself, if the input comes from a different language.
It may be required to translate the AST first using e.g. hdlConvertorAst.translate . |
---|
Subpackages¶
Submodules¶
hdlConvertorAst.to.common module¶
-
class
hdlConvertorAst.to.common.
ASSOCIATIVITY
[source]¶ Bases:
enum.Enum
An enumeration.
-
L_TO_R
= 'L_TO_R'¶
-
NONE
= 'NONE'¶
-
R_TO_L
= 'R_TO_L'¶
-
-
class
hdlConvertorAst.to.common.
ToHdlCommon
(out_stream)[source]¶ Bases:
hdlConvertorAst.to.hdl_ast_visitor.HdlAstVisitor
-
ALL_UNARY_OPS
= {<HdlOpType.PLUS_UNARY: 1>, <HdlOpType.NAND_UNARY: 26>, <HdlOpType.NOR_UNARY: 27>, <HdlOpType.AND_UNARY: 25>, <HdlOpType.XOR_UNARY: 28>, <HdlOpType.OR_UNARY: 24>, <HdlOpType.MINUS_UNARY: 0>, <HdlOpType.XNOR_UNARY: 29>}¶
-
GENERIC_BIN_OPS
= {<HdlOpType.ADD: 3>: ' + ', <HdlOpType.SUB: 2>: ' - ', <HdlOpType.MUL: 5>: ' * ', <HdlOpType.LT: 40>: ' < ', <HdlOpType.LE: 41>: ' <= ', <HdlOpType.GT: 42>: ' > ', <HdlOpType.GE: 43>: ' >= ', <HdlOpType.DOT: 55>: '.'}¶
-
GENERIC_UNARY_OPS
= {<HdlOpType.PLUS_UNARY: 1>: '+', <HdlOpType.MINUS_UNARY: 0>: '-'}¶
-
GENERIC_UNARY_OPS_POSTFIX
= {}¶
-
INDENT_STEP
= ' '¶
-
hdlConvertorAst.to.hdlUtils module¶
-
class
hdlConvertorAst.to.hdlUtils.
AutoIndentingStream
(stream, indent_step)[source]¶ Bases:
object
-
class
hdlConvertorAst.to.hdlUtils.
Indent
(autoIndentStream)[source]¶ Bases:
object
indentation context
-
class
hdlConvertorAst.to.hdlUtils.
UnIndent
(autoIndentStream)[source]¶ Bases:
object
unindentation context
hdlConvertorAst.to.hdl_ast_modifier module¶
-
class
hdlConvertorAst.to.hdl_ast_modifier.
HdlAstModifier
[source]¶ Bases:
hdlConvertorAst.to.hdl_ast_visitor.HdlAstVisitor
A visitor which can be used to traverse and modyfy AST (Abstract Syntax Tree) made of objects from hdlConvertorAst.hdlAst module. Each visit function has to return the object which replaces current object It should return the same object if no change is required.
hdlConvertorAst.to.hdl_ast_visitor module¶
hdlConvertorAst.to.json_debug module¶
-
class
hdlConvertorAst.to.json_debug.
ToJsonDebug
[source]¶ Bases:
hdlConvertorAst.to.json.ToJson
HdlConverto AST -> json (dict/list/str/int/None composed object) An invalid object are converted to str using its __repr__()