risc::Module Class Reference

This class represents instances. More...

#include <module.h>

Inheritance diagram for risc::Module:
Inheritance graph
[legend]
Collaboration diagram for risc::Module:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Type {
  CThreadType, ChannelType, ChannelInstanceType, ClassType,
  DefinitionType, EventType, FunctionType, HierarchicalChannelType,
  HierarchicalChannelInstanceType, InOutPortType, InPortType, InstanceType,
  InterfaceType, MethodType, ModuleType, ModuleInstanceType,
  ObjectType, OutPortType, PortType, PrimitiveChannelType,
  PrimitiveChannelInstanceType, ThreadType, VariableType
}
 

We are using these enums to identify type type of and instance or definition during traversal.

More...

Public Member Functions

 Module (SgClassDefinition *ast_node)
 Creates an empty module definition. All the lists of instances and sub definitions are empty.
 Module (SgClassDefinition *ast_node, Type type)
 This constructor will be used for derived classes from sc_module Currently, this is only sc_channel.
 ~Module ()
virtual 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 definition.
std::string get_mangled_type_name ()
 This function returns the manged type name of the module.
void initialize_variables ()
 This function searches for all variable declarations in the module definition. The corresponding variable vectors will be used.
SgFunctionDefinition * get_before_end_of_elaboration_definition ()
 This function return a pointer to the definition of the function before_end_of_elaboration.
Variablefind_variable (SgVariableDefinition *var_def)
 Find a port by it's ast variable definition.
Portfind_port (SgVariableDefinition *var_def)
 Find a port by it's ast variable definition.
Eventfind_event (SgVariableDefinition *var_def)
 Find an event by it's ast variable definition.
EventAndListfind_event_and_list (SgVariableDefinition *var_def)
 Find an event by it's ast variable definition.
EventOrListfind_event_or_list (SgVariableDefinition *var_def)
 Find an event by it's ast variable definition.
ModuleInstancefind_module (SgVariableDefinition *var_def)
 Find an module by it's ast variable definition.
PrimitiveChannelInstancefind_prim_channel (SgVariableDefinition *var_def)
 find a prim channel by it's ast variable definition
HierarchicalChannelInstancefind_hier_channel (SgVariableDefinition *var_def)
 find a hier channel by it's ast variable definition
Instancefind_instance (SgVariableDefinition *var_def)
 find a hier channel/module/ prim channel 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.
void initialize_mapping ()
 This function analyzes the mapping between a module/channel definition and its children.
void analyze_port_mapping (Module *parent_module, ModuleInstance *sub_module_instance, Port *port)
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

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.
ResetSignalVector reset_signals_
 Vector of reset signals which are registered in this module.
ResetSignalVector async_reset_signals_
 Vector of async reset signals which are registered in this module.
int instance_counter_
 This variable counts how many instances of this given type exists in the design.
std::list< Instance * > instances_
EventVector events_
 Vector of events which are defined in this module.
EventAndListVector event_and_lists_
 Vector of event and lists which are defined in this module.
EventOrListVector event_or_lists_
 Vector of event or lists which are defined in this module.
VariableVector variables_
 Vector of C++ builtin variables that are declared in the 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.
PrimitiveChannelInstanceVector sub_prim_channel_
 Vector of primitive channel instances which are declared in this module.
HierarchicalChannelInstanceVector sub_hier_channel_
 Vector of hierarchical channel instances which are declared in this module.
ModuleInstanceVector sub_modules_
 Vector of module instances which are declared in this module.
FunctionVector functions_
 Vector of functions which are defined in this module.
Type type_
SgNode * ast_node_
SgType * ast_type_pointer_

Private Member Functions

 Module (const Module &md)
 Disabled copy constructor.

Detailed Description

This class represents instances.

This class represents a definition of a module.

A module is defined by the assembling of modules, channels, ports, processes, and others.


Member Enumeration Documentation

enum risc::Definition::Type [inherited]

We are using these enums to identify type type of and instance or definition during traversal.

Enumerator:
CThreadType 
ChannelType 
ChannelInstanceType 
ClassType 
DefinitionType 
EventType 
FunctionType 
HierarchicalChannelType 
HierarchicalChannelInstanceType 
InOutPortType 
InPortType 
InstanceType 
InterfaceType 
MethodType 
ModuleType 
ModuleInstanceType 
ObjectType 
OutPortType 
PortType 
PrimitiveChannelType 
PrimitiveChannelInstanceType 
ThreadType 
VariableType 

