systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
parselib.utils Namespace Reference

Classes

class  ContextManager
 

Functions

 tidify (verilog, current_indent=0, indent_width=2)
 
 p (decorated)
 
 dprint (*arg, **kwargs)
 
 terminate_with_no_trace ()
 
 is_tree_type (t, name)
 
 is_tree_types (t, names)
 
 get_ids_in_tree (tree)
 
 get_ids_in_tree_types (tree, types=['hvarref'])
 
 get_tree_types (tree, types=['hvarref'])
 
 get_ids_in_tree_dfs (tree)
 
 set_ids_in_tree_dfs (tree, ids)
 
 alternate_ids (tree, ops)
 
 map_hvarref_ids (tree, ops)
 

Variables

bool debug = True
 

Detailed Description

Utility library

Function Documentation

◆ alternate_ids()

parselib.utils.alternate_ids ( tree,
ops )
Change the ids within a tree, given operations ops as an array of lambdas

Definition at line 144 of file utils.py.

◆ dprint()

parselib.utils.dprint ( * arg,
** kwargs )
debug utility for printing, prints line number

Definition at line 43 of file utils.py.

◆ get_ids_in_tree()

parselib.utils.get_ids_in_tree ( tree)
get all ids

Definition at line 64 of file utils.py.

◆ get_ids_in_tree_dfs()

parselib.utils.get_ids_in_tree_dfs ( tree)
get all ids

Definition at line 100 of file utils.py.

◆ get_ids_in_tree_types()

parselib.utils.get_ids_in_tree_types ( tree,
types = ['hvarref'] )
get all ids

Definition at line 76 of file utils.py.

◆ get_tree_types()

parselib.utils.get_tree_types ( tree,
types = ['hvarref'] )
get all ids

Definition at line 89 of file utils.py.

◆ is_tree_type()

parselib.utils.is_tree_type ( t,
name )
Check whether t is lark Tree and whether the tree type is name

Definition at line 52 of file utils.py.

◆ is_tree_types()

parselib.utils.is_tree_types ( t,
names )
Check whether t is lark Tree and whether the tree type is name

Definition at line 57 of file utils.py.

◆ map_hvarref_ids()

parselib.utils.map_hvarref_ids ( tree,
ops )
get all and apply mapping function

Definition at line 152 of file utils.py.

◆ p()

parselib.utils.p ( decorated)
a decorator that helps printing out the transformation results

Definition at line 30 of file utils.py.

◆ set_ids_in_tree_dfs()

parselib.utils.set_ids_in_tree_dfs ( tree,
ids )

Definition at line 128 of file utils.py.

◆ terminate_with_no_trace()

parselib.utils.terminate_with_no_trace ( )

Definition at line 49 of file utils.py.

◆ tidify()

parselib.utils.tidify ( verilog,
current_indent = 0,
indent_width = 2 )
makes the generated verilog looks a bit better, may be subject to changes later

Definition at line 6 of file utils.py.

Variable Documentation

◆ debug

bool parselib.utils.debug = True

Definition at line 29 of file utils.py.