This class represents a definition of a module. More...
#include <module.h>
Public Member Functions | |
Module (SgClassDefinition *ast_node) | |
Creates an empty module definition. All the lists of instances and sub definitions are empty. | |
~Module () | |
void | initialize_variables () |
This function searches for all variable declarations in the module definition. The corresponding variable vectors will be used. | |
void | initialize_functions () |
This function searches for all functions, SC_THREADS, SC_CTHREADS, and SC_METHODS in the module definition. The corresponding variable vectors will be used. | |
void | print_module_definition () |
Prints the complete module design into the terminal. | |
void | print_hierarchy (unsigned indent_level=0) |
Prints the hierarchy. Roots is this definiton. | |
Event * | find_event (SgVariableDefinition *var_def) |
Find an event by it's ast variable definition. | |
SgClassDefinition * | get_ast_node () |
Returns the ast definition of the class. | |
std::string | get_name () |
returns the name of the module definition | |
virtual std::string | get_ast_type_name () |
Returns the name of the module type. | |
virtual SgType * | get_ast_type () |
Returns the type of the ast node. | |
bool | has_source_location () |
Determines if a ast node has an associated ast node. | |
std::string | get_file_name () |
Get the name of the file where the declaration is located. | |
int | get_line_number () |
Get the line number of the instance. | |
int | get_position_in_line () |
Get the position of the in declaration in the corresponding line In other words the column in the line. | |
Public Attributes | |
VariableVector | variables_ |
Vector of C++ builtin variables that are declared in the module. | |
ModuleVector | sub_modules_defs_ |
Vector of module definitions which are defined in this module. | |
ModuleInstanceVector | sub_modules_ |
Vector of module definitions which are defined in this module. | |
PrimitiveChannelInstanceVector | sub_prim_channel_ |
Vector of primimitive channel instances which are declared in this module. | |
HierarchicalChannelInstanceVector | sub_hier_channel_ |
Vector of hierarchical channel instances which are declared in this module. | |
PrimitiveChannelVector | sub_prim_channel_defs_ |
Vector of primitive channel definitions. Technically, this represents a nested C++ class definition. In a good design this vector should be empty. | |
HierarchicalChannelVector | sub_hier_channel_defs_ |
Vector of hierarchical channel definitions. Technically, this represents a nested C++ class definition. In a good design this vector should be empty. | |
ThreadVector | threads_ |
Vector of threads which are defined in this module. | |
CThreadVector | cthreads_ |
Vector of cthreads which are defined in this module. | |
MethodVector | methods_ |
Vector of methods which are defined in this module. | |
FunctionVector | functions_ |
Vector of functions which are defined in this module. | |
InPortVector | inports_ |
Vector of inports which are defined in this module. | |
InOutPortVector | inoutports_ |
Vector of inoutports which are defined in this module. | |
OutPortVector | outports_ |
Vector of outports which are defined in this module. | |
EventVector | events_ |
Vector of events which are defined in this module. | |
SgNode * | ast_node_ |
SgType * | ast_type_pointer_ |
Private Member Functions | |
Module (const Module &md) | |
Disabled copy constructor. |
This class represents a definition of a module.
A module is defined by the assembling of modules, channels, ports, processes, and others.
risc::Module::Module | ( | SgClassDefinition * | ast_node | ) | [explicit] |
Creates an empty module definition. All the lists of instances and sub definitions are empty.
Default constructor
risc::Module::~Module | ( | ) |
risc::Module::Module | ( | const Module & | md | ) | [private] |
Disabled copy constructor.
risc::Event * risc::Module::find_event | ( | SgVariableDefinition * | var_def | ) |
Find an event by it's ast variable definition.
SgClassDefinition * risc::Class::get_ast_node | ( | ) | [virtual, inherited] |
Returns the ast definition of the class.
Reimplemented from risc::Definition.
SgType * risc::Definition::get_ast_type | ( | ) | [virtual, inherited] |
Returns the type of the ast node.
std::string risc::Class::get_ast_type_name | ( | ) | [virtual, inherited] |
Returns the name of the module type.
Reimplemented from risc::Definition.
std::string risc::Definition::get_file_name | ( | ) | [inherited] |
Get the name of the file where the declaration is located.
int risc::Definition::get_line_number | ( | ) | [inherited] |
Get the line number of the instance.
std::string risc::Class::get_name | ( | ) | [virtual, inherited] |
returns the name of the module definition
Reimplemented from risc::Definition.
int risc::Definition::get_position_in_line | ( | ) | [inherited] |
Get the position of the in declaration in the corresponding line In other words the column in the line.
bool risc::Definition::has_source_location | ( | ) | [inherited] |
Determines if a ast node has an associated ast node.
void risc::Module::initialize_functions | ( | ) |
This function searches for all functions, SC_THREADS, SC_CTHREADS, and SC_METHODS in the module definition. The corresponding variable vectors will be used.
void risc::Module::initialize_variables | ( | ) |
This function searches for all variable declarations in the module definition. The corresponding variable vectors will be used.
void risc::Module::print_hierarchy | ( | unsigned | indent_level = 0 |
) |
Prints the hierarchy. Roots is this definiton.
void risc::Module::print_module_definition | ( | ) |
Prints the complete module design into the terminal.
SgNode* risc::Definition::ast_node_ [inherited] |
SgType* risc::Definition::ast_type_pointer_ [inherited] |
Vector of cthreads which are defined in this module.
Vector of events which are defined in this module.
Vector of functions which are defined in this module.
Vector of inoutports which are defined in this module.
Vector of inports which are defined in this module.
Vector of methods which are defined in this module.
Vector of outports which are defined in this module.
Vector of hierarchical channel instances which are declared in this module.
Vector of hierarchical channel definitions. Technically, this represents a nested C++ class definition. In a good design this vector should be empty.
Vector of module definitions which are defined in this module.
Vector of module definitions which are defined in this module.
Vector of primimitive channel instances which are declared in this module.
Vector of primitive channel definitions. Technically, this represents a nested C++ class definition. In a good design this vector should be empty.
Vector of threads which are defined in this module.
Vector of C++ builtin variables that are declared in the module.