Constructor & Destructor Documentation

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 ( SgClassDefinition *  ast_node,
Type  type 
) [explicit]

This constructor will be used for derived classes from sc_module Currently, this is only sc_channel.

Default constructor

risc::Module::~Module (  ) 
risc::Module::Module ( const Module md  )  [private]

Disabled copy constructor.


Member Function Documentation

void risc::Class::analyze_port_mapping ( Module parent_module,
ModuleInstance sub_module_instance,
Port port 
) [inherited]
risc::Event * risc::Class::find_event ( SgVariableDefinition *  var_def  )  [inherited]

Find an event by it's ast variable definition.

risc::EventAndList * risc::Class::find_event_and_list ( SgVariableDefinition *  var_def  )  [inherited]

Find an event by it's ast variable definition.

risc::EventOrList * risc::Class::find_event_or_list ( SgVariableDefinition *  var_def  )  [inherited]

Find an event by it's ast variable definition.

risc::HierarchicalChannelInstance * risc::Class::find_hier_channel ( SgVariableDefinition *  var_def  )  [inherited]

find a hier channel by it's ast variable definition

risc::Instance * risc::Class::find_instance ( SgVariableDefinition *  var_def  )  [inherited]

find a hier channel/module/ prim channel by it's ast variable definition

risc::ModuleInstance * risc::Class::find_module ( SgVariableDefinition *  var_def  )  [inherited]

Find an module by it's ast variable definition.

risc::Port * risc::Class::find_port ( SgVariableDefinition *  var_def  )  [inherited]

Find a port by it's ast variable definition.

risc::PrimitiveChannelInstance * risc::Class::find_prim_channel ( SgVariableDefinition *  var_def  )  [inherited]

find a prim channel by it's ast variable definition

risc::Variable * risc::Class::find_variable ( SgVariableDefinition *  var_def  )  [inherited]

Find a port by it's ast variable definition.

SgClassDefinition * risc::Class::get_ast_node (  )  [virtual, inherited]

Returns the ast definition of the class.

Returns:
Pointer to the definition

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.

Returns:
name of the module instance

Reimplemented from risc::Definition.

Reimplemented in risc::Interface.

risc::Class::get_before_end_of_elaboration_definition (  )  [inherited]

This function return a pointer to the definition of the function before_end_of_elaboration.

std::string risc::Definition::get_file_name (  )  [inherited]

Get the name of the file where the declaration is located.

Returns:
filename
int risc::Definition::get_line_number (  )  [inherited]

Get the line number of the instance.

Returns:
line number
risc::Module::get_mangled_type_name (  ) 

This function returns the manged type name of the module.

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.

Returns:
position in line
bool risc::Definition::has_source_location (  )  [inherited]

Determines if a ast node has an associated ast node.

void risc::Module::initialize_functions (  )  [virtual]

This function searches for all functions, SC_THREADS, SC_CTHREADS, and SC_METHODS in the module definition. The corresponding variable vectors will be used.

Reimplemented from risc::Class.

risc::Class::initialize_mapping (  )  [inherited]

This function analyzes the mapping between a module/channel definition and its children.

void risc::Class::initialize_variables (  )  [inherited]

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 definition.

void risc::Module::print_module_definition (  ) 

Prints the complete module design into the terminal.


Member Data Documentation

SgNode* risc::Definition::ast_node_ [inherited]

Vector of async reset signals which are registered in this module.

Vector of cthreads which are defined in this module.

Vector of event and lists which are defined in this module.

Vector of event or lists 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.

This variable counts how many instances of this given type exists in the design.

Reimplemented in risc::HierarchicalChannel.

This container stores all instances of the module/hierachical channel instances

Vector of methods which are defined in this module.

Vector of outports which are defined in this module.

Vector of reset signals which are registered in this module.

Vector of hierarchical channel instances which are declared in this module.

Vector of module instances which are declared in this module.

Vector of primitive channel instances which are declared in this module.

Vector of threads which are defined in this module.

Vector of C++ builtin variables that are declared in the module.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Jul 2017 by  doxygen 1.6.1