#include <segment.h>
Public Types | |
enum | ERead { NonRead = 0, Read = 1 } |
enum | EWrite { NonWrite = 0, Write = 1 } |
enum | Status { Untouched = 0, Touched = 1 } |
typedef std::list< NodeWithPath > | Expressions |
Public Member Functions | |
Segment (SgNode *boundary_node, bool inlined_segment, int psg_id=0, bool is_fake_segment_=false, bool is_simulation_process=false) | |
Constructor for segment. More... | |
Segment (const Segment &other) | |
void | analyze_segment () |
This function determines which variable are read and written in this segment. More... | |
void | analyze_expression (SgNode *expression, ERead read, EWrite write, PortCallPath pcp) |
This function analyzes recursively all read and write accesses in this expression. More... | |
void | add_expression (NodeWithPath nwp) |
This function add the given node to the vector of expressions. More... | |
bool | operator== (const Segment &other) |
If two segments are equal the return value is true. More... | |
void | merge (const Segment &other) |
Time | get_min_waiting_time () |
This function determines the minimal waiting time for this segment. More... | |
Public Attributes | |
bool | is_b_transport_seg_ |
TLM2 attribute marks if a segment is in a b_transport function. More... | |
SgFunctionDeclaration * | b_transport_func_ |
TLM2 attribute the function that this segment belongs to. More... | |
SgFunctionCallExp * | b_transport_ |
TLM2 attribute the b_transport call that this segment contains. More... | |
bool | is_fake_segment_ |
PSG_NODE attribute marks if a node is fake, not a true segment node and will be merged. More... | |
bool | is_sc_fifo_port_call_ |
PSG_NODE attribute marks if a node is port call for sc_fifo. if it is, then during instrumentation, we put the instrumented port id into the port call instead of in front of it. More... | |
bool | is_simulation_process_ |
PSG_NODE attribute marks if a node is for a simulation process currently, it applies only to the first psg node, because ZC thinks it is sufficient. More... | |
int | segment_node_id_ |
PSG_NODE attribute each segment node in a psg has a unique contiuous id it is used for instrumentation, and also calculating the wait_offset_ <psg_id_, segment_node_id_> pair matches a segment id in the complete segment graph. More... | |
std::string | function_name_entrance_ |
PSG_NODE attribute the qualified name of function that this node is entrance to. More... | |
std::string | function_name_exit_ |
PSG_NODE attribute the qualified name of function that this node is exit of. More... | |
std::string | module_name_ |
PSG_NODE attribute the qualified name of module that this node belongs to it is not empty only if the function of the node is a simulation process. currently, it applies only to the first psg node, because ZC thinks it is sufficient. More... | |
std::string | non_defining_function_call_name_ |
PSG_NODE attribute if the node is partial function call node, this attribute stores the qualified name of the non-defining function call. More... | |
std::string | pcp_port_name_ |
PSG_NODE attribute if the node is partial function call node, and the non-defining function call in the node is a port call, this attributes stores the qualified name of the port. when psg is loaded, we can get the definition of the port, and reconstruct the pcp for the variables that are used to replace the node. More... | |
SgNode * | pcp_port_ |
PSG_NODE attribute reconstructed when a partial function call node is loaded back, using the stored pcp_port_name_. when used, should be converted to sgVariableDefinition. More... | |
bool | is_entrance_to_channel_method_ |
PSG_NODE attribute If a function is a channel method (implemented in sc_channel) Then is_entrance_to_channel_method_ is set to true for the first segment node of the function's psg. More... | |
SgFunctionCallExp * | port_call_func_exp_ |
PSG_NODE attribute if this node is a partial function call node, and the non defining function call is a port call, port_call_func_exp is the func call expression. during instrumentation, we put set_upcoming_seg_id in front. More... | |
std::string | unique_port_call_name_ |
PSG_NODE attribute the variable name of the channel segment array. After instrumentation, it looks like this: set_upcoming_seg_id(risc_tmp_"unique_port_call_name_"+wait_offset_) extern int risc_tmp_"unique_port_call_name_"[] stored in psg file, loaded back and reconstructed in partial func call nodes this makes the instrumented names in both port call file and top file same. More... | |
std::string | channel_seg_ids_array_name_ |
PSG_NODE attribute After integration, we use this attribute to identify in which channel segment id array will the nodes's id be instrumented. More... | |
int | psg_id_ |
PSG_NODE attribute id of the psg that this node belongs to. More... | |
int | node_id_ |
PSG_NODE attribute id of node, continuous. More... | |
bool | is_redacted_ |
PSG_NODE attribute if a node is removed in the psg file by the provider, when loaded back, we generate an empty node to represent the redacted node. when is_redacted_ is true, the node will not be removed from graph_ in remove_dangling_segments(). initially false. More... | |
boost::default_color_type | color |
Status | color_for_communication_graph_ |
Status | helper_for_graph_algorithms_ |
Expressions | expressions_ |
bool | debugging_ |
bool | inlined_segment_ |
if this segemnt should be merged into others More... | |
bool | is_channel_segment_ |
if this segemnt belongs to a channel function More... | |
int | wait_offset_ |
used in instrumentation More... | |
std::set< Conflict > | conflicts_ |
the conflicts in this segment More... | |
PortCallPath | pcp_ |
To identify segments which belong to segments. More... | |
int | id_ |
This is the unique id of the segment. More... | |
SgNode * | boundary_node_ |
This is the associated boundary of the segment. More... | |
Thread * | originating_thread_ |
If known, this is the originating thread of the segment. If not known, this is NULL. If multiple threads reach here, this is -1. TODO: extend for all SystemC processes (RD, 07/11/18) More... | |
boost::default_color_type | color_ |
This color is used for some boost algorithms. More... | |
std::set< SymbolWithPath > | read_variables_ |
Set of all SgVariableSymbol which are read in this segment. More... | |
std::set< SymbolWithPath > | write_variables_ |
Set of all SgVariableSymbol which are written in this segment. More... | |
std::set< SymbolWithPath > | wait_events_ |
List of all gathered events this segment is waiting for TODO: this should be computed separately, not as side-effect of risc::sg::EventConflictTable::determine_conflict_table() (RD, 07/12/18) More... | |
std::set< SymbolWithPath > | notify_events_ |
List of all gathered events this segment is notifying TODO: this should be computed separately, not as side-effect of risc::sg::EventConflictTable::determine_conflict_table() (RD, 07/12/18) More... | |
bool | calls_conflict_function_ |
This segment calls a function with is marked as conflict. More... | |
bool | deref_pointer_read_ |
If this segment has a pointer read. More... | |
bool | deref_pointer_write_ |
If this segment has a pointer write. More... | |
bool | contains_sc_stop_ |
If this segment has an sc_stop, then in conflict with every segment. More... | |
bool | waits_for_time_ |
If this segment waits for time. More... | |
Static Public Attributes | |
static int | node_counter = 0 |
PSG_NODE attribute a static counter that counts the current id of current node. More... | |
static int | id_counter = 0 |
This static counter will be used to generate id's for the individual segments. More... | |
Private Member Functions | |
bool | waits_for_time () |
This functions determines if a function waits for time The related flag waits_for_time_ will be set during construction. More... | |
void | generic_payload_analysis_helper (SgVariableSymbol *var_sym, bool is_write, PortCallPath pcp_of_var) |
This functions is an internal helper function It adds the mapped gp data to the read/write_variables. More... | |
Private Attributes | |
Time | min_waiting_time_ |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Segment &segment) |
typedef std::list<NodeWithPath> risc::sg::Segment::Expressions |
risc::sg::Segment::Segment | ( | SgNode * | boundary_node, |
bool | inlined_segment, | ||
int | psg_id = 0 , |
||
bool | is_fake_segment_ = false , |
||
bool | is_simulation_process = false |
||
) |
Constructor for segment.
risc::sg::Segment::Segment | ( | const Segment & | other | ) |
risc::sg::Segment::add_expression | ( | NodeWithPath | nwp | ) |
This function add the given node to the vector of expressions.
risc::sg::Segment::analyze_expression | ( | SgNode * | expression, |
ERead | read, | ||
EWrite | write, | ||
PortCallPath | pcp | ||
) |
This function analyzes recursively all read and write accesses in this expression.
risc::sg::Segment::analyze_segment | ( | ) |
This function determines which variable are read and written in this segment.
|
private |
This functions is an internal helper function It adds the mapped gp data to the read/write_variables.
risc::sg::Segment::get_min_waiting_time | ( | ) |
This function determines the minimal waiting time for this segment.
void risc::sg::Segment::merge | ( | const Segment & | other | ) |
risc::sg::Segment::operator== | ( | const Segment & | other | ) |
If two segments are equal the return value is true.
|
private |
This functions determines if a function waits for time The related flag waits_for_time_ will be set during construction.
|
friend |
SgFunctionCallExp* risc::sg::Segment::b_transport_ |
TLM2 attribute the b_transport call that this segment contains.
SgFunctionDeclaration* risc::sg::Segment::b_transport_func_ |
TLM2 attribute the function that this segment belongs to.
SgNode* risc::sg::Segment::boundary_node_ |
This is the associated boundary of the segment.
bool risc::sg::Segment::calls_conflict_function_ |
This segment calls a function with is marked as conflict.
std::string risc::sg::Segment::channel_seg_ids_array_name_ |
PSG_NODE attribute After integration, we use this attribute to identify in which channel segment id array will the nodes's id be instrumented.
boost::default_color_type risc::sg::Segment::color |
boost::default_color_type risc::sg::Segment::color_ |
This color is used for some boost algorithms.
Status risc::sg::Segment::color_for_communication_graph_ |
std::set<Conflict> risc::sg::Segment::conflicts_ |
the conflicts in this segment
bool risc::sg::Segment::contains_sc_stop_ |
If this segment has an sc_stop, then in conflict with every segment.
bool risc::sg::Segment::debugging_ |
bool risc::sg::Segment::deref_pointer_read_ |
If this segment has a pointer read.
bool risc::sg::Segment::deref_pointer_write_ |
If this segment has a pointer write.
Expressions risc::sg::Segment::expressions_ |
std::string risc::sg::Segment::function_name_entrance_ |
PSG_NODE attribute the qualified name of function that this node is entrance to.
std::string risc::sg::Segment::function_name_exit_ |
PSG_NODE attribute the qualified name of function that this node is exit of.
Status risc::sg::Segment::helper_for_graph_algorithms_ |
int risc::sg::Segment::id_ |
This is the unique id of the segment.
|
static |
This static counter will be used to generate id's for the individual segments.
bool risc::sg::Segment::inlined_segment_ |
if this segemnt should be merged into others
bool risc::sg::Segment::is_b_transport_seg_ |
TLM2 attribute marks if a segment is in a b_transport function.
bool risc::sg::Segment::is_channel_segment_ |
if this segemnt belongs to a channel function
bool risc::sg::Segment::is_entrance_to_channel_method_ |
PSG_NODE attribute If a function is a channel method (implemented in sc_channel) Then is_entrance_to_channel_method_ is set to true for the first segment node of the function's psg.
bool risc::sg::Segment::is_fake_segment_ |
PSG_NODE attribute marks if a node is fake, not a true segment node and will be merged.
bool risc::sg::Segment::is_redacted_ |
PSG_NODE attribute if a node is removed in the psg file by the provider, when loaded back, we generate an empty node to represent the redacted node. when is_redacted_ is true, the node will not be removed from graph_ in remove_dangling_segments(). initially false.
bool risc::sg::Segment::is_sc_fifo_port_call_ |
PSG_NODE attribute marks if a node is port call for sc_fifo. if it is, then during instrumentation, we put the instrumented port id into the port call instead of in front of it.
bool risc::sg::Segment::is_simulation_process_ |
PSG_NODE attribute marks if a node is for a simulation process currently, it applies only to the first psg node, because ZC thinks it is sufficient.
|
private |
std::string risc::sg::Segment::module_name_ |
PSG_NODE attribute the qualified name of module that this node belongs to it is not empty only if the function of the node is a simulation process. currently, it applies only to the first psg node, because ZC thinks it is sufficient.
|
static |
PSG_NODE attribute a static counter that counts the current id of current node.
int risc::sg::Segment::node_id_ |
PSG_NODE attribute id of node, continuous.
std::string risc::sg::Segment::non_defining_function_call_name_ |
PSG_NODE attribute if the node is partial function call node, this attribute stores the qualified name of the non-defining function call.
std::set<SymbolWithPath> risc::sg::Segment::notify_events_ |
List of all gathered events this segment is notifying TODO: this should be computed separately, not as side-effect of risc::sg::EventConflictTable::determine_conflict_table() (RD, 07/12/18)
Thread* risc::sg::Segment::originating_thread_ |
If known, this is the originating thread of the segment. If not known, this is NULL. If multiple threads reach here, this is -1. TODO: extend for all SystemC processes (RD, 07/11/18)
PortCallPath risc::sg::Segment::pcp_ |
To identify segments which belong to segments.
SgNode* risc::sg::Segment::pcp_port_ |
PSG_NODE attribute reconstructed when a partial function call node is loaded back, using the stored pcp_port_name_. when used, should be converted to sgVariableDefinition.
std::string risc::sg::Segment::pcp_port_name_ |
PSG_NODE attribute if the node is partial function call node, and the non-defining function call in the node is a port call, this attributes stores the qualified name of the port. when psg is loaded, we can get the definition of the port, and reconstruct the pcp for the variables that are used to replace the node.
SgFunctionCallExp* risc::sg::Segment::port_call_func_exp_ |
PSG_NODE attribute if this node is a partial function call node, and the non defining function call is a port call, port_call_func_exp is the func call expression. during instrumentation, we put set_upcoming_seg_id in front.
int risc::sg::Segment::psg_id_ |
PSG_NODE attribute id of the psg that this node belongs to.
std::set<SymbolWithPath> risc::sg::Segment::read_variables_ |
Set of all SgVariableSymbol which are read in this segment.
int risc::sg::Segment::segment_node_id_ |
PSG_NODE attribute each segment node in a psg has a unique contiuous id it is used for instrumentation, and also calculating the wait_offset_ <psg_id_, segment_node_id_> pair matches a segment id in the complete segment graph.
std::string risc::sg::Segment::unique_port_call_name_ |
PSG_NODE attribute the variable name of the channel segment array. After instrumentation, it looks like this: set_upcoming_seg_id(risc_tmp_"unique_port_call_name_"+wait_offset_) extern int risc_tmp_"unique_port_call_name_"[] stored in psg file, loaded back and reconstructed in partial func call nodes this makes the instrumented names in both port call file and top file same.
std::set<SymbolWithPath> risc::sg::Segment::wait_events_ |
List of all gathered events this segment is waiting for TODO: this should be computed separately, not as side-effect of risc::sg::EventConflictTable::determine_conflict_table() (RD, 07/12/18)
int risc::sg::Segment::wait_offset_ |
used in instrumentation
bool risc::sg::Segment::waits_for_time_ |
If this segment waits for time.
std::set<SymbolWithPath> risc::sg::Segment::write_variables_ |
Set of all SgVariableSymbol which are written in this segment.