All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
prediction_event_notification_table.h
Go to the documentation of this file.
1 #ifndef PREDICTION_EVENT_NOTIFICATION_TABLE_H_INCLUDED_
2 #define PREDICTION_EVENT_NOTIFICATION_TABLE_H_INCLUDED_
3 
4 #include<string>
5 #include<utility>
6 #include<vector>
7 
8 #include "event_conflict_table.h"
9 #include "time.h"
10 
11 #include "segment_graph.h" // needed for VertexDescriptor
12 #include "mapped_variable.h" // needed for MappedVariable
13 
14 namespace risc {
15 
16 namespace sg {
17 
19 
20 public:
21 
32  PathInstanceMapper *path_instance_mapper,
33  bool t = true);
34 
40  int get_max_instances(int segment_id);
41 
48  std::pair<int, int> index_to_segment_and_instance_id(int index);
49 
55  int segment_and_instance_id_to_index(int segment_id, int instance_id);
56 
63 
69  void print_notification_table(std::string filename);
70 
77 
83  void print_instance_id_to_index_lookup_table(std::string filename);
84 
85 
87 
94 
101 
108 
114 
120 
125 
130 
138 private:
139 
140  struct Node {
143  int inst;
144 
146  vd(vd), t(t), inst(inst)
147  { }
148 
149  Node(const Node &ohs):
150  vd(ohs.vd), t(ohs.t), inst(ohs.inst)
151  { }
152  };
153 
154  typedef std::pair<VertexDescriptor, Time> SegmentTimeTuple;
155 
160  void bfs(VertexDescriptor start, int instance);
161 
167  void compute_combined_table();
168 
169 };
170 
171 } // end of namespace sg
172 
173 } // end of namespace risc
174 
175 #endif /* PREDICTION_EVENT_NOTIFICATION_TABLE_H_INCLUDED_ */
176 
177 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
std::pair< int, int > index_to_segment_and_instance_id(int index)
This function translates a given index from the conflict table into the corresponding segment id and ...
Definition: prediction_event_notification_table.cpp:691
VertexDescriptor vd
Definition: prediction_event_notification_table.h:141
int get_max_instances(int segment_id)
This functions returns how many instances of a given segment exist.
Definition: prediction_event_notification_table.cpp:713
PathInstanceMapper * path_instance_mapper_
Definition: prediction_event_notification_table.h:86
int inst
Definition: prediction_event_notification_table.h:143
boost::graph_traits< Graph >::vertex_descriptor VertexDescriptor
Definition: segment_graph.h:34
int size_of_conflict_table_
This variable defines the size of the conflict table. The size is quadratic.
Definition: prediction_event_notification_table.h:113
Node(VertexDescriptor vd, Time t, int inst)
Definition: prediction_event_notification_table.h:145
int ** instance_id_to_index_lookup_
This table should be used a lookup table: (segment id, instance id) -&gt; index of conflict table...
Definition: prediction_event_notification_table.h:119
void print_notification_table()
This function prints the prediction event notification table in the terminal.
Definition: prediction_event_notification_table.cpp:311
This class can be used as a lookup table between an instance id of a module or hierarchical channel a...
Definition: path_instance_mapper.h:13
PredictionEventNotificationTable(risc::sg::EventConflictTable &ect, PathInstanceMapper *path_instance_mapper, bool t=true)
Creates the combined data conflict table. The maximum number of steps will be calculated automaticall...
Definition: prediction_event_notification_table.cpp:22
The conflicts are stored in the base class variable conflict_table_. The columns represent wait state...
Definition: event_conflict_table.h:29
void compute_combined_table()
This function computes the combined table for &#39;prediction_steps_&#39; prediction steps.
Definition: prediction_event_notification_table.cpp:492
Node(const Node &ohs)
Definition: prediction_event_notification_table.h:149
This class represents timing in discrete event simulation.
Definition: time.h:14
std::pair< VertexDescriptor, Time > SegmentTimeTuple
Definition: prediction_event_notification_table.h:154
void print_instance_id_to_index_lookup_table()
This function prints the table instance_id_to_index_lookup_ table in the terminal.
Definition: prediction_event_notification_table.cpp:737
risc::sg::EventConflictTable & ect_
Refers to the real event conflict table.
Definition: prediction_event_notification_table.h:129
Time t
Definition: prediction_event_notification_table.h:142
Definition: prediction_event_notification_table.h:140
int number_of_segments_
This variable defines how many segments exist in the segment graph. Also, this is the number of colum...
Definition: prediction_event_notification_table.h:107
int segment_and_instance_id_to_index(int segment_id, int instance_id)
This function translates a given segment id and instance id to a index of the conflict table...
Definition: prediction_event_notification_table.cpp:670
Time ** combined_table_
The prediction event notification table.
Definition: prediction_event_notification_table.h:124
Definition: prediction_event_notification_table.h:18
int max_instances_
This variable represents the max number of module instances in the design. Also, this is the number o...
Definition: prediction_event_notification_table.h:100
bool consider_indirect_
Whether or not the predicition considers indirect notification: seg1 notifies seg2, seg2 then notifies seg3. If false, this not considered in prediction. Default is true.
Definition: prediction_event_notification_table.h:137
void bfs(VertexDescriptor start, int instance)
Definition: prediction_event_notification_table.cpp:389
VertexDescriptor * vertex_lookup_
This lookup table translates segment ids into vertex descriptors. At position i is the segment with t...
Definition: prediction_event_notification_table.h:93