systemc-clang
2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
plugins
hdl
parselib
transforms
passes.py
Go to the documentation of this file.
1
"""Different pass of the translation"""
2
from
.alias_translation
import
AliasTranslation
3
from
.literal_expansion
import
LiteralExpansion
4
from
.node_merge
import
NodeMergePass
5
from
.sort_var_decl
import
SortVarDecl
6
from
.typedef_expansion
import
TypedefExpansion
7
from
.typedef_filter
import
TypeDefFilter, TypeDefCleanup
8
from
.verilog_tranlation
import
VerilogTranslationPass
9
from
.port_expansion
import
PortExpansion
10
from
.slice_merge
import
SliceMerge
11
from
.node_movement
import
NodeMovement
12
from
.function_param_marker
import
FunctionParamMarker
13
from
.reorder_mod_init_block
import
ReorderModInitBlock
14
from
.function_info_pass
import
FunctionInfoPass, FunctionInfoPass2
15
from
.function_transformation_pass
import
FunctionTransformationPass
16
from
.comma_transformation
import
CommaTransformation
17
from
.structure_collector
import
StructureCollector
18
19
from
..utils
import
dprint
20
21
22
class
VerilogTranslator
:
23
"""Translate hcode to verilog"""
24
@staticmethod
25
def
translate
(tree):
26
# we need some form of `level' of the tree, lower level meaning it is loosing more information, but more lenient
27
# to hardware language
28
prev = tree
29
prev =
ReorderModInitBlock
().visit(prev)
30
prev =
NodeMovement
().visit(prev)
31
prev =
SortVarDecl
().visit(prev)
32
prev =
AliasTranslation
().visit(prev)
33
sc =
StructureCollector
()
34
sc.visit(prev)
35
prev =
LiteralExpansion
(structure=sc.hier).visit(prev)
36
prev =
SliceMerge
().visit(prev)
37
# prev = CommaTransformation().visit(prev)
38
# dprint(prev.pretty())
39
f =
TypeDefFilter
()
40
prev = f.visit(prev)
41
prev =
NodeMergePass
().visit(prev)
42
prev =
PortExpansion
().visit(prev)
43
# note typedef should be after port expansion to prevent duplicate valid/ready
44
prev =
TypedefExpansion
(f.types).visit(prev)
45
prev =
FunctionInfoPass
().visit(prev)
46
prev =
FunctionInfoPass2
().visit(prev)
47
prev =
FunctionParamMarker
().visit(prev)
48
prev =
FunctionTransformationPass
().visit(prev)
49
prev =
TypeDefCleanup
().visit(prev)
50
prev =
VerilogTranslationPass
().visit(prev)
51
return
prev
52
parselib.transforms.alias_translation.AliasTranslation
Definition
alias_translation.py:7
parselib.transforms.function_info_pass.FunctionInfoPass2
Definition
function_info_pass.py:186
parselib.transforms.function_info_pass.FunctionInfoPass
Definition
function_info_pass.py:13
parselib.transforms.function_param_marker.FunctionParamMarker
Definition
function_param_marker.py:8
parselib.transforms.function_transformation_pass.FunctionTransformationPass
Definition
function_transformation_pass.py:11
parselib.transforms.literal_expansion.LiteralExpansion
Definition
literal_expansion.py:10
parselib.transforms.node_merge.NodeMergePass
Definition
node_merge.py:4
parselib.transforms.node_movement.NodeMovement
Definition
node_movement.py:6
parselib.transforms.passes.VerilogTranslator
Definition
passes.py:22
parselib.transforms.passes.VerilogTranslator.translate
translate(tree)
Definition
passes.py:25
parselib.transforms.port_expansion.PortExpansion
Definition
port_expansion.py:9
parselib.transforms.reorder_mod_init_block.ReorderModInitBlock
Definition
reorder_mod_init_block.py:6
parselib.transforms.slice_merge.SliceMerge
Definition
slice_merge.py:7
parselib.transforms.sort_var_decl.SortVarDecl
Definition
sort_var_decl.py:4
parselib.transforms.structure_collector.StructureCollector
Definition
structure_collector.py:11
parselib.transforms.typedef_expansion.TypedefExpansion
Definition
typedef_expansion.py:12
parselib.transforms.typedef_filter.TypeDefCleanup
Definition
typedef_filter.py:62
parselib.transforms.typedef_filter.TypeDefFilter
Definition
typedef_filter.py:7
parselib.transforms.verilog_tranlation.VerilogTranslationPass
Definition
verilog_tranlation.py:11
Generated by
1.12.0