Otawa  0.10
ParamExeGraph.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * exegraph module implementation
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2008, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef _PARAM_EXEGRAPH_H_
24 #define _PARAM_EXEGRAPH_H_
25 
27 #include <otawa/util/Trace.h>
28 #include <elm/util/BitVector.h>
29 
30 namespace otawa {
31 
32 #define INFINITE_TIME 0x0FFFFFF
33 
34 class ParamExeNode;
35 
36 class ParamExeGraph : public ExeGraph<ParamExeNode> {
37  public:
38  typedef class ParamExeNode Node;
40  typedef struct input_t {
44  } input_t;
45  class Resource {
46  private:
49  int _index;
50  int _offset;
51  public:
53  : _name(name), _type(type), _index(index), _offset(offset) {}
54  inline elm::String name()
55  {return _name;}
57  {return _type;}
58  inline int index()
59  {return _index;}
60  inline int offset()
61  {return _offset;}
62  };
63  class StartResource : public Resource {
64  public:
66  :Resource(name,BLOCK_START, index, offset) {}
67  };
68  class StageResource : public Resource {
69  private:
71  int _slot;
72  public:
75  int slot,
76  int index,
77  int offset)
78  : Resource(name,STAGE, index, offset),
79  _stage(stage), _slot(slot) {}
81  {return _stage;}
82  inline int slot()
83  {return _slot;}
84  };
85  class FuResource : public Resource {
86  private:
88  int _slot;
89  public:
92  int slot,
93  int index,
94  int offset)
95  : Resource(name,FU,index, offset), _fu(fu), _slot(slot) {}
97  {return _fu;}
98  inline int slot()
99  {return _slot;}
100  };
101  class QueueResource : public Resource {
102  private:
104  int _slot;
107  public:
110  int slot,
111  int index,
112  int offset,
113  StageResource * upper_bound,
114  int upper_bound_offset)
115  : Resource(name,QUEUE, index, offset),
116  _queue(queue),
117  _slot(slot),
118  _upper_bound(upper_bound),
119  _upper_bound_offset(upper_bound_offset)
120  {}
122  {return _queue;}
123  inline int slot()
124  {return _slot;}
126  {return _upper_bound;}
128  {return _upper_bound_offset;}
129  };
130  class RegResource : public Resource {
131  private:
135  public:
137  otawa::hard::RegBank * reg_bank,
138  int reg_index,
139  int index,
140  int offset)
141  : Resource(name,REG, index, offset),
142  _reg_bank(reg_bank),
143  _reg_index(reg_index)
144  {}
146  {return _reg_bank;}
147  inline int regIndex()
148  {return _reg_index;}
150  if (! _using_instructions.contains(inst) )
151  _using_instructions.add(inst);
152  }
153  class UsingInstIterator : public elm::genstruct::Vector<ExeInst<ParamExeNode> *>::Iterator {
154  public:
156  : elm::genstruct::Vector<ExeInst<ParamExeNode> *>::Iterator(res->_using_instructions) {}
157  };
158  };
160  private:
162  public:
165  int index,
166  int offset)
167  : Resource(name,EXTERNAL_CONFLICT, index, offset),
168  _instruction(instruction)
169  {}
171  {return _instruction;}
172  };
174  private:
177  public:
180  int index,
181  int offset)
182  : Resource(name,INTERNAL_CONFLICT, index, offset),
183  _instruction(instruction)
184  {}
186  {return _instruction;}
188  {_node = node;}
190  {return _node;}
191 
192  };
193  private:
195 
196  protected:
203  int _latest_resource_index; // index of the resource that stands for the last pipeline stage
204  int _last_resource_index; // index of the last created resource
205  bool _has_pred;
210 
211  public:
212  ParamExeGraph(WorkSpace *fw, Microprocessor<ParamExeNode> * microprocessor, ExeSequence<ParamExeNode> *sequence, bool has_pred,
213  Trace *_trace);
214  virtual void propagate();
215  virtual void initDelays();
216  virtual int Delta(ParamExeNode *a, Resource *res);
217  virtual void analyzeContentions();
218  inline void clearTimesChanged()
219  {_times_changed = false ;}
220  inline void setTimesChanged()
221  {_times_changed = true;}
222  inline bool timesChanged()
223  {return _times_changed;}
224  void dump(elm::io::Output& dotFile);
225  void dumpSimple(elm::io::Output& dotFile);
226  inline int resourceCount()
227  {return _resources.length() + _internal_conflicts.length() + _external_conflicts.length();}
228  inline int instructionCount()
229  {return _sequence->length();}
230  int analyze();
231  virtual int cost();
233  {return _latest_resource_index;}
234  elm::String delayName(int delay);
235  class ResourceIterator : public elm::genstruct::Vector<Resource *>::Iterator {
236  public:
238  : elm::genstruct::Vector<Resource *>::Iterator(graph->_resources) {}
239  };
240  class InternalConflictIterator : public elm::genstruct::Vector<Resource *>::Iterator {
241  public:
243  : elm::genstruct::Vector<Resource *>::Iterator(graph->_internal_conflicts) {}
244  };
245  class ExternalConflictIterator : public elm::genstruct::Vector<Resource *>::Iterator {
246  public:
248  : elm::genstruct::Vector<Resource *>::Iterator(graph->_external_conflicts) {}
249  };
250 };
251 
252 
253  class ParamExeNode : public ExeGraph<ParamExeNode>::ExeNode {
254  private:
257  //elm::genstruct::AllocatedTable<bool> * _e;
269 
270  public:
273  {return &_contenders_masks_list;}
275  {return _possible_contenders;}
276  inline int lateContenders()
277  {return _late_contenders;}
278  inline void setLateContenders(int num)
279  {_late_contenders = num;}
280  inline void initContenders(int size)
281  {_possible_contenders = new BitVector(size);}
282  inline bool isContender(int index)
283  {return(_possible_contenders[index]);}
284  inline void setContender(int index)
285  {_possible_contenders->set(index);}
286  inline int contendersNumber()
287  {return(_possible_contenders->countBits());}
288  void buildContendersMasks();
290  {_contenders_list.addLast(conflict);}
292  {return &_contenders_list;}
293  inline void setStageNumber(int number)
294  {_stage_number = number;}
295  inline int stageNumber()
296  {return _stage_number;}
297  inline bool hasContenders()
298  {return (_contenders.length() != 0);}
300  {return (*_d[bound])[index];}
301  inline int d(int index)
302  {return (*_d[ExeGraph<ParamExeNode>::MIN])[index];}
303  inline bool e(int index)
304  {/*return (*_e)[index];*/
305  return ((*_d[ExeGraph<ParamExeNode>::MIN])[index]>=0);}
306  inline void setD(int index, int value, ExeGraph<ParamExeNode>::time_bound_t bound)
307  {(*_d[bound])[index] = value;}
308  inline void setD(int index, int value)
309  {(*_d[ExeGraph<ParamExeNode>::MIN])[index] = value;}
310  inline void setE(int index, bool value)
311  { /*(*_e)[index] = value;*/
312  if (value) {
313  if ((*_d[ExeGraph<ParamExeNode>::MIN])[index]<0) {
314  (*_d[ExeGraph<ParamExeNode>::MIN])[index] = 0;
315  }
316  }
317  else
319  }
320  inline int maxContentionDelay()
321  {return _max_contention_delay;}
322  inline void setMaxContentionDelay(int value)
323  {_max_contention_delay = value;}
324  inline int minContentionDelay()
325  {return _min_contention_delay;}
326  inline void setMinContentionDelay(int value)
327  {_min_contention_delay = value;}
329  {return (*_delay[bound])[index];}
330  inline bool contentionDep(int index)
331  {return (*_contention_dep)[index];}
333  {return _internal_delay[bound];}
335  {return _contention_delay[bound];}
337  if ( (*_delay[bound])[index] != delay ) {
338  (*_delay[bound])[index] = delay;
340  }
341  }
342  inline void setContentionDep(int index) {
343  (*_contention_dep)[index] = true;
344 
345  }
347  if ( _internal_delay[bound] != delay ) {
348  _internal_delay[bound] = delay;
350  }
351  }
353  if ( _contention_delay[bound] != delay ) {
354  _contention_delay[bound] = delay;
356  }
357  }
358 
359 
360 
361 };
362 
363 
365  ExeGraph<ParamExeNode> *graph,
368  : ExeNode(graph, stage, inst), _graph((ParamExeGraph *)graph) {
371  // _round = 1;
372  for (int j=0 ; j<ExeGraph<ParamExeNode>::BOUNDS ; j++) {
374  for (int k=0 ; k<_graph->resourceCount() ; k++) {
375  (*_delay[j])[k] = -INFINITE_TIME;
376  }
377  _internal_delay[j] = 0;
378 
379  }
380  for (int j=0 ; j<ExeGraph<ParamExeNode>::BOUNDS ; j++) {
382  }
383  //_e = new elm::genstruct::AllocatedTable<bool>(_graph->resourceCount());
384  for (int k=0 ; k<_graph->resourceCount() ; k++) {
385  for (int j=0 ; j<ExeGraph<ParamExeNode>::BOUNDS ; j++)
386  (*_d[j])[k] = /*0*/-1;
387  //(*_e)[k] = false;
388  }
390  for (int k=0 ; k<_graph->instructionCount() ; k++) {
391  (*_contention_dep)[k] = false;
392  }
393 
397  else
399  }
400 
401 
402 
403 
405  WorkSpace *fw,
406  Microprocessor<ParamExeNode> * microprocessor,
407  ExeSequence<ParamExeNode> *sequence,
408  bool has_pred,
409  Trace *trace)
411  _trace = trace;
412 
413  int resource_index = 0;
414  _has_pred = has_pred;
415  _sequence = sequence;
416  {
417  StringBuffer buffer;
418  buffer << "start";
419  StartResource * new_resource = new StartResource(buffer.toString(), resource_index++, 0);
420  _resources.add(new_resource);
421  }
422 
423  int _last_stage_index = 0;
424  int _operand_producing_stage_index;
425  for (PipelineIterator stage(microprocessor) ; stage ; stage++) {
426  if (stage == microprocessor->operandProducingStage())
427  _operand_producing_stage_index = _last_stage_index;
428  _last_stage_index++;
429  }
430  _last_stage_index--;
431  int _stage_index = 0;
432  for (PipelineIterator stage(microprocessor) ; stage ; stage++) {
433  if (! stage->usesFunctionalUnits()) {
434 
435  for (int i=0 ; i<stage->width() ; i++) {
436  StringBuffer buffer;
437  buffer << stage->name() << "[" << i << "]";
438  StageResource * new_resource = new StageResource(buffer.toString(), stage, i, resource_index++, _last_stage_index - _stage_index);
439  _resources.add(new_resource);
440  }
441  }
442  else { // stage uses functional units
443  if (stage->orderPolicy() == PipelineStage<ParamExeNode>::IN_ORDER) {
444  for(FunctionalUnitIterator fu(stage); fu; fu++) {
445  for (int i=0 ; i<fu->width() ; i++) {
446  StringBuffer buffer;
447  buffer << fu->name() << "[" << i << "]";
448  FuResource * new_resource = new FuResource(buffer.toString(), fu, i, resource_index++, _last_stage_index - _stage_index);
449  _resources.add(new_resource);
450  }
451  }
452  }
453  }
454  _latest_resource_index = _resources.length() - 1;
455  _stage_index++;
456  }
457  for (Microprocessor<ParamExeNode>::QueueIterator queue(microprocessor) ; queue ; queue++) {
458  int num = queue->size();
459  if (num > sequence->count())
460  num = sequence->count();
461  for (int i=0 ; i<num ; i++) {
462  StringBuffer buffer;
463  buffer << queue->name() << "[" << i << "]";
464  int _i = 0, _empty_i;
465  for (Microprocessor<ParamExeNode>::PipelineIterator stage(microprocessor) ; stage ; stage++) {
466  if (stage == queue->emptyingStage())
467  _empty_i = _i;
468  _i++;
469  }
470  StageResource * upper_bound;
471  int upper_bound_offset;
472  for (elm::genstruct::Vector<Resource *>::Iterator resource(_resources) ; resource ; resource++) {
473  if (resource->type() == STAGE) {
474  if (((StageResource *)(*resource))->stage() == queue->emptyingStage()) {
475  if (i < queue->size() - ((StageResource *)(*resource))->stage()->width() - 1) {
476  if (((StageResource *)(*resource))->slot() == ((StageResource *)(*resource))->stage()->width()-1) {
477  upper_bound = (StageResource *) (*resource);
478  upper_bound_offset = (queue->size() - i) / ((StageResource *)(*resource))->stage()->width();
479  }
480  }
481  else {
482  if (((StageResource *)(*resource))->slot() == i - queue->size() + ((StageResource *)(*resource))->stage()->width()) {
483  upper_bound = (StageResource *) (*resource);
484  upper_bound_offset = 0;
485  }
486  }
487  }
488  }
489  }
490  ASSERT(upper_bound);
491  QueueResource * new_resource = new QueueResource(buffer.toString(), queue, i, resource_index++,
492  _last_stage_index - _empty_i, upper_bound, upper_bound_offset);
493  _resources.add(new_resource);
494  }
495  }
496  otawa::hard::Platform *pf = fw->platform();
497  AllocatedTable<input_t> inputs(pf->banks().count());
498  int reg_bank_count = pf->banks().count();
499  for(int i = 0; i <reg_bank_count ; i++) {
500  inputs[i].reg_bank = (otawa::hard::RegBank *) pf->banks()[i];
501  inputs[i]._is_input =
502  new AllocatedTable<bool>(inputs[i].reg_bank->count());
503  inputs[i]._resource_index =
504  new AllocatedTable<int>(inputs[i].reg_bank->count());
505  for (int j=0 ; j<inputs[i].reg_bank->count() ; j++) {
506  inputs[i]._is_input->set(j,true);
507  inputs[i]._resource_index->set(j,-1);
508  }
509  }
510  for (InstIterator inst(sequence) ; inst ; inst++) {
511  const elm::genstruct::Table<hard::Register *>& reads = inst->inst()->readRegs();
512  for(int i = 0; i < reads.count(); i++) {
513  for (int b=0 ; b<reg_bank_count ; b++) {
514  if (inputs[b].reg_bank == reads[i]->bank()) {
515  if (inputs[b]._is_input->get(reads[i]->number()) == true) {
516  if (inputs[b]._resource_index->get(reads[i]->number()) == -1) {
517  //new input coming from outside the sequence
518  StringBuffer buffer;
519  buffer << reads[i]->bank()->name() << reads[i]->number();
520  RegResource * new_resource = new RegResource(buffer.toString(), reads[i]->bank(), reads[i]->number(), resource_index++,
521  _last_stage_index - _operand_producing_stage_index);
522  _resources.add(new_resource);
523  new_resource->addUsingInst(inst);
524  inputs[b]._resource_index->set(reads[i]->number(), _resources.length()-1);
525  }
526  else {
527  ((RegResource *)_resources[inputs[b]._resource_index->get(reads[i]->number())])->addUsingInst(inst);
528  }
529  }
530  }
531  }
532  }
533  const elm::genstruct::Table<hard::Register *>& writes = inst->inst()->writtenRegs();
534  for(int i = 0; i < writes.count(); i++) {
535  for (int b=0 ; b<reg_bank_count ; b++) {
536  if (inputs[b].reg_bank == writes[i]->bank()) {
537  inputs[b]._is_input->set(writes[i]->number(), false);
538  }
539  }
540  }
541  }
542 
543  int i = 0;
544  for (InstIterator inst(sequence) ; inst ; inst++) {
545  StringBuffer buffer;
546  buffer << "extconf[" << i << "]";
547  ExternalConflictResource * new_resource = new ExternalConflictResource(buffer.toString(), inst, resource_index++, 1);
548  //_resources.add(new_resource);
549  _external_conflicts.add(new_resource);
550  StringBuffer another_buffer;
551  another_buffer << "intconf[" << i << "]";
552  InternalConflictResource * another_new_resource = new InternalConflictResource(another_buffer.toString(), inst, resource_index++, 1);
553  //_resources.add(another_new_resource);
554  _internal_conflicts.add(another_new_resource);
555  i++;
556  }
557  _last_resource_index = resource_index - 1 ;
558  }
559 
560 #define EPSILON 10
562  StringBuffer _buffer;
563  if (delay < -INFINITE_TIME+EPSILON)
564  _buffer << "-INF";
565  else {
566  if (delay > INFINITE_TIME-EPSILON)
567  _buffer << "-INF";
568  else
569  _buffer << delay;
570  }
571  return _buffer.toString();
572  }
573 
574 
575 }; // namespace otawa
576 
577 #endif //_PARAM_EXEGRAPH_H_
struct otawa::sem::inst inst
struct otawa::ParamExeGraph::input_t input_t
int regIndex()
Definition: ParamExeGraph.h:147
This class represents a bank of registers.
Definition: Register.h:68
int _late_contenders
Definition: ParamExeGraph.h:268
Queue< ParamExeNode > * _queue
Definition: ParamExeGraph.h:103
bool isContender(int index)
Definition: ParamExeGraph.h:282
virtual void propagate()
Definition: exegraph_ParamExeGraph.cpp:391
void setContentionDelay(ExeGraph< ParamExeNode >::time_bound_t bound, int delay)
Definition: ParamExeGraph.h:352
otawa::hard::RegBank * _reg_bank
Definition: ParamExeGraph.h:133
int slot()
Definition: ParamExeGraph.h:98
int resourceCount()
Definition: ParamExeGraph.h:226
elm::genstruct::AllocatedTable< int > * _resource_index
Definition: ParamExeGraph.h:43
#define EPSILON
Definition: ParamExeGraph.h:560
void setDelay(int index, ExeGraph< ParamExeNode >::time_bound_t bound, int delay)
Definition: ParamExeGraph.h:336
int _slot
Definition: ParamExeGraph.h:88
elm::genstruct::Vector< Resource * > _resources
Definition: ParamExeGraph.h:200
int _reg_index
Definition: ParamExeGraph.h:134
Definition: ParamExeGraph.h:159
ResourceIterator(const ParamExeGraph *graph)
Definition: ParamExeGraph.h:237
resource_type_t type()
Definition: ParamExeGraph.h:56
ExternalConflictIterator(const ParamExeGraph *graph)
Definition: ParamExeGraph.h:247
int contentionDelay(ExeGraph< ParamExeNode >::time_bound_t bound)
Definition: ParamExeGraph.h:334
Definition: ParamExeGraph.h:253
Definition: ParamExeGraph.h:39
int _max_contention_delay
Definition: ParamExeGraph.h:258
int res_dep_impact[RES_TYPE_NUM]
Definition: ParamExeGraph.h:209
int d(int index)
Definition: ParamExeGraph.h:301
int _capacity
Definition: ParamExeGraph.h:199
int _internal_delay[ExeGraph< ParamExeNode >::BOUNDS]
Definition: ParamExeGraph.h:263
int slot()
Definition: ParamExeGraph.h:82
elm::genstruct::AllocatedTable< int > * _delay[ExeGraph< ParamExeNode >::BOUNDS]
Definition: ParamExeGraph.h:262
int countBits(void) const
bool res_dep[RES_TYPE_NUM]
Definition: ParamExeGraph.h:208
int _min_contention_delay
Definition: ParamExeGraph.h:259
InternalConflictIterator(const ParamExeGraph *graph)
Definition: ParamExeGraph.h:242
Definition: ParamExeGraph.h:40
otawa::hard::RegBank * regBank()
Definition: ParamExeGraph.h:145
virtual void analyzeContentions()
Definition: exegraph_ParamExeGraph.cpp:199
Definition: ParamExeGraph.h:245
void setMinContentionDelay(int value)
Definition: ParamExeGraph.h:326
elm::genstruct::Vector< N * > _contenders
Definition: ExeGraph.h:154
Definition: ParamExeGraph.h:39
int _upper_bound_offset
Definition: ParamExeGraph.h:106
RegResource(elm::String name, otawa::hard::RegBank *reg_bank, int reg_index, int index, int offset)
Definition: ParamExeGraph.h:136
void addUsingInst(ExeInst< ParamExeNode > *inst)
Definition: ParamExeGraph.h:149
elm::String _name
Definition: ParamExeGraph.h:47
StageResource * _upper_bound
Definition: ParamExeGraph.h:105
int d(int index, ExeGraph< ParamExeNode >::time_bound_t bound)
Definition: ParamExeGraph.h:299
uint32 size
int _offset
Definition: ParamExeGraph.h:50
int latestResourceIndex()
Definition: ParamExeGraph.h:232
int delay(int index, ExeGraph< ParamExeNode >::time_bound_t bound)
Definition: ParamExeGraph.h:328
#define INFINITE_TIME
Definition: ParamExeGraph.h:32
bool contentionDep(int index)
Definition: ParamExeGraph.h:330
elm::genstruct::SLList< ParamExeGraph::InternalConflictResource * > _contenders_list
Definition: ParamExeGraph.h:265
void dumpSimple(elm::io::Output &dotFile)
Definition: exegraph_ParamExeGraph.cpp:601
void buildContendersMasks()
Definition: exegraph_ParamExeGraph.cpp:275
void clearTimesChanged()
Definition: ParamExeGraph.h:218
int instructionCount()
Definition: ParamExeGraph.h:228
Definition: ParamExeGraph.h:235
bool _has_pred
Definition: ParamExeGraph.h:205
int minContentionDelay()
Definition: ParamExeGraph.h:324
void setD(int index, int value, ExeGraph< ParamExeNode >::time_bound_t bound)
Definition: ParamExeGraph.h:306
uint32 offset
int _resource_count
Definition: ParamExeGraph.h:198
bool hasContenders()
Definition: ParamExeGraph.h:297
elm::genstruct::AllocatedTable< bool > * _contention_dep
Definition: ParamExeGraph.h:261
virtual hard::Platform * platform(void)
Definition: WorkSpace.h:75
int _slot
Definition: ParamExeGraph.h:71
ExeInst< ParamExeNode > * instruction()
Definition: ParamExeGraph.h:185
PipelineStage< N > * pipelineStage(void)
Definition: ExeGraph.h:167
int length(void) const
Definition: ParamExeGraph.h:39
Graph * graph(void) const
Get the container graph if any.
Definition: Graph.h:75
elm::BitVector * _possible_contenders
Definition: ParamExeGraph.h:266
int internalDelay(ExeGraph< ParamExeNode >::time_bound_t bound)
Definition: ParamExeGraph.h:332
Resource(elm::String name, resource_type_t type, int index, int offset)
Definition: ParamExeGraph.h:52
PipelineStage< ParamExeNode > * _stage
Definition: ParamExeGraph.h:70
int _contention_delay[ExeGraph< ParamExeNode >::BOUNDS]
Definition: ParamExeGraph.h:264
ParamExeNode(ExeGraph< ParamExeNode > *graph, PipelineStage< ParamExeNode > *stage, ExeInst< ParamExeNode > *inst)
Definition: ParamExeGraph.h:364
Definition: Trace.h:59
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
class ParamExeNode Node
Definition: ParamExeGraph.h:38
int _index
Definition: ParamExeGraph.h:49
elm::genstruct::Vector< Resource * > _internal_conflicts
Definition: ParamExeGraph.h:201
Definition: ParamExeGraph.h:85
QueueResource(elm::String name, Queue< ParamExeNode > *queue, int slot, int index, int offset, StageResource *upper_bound, int upper_bound_offset)
Definition: ParamExeGraph.h:108
Definition: ParamExeGraph.h:36
elm::genstruct::SLList< ParamExeGraph::InternalConflictResource * > * conflictList()
Definition: ParamExeGraph.h:291
Queue< ParamExeNode > * queue()
Definition: ParamExeGraph.h:121
PipelineStage< N > * operandProducingStage(void)
Definition: Microprocessor.h:314
PipelineStage< ParamExeNode > * stage()
Definition: ParamExeGraph.h:80
InternalConflictResource(elm::String name, ExeInst< ParamExeNode > *instruction, int index, int offset)
Definition: ParamExeGraph.h:178
Definition: ParamExeGraph.h:130
ParamExeNode * node()
Definition: ParamExeGraph.h:189
virtual int cost()
Definition: exegraph_ParamExeGraph.cpp:134
void set(int index) const
Definition: ParamExeGraph.h:68
const banks_t & banks(void) const
Definition: Platform.h:163
void setContender(int index)
Definition: ParamExeGraph.h:284
resource_type_t _type
Definition: ParamExeGraph.h:48
inst(void)
Definition: inst.h:118
elm::genstruct::AllocatedTable< bool > * _is_input
Definition: ParamExeGraph.h:42
PipelineStage< ParamExeNode >::FunctionalUnit * fu()
Definition: ParamExeGraph.h:96
FuResource(elm::String name, PipelineStage< ParamExeNode >::FunctionalUnit *fu, int slot, int index, int offset)
Definition: ParamExeGraph.h:90
void setStageNumber(int number)
Definition: ParamExeGraph.h:293
Definition: ParamExeGraph.h:45
int count(void) const
bool e(int index)
Definition: ParamExeGraph.h:303
void setMaxContentionDelay(int value)
Definition: ParamExeGraph.h:322
Definition: ParamExeGraph.h:39
PipelineStage< ParamExeNode >::FunctionalUnit * _fu
Definition: ParamExeGraph.h:87
void setLateContenders(int num)
Definition: ParamExeGraph.h:278
elm::BitVector * possibleContenders()
Definition: ParamExeGraph.h:274
elm::genstruct::Vector< Resource * > _external_conflicts
Definition: ParamExeGraph.h:202
An instruction represented in an ExeGraph.
Definition: ExeGraph.h:49
Definition: ParamExeGraph.h:173
void setInternalDelay(ExeGraph< ParamExeNode >::time_bound_t bound, int delay)
Definition: ParamExeGraph.h:346
An execution graph that expresses precedence constraints on the execution of a sequence of instructio...
Definition: ExeGraph.h:40
void dump(elm::io::Output &dotFile)
Definition: exegraph_ParamExeGraph.cpp:439
StageResource(elm::String name, PipelineStage< ParamExeNode > *stage, int slot, int index, int offset)
Definition: ParamExeGraph.h:73
virtual int Delta(ParamExeNode *a, Resource *res)
Definition: exegraph_ParamExeGraph.cpp:28
void setD(int index, int value)
Definition: ParamExeGraph.h:308
resource_type_t
Definition: ParamExeGraph.h:39
ParamExeNode * _node
Definition: ParamExeGraph.h:176
elm::String name()
Definition: ParamExeGraph.h:54
void addConflict(ParamExeGraph::InternalConflictResource *conflict)
Definition: ParamExeGraph.h:289
This class records information about the architecture where the processed program will run...
Definition: Platform.h:48
void initContenders(int size)
Definition: ParamExeGraph.h:280
bool timesChanged()
Definition: ParamExeGraph.h:222
int offset()
Definition: ParamExeGraph.h:60
ExeInst< ParamExeNode > * instruction()
Definition: ParamExeGraph.h:170
Definition: Microprocessor.h:65
ExeInst< ParamExeNode > * _instruction
Definition: ParamExeGraph.h:161
Definition: ParamExeGraph.h:39
void setNode(ParamExeNode *node)
Definition: ParamExeGraph.h:187
Definition: ParamExeGraph.h:240
Definition: ParamExeGraph.h:39
ExeInst< N > * inst(void)
Definition: ExeGraph.h:169
elm::String delayName(int delay)
Definition: ParamExeGraph.h:561
int index(void) const
Definition: GenGraph.h:51
Definition: ParamExeGraph.h:39
int slot()
Definition: ParamExeGraph.h:123
elm::genstruct::AllocatedTable< int > * _d[ExeGraph< ParamExeNode >::BOUNDS]
Definition: ParamExeGraph.h:256
Definition: ParamExeGraph.h:101
Definition: ParamExeGraph.h:63
int upperBoundOffset()
Definition: ParamExeGraph.h:127
int _latest_resource_index
Definition: ParamExeGraph.h:203
StageResource * upperBound()
Definition: ParamExeGraph.h:125
int index()
Definition: ParamExeGraph.h:58
virtual void initDelays()
Definition: exegraph_ParamExeGraph.cpp:310
ExeInst< ParamExeNode > * _instruction
Definition: ParamExeGraph.h:175
int stageNumber()
Definition: ParamExeGraph.h:295
void setTimesChanged()
Definition: ParamExeGraph.h:220
int _stage_number
Definition: ParamExeGraph.h:260
elm::genstruct::Vector< ExeInst< ParamExeNode > * > _using_instructions
Definition: ParamExeGraph.h:132
int _slot
Definition: ParamExeGraph.h:104
void setE(int index, bool value)
Definition: ParamExeGraph.h:310
UsingInstIterator(const RegResource *res)
Definition: ParamExeGraph.h:155
ParamExeGraph(WorkSpace *fw, Microprocessor< ParamExeNode > *microprocessor, ExeSequence< ParamExeNode > *sequence, bool has_pred, Trace *_trace)
Definition: ParamExeGraph.h:404
ExternalConflictResource(elm::String name, ExeInst< ParamExeNode > *instruction, int index, int offset)
Definition: ParamExeGraph.h:163
int _last_resource_index
Definition: ParamExeGraph.h:204
elm::genstruct::SLList< elm::BitVector * > * contendersMasksList()
Definition: ParamExeGraph.h:272
int lateContenders()
Definition: ParamExeGraph.h:276
elm::genstruct::SLList< elm::BitVector * > _contenders_masks_list
Definition: ParamExeGraph.h:267
GenGraph< ParamExeNode, typename ExeGraph< ParamExeNode >::ExeEdge > * graph()
Definition: ExeGraph.h:225
void setContentionDep(int index)
Definition: ParamExeGraph.h:342
Trace * _trace
Definition: ParamExeGraph.h:194
int analyze()
Definition: exegraph_ParamExeGraph.cpp:413
ParamExeGraph * _graph
Definition: ParamExeGraph.h:255
int maxContentionDelay()
Definition: ParamExeGraph.h:320
bool _times_changed
Definition: ParamExeGraph.h:197
int contendersNumber()
Definition: ParamExeGraph.h:286
elm::genstruct::Vector< ParamExeNode * > _contending_nodes
Definition: ParamExeGraph.h:207
StartResource(elm::String name, int index, int offset)
Definition: ParamExeGraph.h:65
String toString(void)
Definition: ParamExeGraph.h:39
hard::RegBank * reg_bank
Definition: ParamExeGraph.h:41
ExeSequence< ParamExeNode > * _sequence
Definition: ParamExeGraph.h:206
int length()
Definition: ExeGraph.h:98