23 #ifndef _PAR_EXEGRAPH_H_
24 #define _PAR_EXEGRAPH_H_
27 #include <elm/PreIterator.h>
28 #include <elm/string/StringBuffer.h>
250 virtual void build();
312 inline bool ended(
void)
const;
314 inline void next(
void);
323 inline bool ended(
void)
const;
325 inline void next(
void);
364 _buffer << stage->
name() <<
"(I" << inst->
index() <<
")";
429 #endif //_PAR_EXEGRAPH_H_
A simple iterator on the nodes contained in a graph.
Definition: Graph.h:138
int analyze()
Computes the cost, in cycles, of the current graph.
Definition: parexegraph_ParExeGraph.cpp:96
struct otawa::ParExeGraph::rename_table_t rename_table_t
void setDefaultLatency(int lat)
Definition: ParExeGraph.h:376
ParExeEdge * edge(void) const
Definition: ParExeGraph.h:424
struct otawa::sem::inst inst
Definition: ParExeGraph.h:320
Definition: GenGraph.h:38
int numInstructions()
Definition: ParExeGraph.h:247
void clearDelays()
Definition: parexegraph_ParExeGraph.cpp:404
N * source(void) const
Definition: GenGraph.h:67
This class represents a bank of registers.
Definition: Register.h:68
Exception thrown if there is an error during the build and the computation of.
Definition: ParExeGraph.h:45
edge_type_t _type
Definition: ParExeGraph.h:404
elm::String _name
Definition: ParExeGraph.h:405
ParExeNode * producer(int index)
Definition: ParExeGraph.h:381
int _default_latency
Definition: ParExeGraph.h:344
void addProducer(ParExeNode *prod)
Definition: ParExeGraph.h:379
Representation of a pipeline stage to be used to build a ParExeGraph.
Definition: ParExeProc.h:86
GenEdge(GenNode *source, GenNode *target)
Definition: GenGraph.h:66
void setHeaders(BasicBlock *h0, BasicBlock *h1=NULL)
Definition: ParExeGraph.h:195
Definition: ParExeGraph.h:402
void setDelay(int index, int value)
Definition: ParExeGraph.h:386
PreorderIterator(ParExeGraph *graph)
Definition: ParExeGraph.h:305
Predecessor(const ParExeNode *node)
Definition: ParExeGraph.h:311
NodeIterator(const ParExeInst *inst)
Definition: ParExeGraph.h:108
void setFetchNode(ParExeNode *node)
Definition: ParExeGraph.h:87
virtual void addEdgesForPipelineOrder(void)
Adds edges that represent the order of stages in the pipeline.
Definition: parexegraph_ParExeGraph.cpp:641
elm::genstruct::Vector< ParExeNode * > _producers
Definition: ParExeGraph.h:350
Definition: ParExeGraph.h:221
void addNode(ParExeNode *node)
Relates a node to an instruction in the sequence.
Definition: parexegraph_ParExeGraph.cpp:587
ParExeNode * firstNode()
Definition: ParExeGraph.h:85
GenGraph< ParExeNode, ParExeEdge >::InIterator iter
Definition: ParExeGraph.h:317
int _late_contenders
Definition: ParExeGraph.h:354
void restoreDefaultLatency(void)
Definition: ParExeGraph.h:377
void setLatency(int latency)
Definition: ParExeGraph.h:411
NodeLatency(ParExeNode *node, int latency)
Definition: ParExeGraph.h:147
Definition: ParExeGraph.h:297
BasicBlock * _bb
Definition: ParExeGraph.h:66
elm::genstruct::AllocatedTable< ParExeNode * > * table
Definition: ParExeGraph.h:223
void propagate()
Definition: parexegraph_ParExeGraph.cpp:415
elm::genstruct::AllocatedTable< int > * _delay
Definition: ParExeGraph.h:348
void display(elm::io::Output &output)
Definition: parexegraph_ParExeGraph.cpp:1259
BasicBlock * _header[2]
Definition: ParExeGraph.h:157
elm::genstruct::Vector< ParExeInst * > _producing_insts
Definition: ParExeGraph.h:74
Definition: ParExeGraph.h:402
int delta(ParExeNode *a, Resource *res)
This method is called to compute the delay of a given node compared to the last node of the prologue ...
Definition: parexegraph_ParExeGraph.cpp:153
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
int lateContenders(void)
Definition: ParExeGraph.h:388
ParExeStage * stage(void)
Definition: ParExeGraph.h:373
void setLatencies(TimingContext *tctxt)
Definition: parexegraph_ParExeGraph.cpp:454
ParExeSequence * _sequence
Definition: ParExeGraph.h:231
Représentation of a processor (to be used to build a ParExeGraph).
Definition: ParExeProc.h:195
int _branch_penalty
Definition: ParExeGraph.h:234
BasicBlock * header(int index)
Definition: ParExeGraph.h:199
ParExeNode * firstNode()
Definition: ParExeGraph.h:243
elm::String name(void)
Definition: ParExeProc.h:115
int index()
Definition: ParExeGraph.h:83
ParExeNode * firstFUNode()
Definition: ParExeGraph.h:93
StageIterator(const SLList< ParExeStage * > *list)
Definition: ParExeGraph.h:293
Definition: ParExeGraph.h:128
Inst * _inst
Definition: ParExeGraph.h:65
void setFirstFUNode(ParExeNode *node)
Definition: ParExeGraph.h:89
void next(void)
Definition: ParExeGraph.h:418
int _index
Definition: ParExeGraph.h:68
Inst * inst()
Definition: ParExeGraph.h:81
elm::genstruct::Vector< Resource * > _resources
Definition: ParExeGraph.h:225
code_part_t
Definition: ParExeGraph.h:50
dtd::Element bb(dtd::make("bb", _BB).attr(id).attr(address).attr(size))
elm::genstruct::Vector< ParExeNode * > _nodes
Definition: ParExeGraph.h:69
ParExeNode * _exec_node
Definition: ParExeGraph.h:71
ParExeNode * _last_fu_node
Definition: ParExeGraph.h:73
Definition: Resource.h:35
ParExeNode * node(int index)
Definition: ParExeGraph.h:86
ParExeNode * lastFUNode()
Definition: ParExeGraph.h:94
ParExeEdge(ParExeNode *source, ParExeNode *target, edge_type_t type, int latency=0, const string &name="")
Definition: ParExeGraph.h:408
virtual void addEdgesForFetch(void)
Add edges for fetch timing, that is edges ensuring that instruction in the same block are fetched in ...
Definition: parexegraph_ParExeGraph.cpp:669
Definition: ParExeGraph.h:106
StringOption proc(command, 'p',"processor","used processor","path","")
An edge in a ParExeGraph.
Definition: ParExeGraph.h:400
elm::BitVector * possibleContenders(void)
Definition: ParExeGraph.h:390
Resource * resource(int index)
Definition: ParExeGraph.h:246
ProducingInstIterator(const ParExeInst *inst)
Definition: ParExeGraph.h:114
void dump(elm::io::Output &dotFile, const string &info="")
Definition: parexegraph_ParExeGraph.cpp:1025
ParExeEdge * edge(void) const
Definition: ParExeGraph.h:419
WorkSpace * _ws
Definition: ParExeGraph.h:218
GenNode(graph::Graph *graph=0)
Definition: GenGraph.h:47
void restoreDefaultLatencies()
Definition: parexegraph_ParExeGraph.cpp:438
elm::String name(void)
Definition: ParExeGraph.h:384
Base class of Otawa exceptions.
Definition: base.h:168
int numResources()
Definition: ParExeGraph.h:245
InstIterator(const ParExeSequence *sequence)
Definition: ParExeGraph.h:281
ParExeInst(Inst *inst, BasicBlock *bb, code_part_t part, int index)
Definition: ParExeGraph.h:77
Iterator(const DLList &_list)
InstIterator(const ParExeGraph *graph)
Definition: ParExeGraph.h:283
void analyzeContentions()
Definition: parexegraph_ParExeGraph.cpp:254
void initDelays()
Definition: parexegraph_ParExeGraph.cpp:332
inst cont(void)
Definition: inst.h:151
elm::genstruct::SLList< NodeLatency * > _node_latencies_list
Definition: ParExeGraph.h:156
virtual void build()
Definition: parexegraph_ParExeGraph.cpp:562
virtual ParExePipeline * pipeline(ParExeStage *stage, ParExeInst *inst)
Definition: parexegraph_ParExeGraph.cpp:577
Definition: ParExeGraph.h:291
Definition: ParExeGraph.h:303
virtual void addEdgesForProgramOrder(elm::genstruct::SLList< ParExeStage * > *list_of_stages=NULL)
Adds edges to reflect processing of instruction in the order of the program.
Definition: parexegraph_ParExeGraph.cpp:707
Definition: ParExeGraph.h:53
An iterator allowing to traverse the graph using preorder, that is, a node is only traversed when its...
Definition: PreorderIterator.h:31
A node of the ParExeGraph, that represents the crossing of an instruction inside a microprocessor sta...
Definition: ParExeGraph.h:339
CachePenalty::cache_penalty_type_t _type
Definition: ParExeGraph.h:158
Graph * graph(void) const
Get the container graph if any.
Definition: Graph.h:75
StageNodeIterator(const ParExeStage *stage)
Definition: ParExeGraph.h:299
int _latency
Definition: ParExeGraph.h:145
elm::genstruct::DLList< elm::BitVector * > * contendersMasksList()
Definition: ParExeGraph.h:383
elm::BitVector * _possible_contenders
Definition: ParExeGraph.h:352
int length()
Definition: ParExeGraph.h:133
Definition: ParExeGraph.h:169
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
Definition: ParExeGraph.h:279
ParExeNode * node()
Definition: ParExeGraph.h:148
ParExeNode * fetchNode()
Definition: ParExeGraph.h:91
void removeNode(ParExeNode *node)
Definition: ParExeGraph.h:100
code_part_t _part
Definition: ParExeGraph.h:67
int latency()
Definition: ParExeGraph.h:149
ParExeStage * _pipeline_stage
Definition: ParExeGraph.h:341
Definition: ParExeGraph.h:286
int _latency
Definition: ParExeGraph.h:406
edge_type_t
Definition: ParExeGraph.h:402
~TimingContext()
Definition: ParExeGraph.h:184
void setLatency(int latency)
Definition: ParExeGraph.h:378
ParExeSequence * getSequence(void) const
Definition: ParExeGraph.h:242
void setContender(int index)
Definition: ParExeGraph.h:391
ParExeNode * _first_node
Definition: ParExeGraph.h:227
hard::RegBank * reg_bank
Definition: ParExeGraph.h:222
void set(int index) const
void buildContendersMasks()
Definition: parexegraph_ParExeGraph.cpp:460
TimingContext(BasicBlock *h0, BasicBlock *h1=NULL)
Definition: ParExeGraph.h:164
TimingContext(TimingContext *ctxt)
Definition: ParExeGraph.h:175
int _cache_line_size
Definition: ParExeGraph.h:232
bool isEmpty()
Definition: ParExeGraph.h:193
ParExeGraph(WorkSpace *ws, ParExeProc *proc, elm::genstruct::Vector< Resource * > *hw_resources, ParExeSequence *seq, const PropList &props=PropList::EMPTY)
Build a parametric execution graph.
Definition: parexegraph_ParExeGraph.cpp:1217
virtual void createNodes(void)
Creates nodes in the graph: one node for each (instruction/pipeline_stage) pair.
Definition: parexegraph_ParExeGraph.cpp:603
const elm::string & name(void) const
Definition: ParExeGraph.h:413
A sequence of ParExeInstruction for which a ParExeGraph will be built.
Definition: ParExeGraph.h:125
elm::genstruct::Vector< ParExeNode * > _contenders
Definition: ParExeGraph.h:351
Representation of a pipeline (list of stages).
Definition: ParExeProc.h:157
NodeIterator(const ParExeStage *stage)
Definition: ParExeProc.h:145
ParExeNode * _fetch_node
Definition: ParExeGraph.h:70
ParExeException(string message)
Definition: ParExeGraph.h:47
Definition: ParExeGraph.h:52
ParExeNode * execNode()
Definition: ParExeGraph.h:92
void setExecNode(ParExeNode *node)
Definition: ParExeGraph.h:88
bool ended(void) const
Definition: ParExeGraph.h:421
int cost()
Definition: parexegraph_ParExeGraph.cpp:119
Definition: ParExeGraph.h:142
ParExeNode * _last_node
Definition: ParExeGraph.h:229
void setLastFUNode(ParExeNode *node)
Definition: ParExeGraph.h:90
if(!(yy_init))
Definition: ipet_lexer.cc:734
Definition: ParExeGraph.h:309
Iterator for the graph nodes related to the pipeline stage.
Definition: ParExeProc.h:143
ParExeNode * item(void) const
Definition: ParExeGraph.h:422
int latency()
Definition: ParExeGraph.h:375
Representation of a parametric execution graph (Parametric Execution Graph).
Definition: ParExeGraph.h:214
InstNodeIterator(const ParExeInst *inst)
Definition: ParExeGraph.h:288
Definition: ParExeGraph.h:112
bool ended(void) const
Definition: ParExeGraph.h:416
void createSequenceResources()
Definition: parexegraph_ParExeGraph.cpp:494
void setDefaultLatencies(TimingContext *tctxt)
Definition: parexegraph_ParExeGraph.cpp:446
void addNodeLatency(NodeLatency *nl)
Definition: ParExeGraph.h:191
This is the minimal definition of a basic block.
Definition: BasicBlock.h:43
virtual void findDataDependencies(void)
Compute for each first FU node which is the FU node producing the required data (and fill the produce...
Definition: parexegraph_ParExeGraph.cpp:800
void initContenders(int size)
Definition: ParExeGraph.h:387
int numProducers(void)
Definition: ParExeGraph.h:380
int _capacity
Definition: ParExeGraph.h:233
enum otawa::ParExeEdge::edge_type_t edge_type_t_t
BasicBlock * basicBlock()
Definition: ParExeGraph.h:96
GenGraph< ParExeNode, ParExeEdge >::OutIterator iter
Definition: ParExeGraph.h:328
elm::genstruct::DLList< elm::BitVector * > _contenders_masks_list
Definition: ParExeGraph.h:353
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
ParExeInst * _inst
Definition: ParExeGraph.h:342
virtual ~ParExeGraph(void)
Definition: parexegraph_ParExeGraph.cpp:933
int index(void) const
Definition: GenGraph.h:51
code_part_t codePart()
Definition: ParExeGraph.h:82
elm::String _name
Definition: ParExeGraph.h:345
Instruction as presented in the ParExeGraph.
Definition: ParExeGraph.h:63
void setIndex(int index)
Definition: ParExeGraph.h:84
This a list of properties.
Definition: PropList.h:63
void next(void)
Definition: ParExeGraph.h:423
N * target(void) const
Definition: GenGraph.h:68
ParExeInst * inst(void)
Definition: ParExeGraph.h:374
cache_penalty_type_t
Definition: CachePenalty.h:33
TimingContext()
Definition: ParExeGraph.h:160
virtual String message(void)
ParExeNode * _last_prologue_node
Definition: ParExeGraph.h:228
virtual void addEdgesForMemoryOrder(void)
Adds edges to represent contention to access memory, basically, between FUs of instructions performin...
Definition: parexegraph_ParExeGraph.cpp:746
PropList _props
Definition: ParExeGraph.h:219
int latency(void) const
Definition: ParExeGraph.h:410
Definition: ParExeGraph.h:54
friend class Graph
Definition: Graph.h:41
void addProducingInst(ParExeInst *inst)
Definition: ParExeGraph.h:95
ParExeNode(ParExeGraph *graph, ParExeStage *stage, ParExeInst *inst)
Definition: ParExeGraph.h:357
Iterator(const Vector &vec)
void setType(CachePenalty::cache_penalty_type_t type)
Definition: ParExeGraph.h:201
void findContendingNodes()
Definition: parexegraph_ParExeGraph.cpp:907
Definition: ParExeGraph.h:51
virtual void addEdgesForDataDependencies(void)
Adds edges for data dependencies, that is, if an instruction (a) produces content of a register and i...
Definition: parexegraph_ParExeGraph.cpp:866
Successor(const ParExeNode *node)
Definition: ParExeGraph.h:322
void addContender(ParExeNode *cont)
Definition: ParExeGraph.h:382
Definition: ParExeGraph.h:154
void deleteNodes()
Definition: ParExeGraph.h:101
CachePenalty::cache_penalty_type_t type()
Definition: ParExeGraph.h:203
int delay(int index)
Definition: ParExeGraph.h:385
void setLateContenders(int num)
Definition: ParExeGraph.h:389
ParExeProc * _microprocessor
Definition: ParExeGraph.h:220
ParExeNode * item(void) const
Definition: ParExeGraph.h:417
ParExeNode * _first_fu_node
Definition: ParExeGraph.h:72
InstIterator(const ParExeSequence *seq)
Definition: ParExeGraph.h:130
ParExeNode * _node
Definition: ParExeGraph.h:144
virtual void addEdgesForQueues(void)
Called to add edges representing contention on the different queues of the microprocessor.
Definition: parexegraph_ParExeGraph.cpp:888
edge_type_t type(void) const
Definition: ParExeGraph.h:412
NodeLatencyIterator(const TimingContext &tctxt)
Definition: ParExeGraph.h:171
int _latency
Definition: ParExeGraph.h:343