23 #ifndef OTAWA_PAREXEPROC_H
24 #define OTAWA_PAREXEPROC_H
27 #include <elm/genstruct/Vector.h>
28 #include <elm/string/String.h>
29 #include <elm/genstruct/DLList.h>
37 using namespace elm::genstruct;
65 : _name(name), _size(size) {}
71 {
return _filling_stage;}
73 {
return _emptying_stage;}
75 {_filling_stage = stage;}
77 {_emptying_stage = stage;}
88 typedef enum order_t {IN_ORDER, OUT_OF_ORDER} order_policy_t;
108 { _nodes.add(node); }
110 { _nodes.remove(node); }
114 inline int width(
void)
const {
return _width;}
116 inline int index(
void) {
return _index;}
123 inline int numFus(
void) {
return _fus.length();}
127 inline bool hasNodes(
void) {
return (_nodes.length() != 0);}
128 inline void deleteNodes(
void) {
if (_nodes.length() != 0) _nodes.clear();}
129 inline int numNodes(
void) {
return _nodes.length();}
131 {
if (index >= _nodes.length())
return NULL;
else return _nodes[index]; }
135 for(
int i = 0; i < _bindings.length(); i++) {
137 if((kind & mask) ==
mask)
138 return _bindings[i].snd;
181 if (_first_stage == NULL)
182 _first_stage = stage;
236 : _unit(unit), _category(category), _latency(latency), _width(width), _order_policy(policy),
237 _source_queue(sq), _destination_queue(dq), _name(name), _index(index) {}
253 for (
int i=2 ; i<
latency ; i++) {
270 #endif // OTAWA_MICROPROCESSOR_H
int _width
Definition: ParExeProc.h:95
QueueIterator(const ParExeProc *processor)
Definition: ParExeProc.h:229
ParExeQueue * destinationQueue(void)
Definition: ParExeProc.h:119
ParExePipeline()
Definition: ParExeProc.h:164
bool hasNodes(void)
Deletes all the nodes in the list.
Definition: ParExeProc.h:127
ParExeStage * fetchStage(void)
Definition: ParExeProc.h:219
instruction_category_t
Definition: Microprocessor.h:46
Iterator for the instruction queues.
Definition: ParExeProc.h:227
Representation of a pipeline stage to be used to build a ParExeGraph.
Definition: ParExeProc.h:86
Definition: ParExeProc.h:88
void addNode(ParExeNode *node)
This function adds an execution graph (ParExeGraph) node to the list of nodes related to the pipeline...
Definition: ParExeProc.h:107
ParExeStage * _filling_stage
Definition: ParExeProc.h:61
elm::String _name
Definition: ParExeProc.h:59
pipeline_stage_category_t _category
Definition: ParExeProc.h:93
t::uint32 mask
Definition: base.h:45
instruction_category_t
Definition: ParExeProc.h:204
elm::genstruct::SLList< ParExeStage * > _inorder_stages
Definition: ParExeProc.h:199
void setFillingStage(ParExeStage *stage)
Definition: ParExeProc.h:74
Pair< T1, T2 > pair(const T1 &v1, const T2 &v2)
void setEmptyingStage(ParExeStage *stage)
Definition: ParExeProc.h:76
Représentation of a processor (to be used to build a ParExeGraph).
Definition: ParExeProc.h:195
ParExePipeline * findFU(Inst::kind_t kind)
Definition: ParExeProc.h:134
void addQueue(elm::String name, int size)
Add an instruction queue to the processor.
Definition: ParExeProc.h:216
elm::String name(void)
Definition: ParExeProc.h:115
ParExeQueue * queue(int index)
Returns a pointer to the queue specified by index.
Definition: ParExeProc.h:217
bool isFuStage(void)
Definition: ParExeProc.h:121
elm::genstruct::Vector< ParExeQueue * > _queues
Definition: ParExeProc.h:197
Definition: Microprocessor.h:48
elm::genstruct::Vector< ParExeNode * > _nodes
Definition: ParExeProc.h:103
Description of a processor pipeline.
Definition: Processor.h:136
int _latency
Definition: ParExeProc.h:94
ParExeStage * _last_stage
Definition: ParExeProc.h:161
Definition: ParExeProc.h:89
Vector< Pair< Inst::kind_t, ParExePipeline * > > _bindings
Definition: ParExeProc.h:101
ParExeQueue(elm::String name, int size)
Constructor.
Definition: ParExeProc.h:64
elm::String _name
Definition: ParExeProc.h:99
void addBinding(Inst::kind_t kind, ParExePipeline *fu)
Binds a functional unit to an instruction kind.
Definition: ParExeProc.h:132
StringOption proc(command, 'p',"processor","used processor","path","")
ParExeQueue * _source_queue
Definition: ParExeProc.h:97
elm::genstruct::SLList< ParExeStage * > * listOfInorderStages()
Definition: ParExeProc.h:225
Definition: features.h:44
Definition: ParExeProc.h:171
const hard::PipelineUnit * unit(void) const
Definition: ParExeProc.h:112
ParExeStage * lastStage()
Definition: ParExeProc.h:166
int index(void)
Definition: ParExeProc.h:116
Inst::kind_t kind
Definition: odisasm.cpp:106
ParExeNode * lastNode(void)
Definition: ParExeProc.h:126
Definition: Microprocessor.h:50
int numFus(void)
Definition: ParExeProc.h:123
A node of the ParExeGraph, that represents the crossing of an instruction inside a microprocessor sta...
Definition: ParExeGraph.h:339
int latency(void)
Definition: ParExeProc.h:120
ParExePipeline _pipeline
Definition: ParExeProc.h:198
Definition: Processor.h:41
void addFunctionalUnit(bool pipelined, int latency, int width, elm::String name, const hard::PipelineUnit *unit)
Adds a functional unit (should be used with EXECUTE stages only).
Definition: ParExeProc.h:239
Definition: Microprocessor.h:49
const hard::PipelineUnit * _unit
Definition: ParExeProc.h:92
Definition: Microprocessor.h:47
Definition: features.h:48
void addStage(ParExeStage *stage)
Adds a stage to the pipeline.
Definition: ParExeProc.h:179
ParExeStage * _exec_stage
Definition: ParExeProc.h:201
int _index
Definition: ParExeProc.h:100
int _size
Definition: ParExeProc.h:60
elm::t::uint32 kind_t
Definition: Inst.h:67
ParExeNode * firstNode(void)
Definition: ParExeProc.h:125
ParExeStage * _fetch_stage
Definition: ParExeProc.h:200
ParExeNode * node(int index)
Returns a pointer to a graph node related to the stage.
Definition: ParExeProc.h:130
int numStages()
Definition: ParExeProc.h:169
ParExeStage * emptyingStage(void)
Definition: ParExeProc.h:72
ParExeStage * firstStage()
Definition: ParExeProc.h:167
ParExeQueue * sourceQueue(void)
Definition: ParExeProc.h:118
Representation of a pipeline (list of stages).
Definition: ParExeProc.h:157
NodeIterator(const ParExeStage *stage)
Definition: ParExeProc.h:145
ParExeStage * execStage(void)
Definition: ParExeProc.h:221
elm::String name(void)
Definition: ParExeProc.h:66
elm::genstruct::Vector< ParExeStage * > _stages
Definition: ParExeProc.h:159
Iterator for the graph nodes related to the pipeline stage.
Definition: ParExeProc.h:143
bool isLastStage(ParExeStage *stage)
Definition: ParExeProc.h:223
ParExeStage(pipeline_stage_category_t category, int latency, int width, order_t policy, ParExeQueue *sq, ParExeQueue *dq, elm::String name, int index=0, const hard::PipelineUnit *unit=0)
Constructor.
Definition: ParExeProc.h:235
cstring name
Definition: odisasm.cpp:107
ParExeQueue * _destination_queue
Definition: ParExeProc.h:98
elm::genstruct::Vector< ParExePipeline * > _fus
Definition: ParExeProc.h:102
ParExeStage * lastStage(void)
Definition: ParExeProc.h:222
ParExeStage * fillingStage(void)
Definition: ParExeProc.h:70
ParExeStage * _emptying_stage
Definition: ParExeProc.h:62
ParExePipeline * pipeline()
Definition: ParExeProc.h:224
~ParExePipeline()
Definition: ParExeProc.h:165
int width(void) const
Definition: ParExeProc.h:114
IntFormat width(int width, IntFormat fmt)
Definition: Microprocessor.h:53
pipeline_stage_category_t category(void)
Definition: ParExeProc.h:117
Definition: Microprocessor.h:52
order_t _order_policy
Definition: ParExeProc.h:96
Representation of a hardware instruction queue to be used to build a ParExeGraph. ...
Definition: ParExeProc.h:57
order_t orderPolicy(void)
Definition: ParExeProc.h:113
pipeline_stage_category_t
Definition: ParExeProc.h:89
ParExePipeline * fu(int index)
This function returns a pointer to a functional unit pipeline.
Definition: ParExeProc.h:124
order_t
Definition: ParExeProc.h:88
int size(void)
Definition: ParExeProc.h:68
Definition: Microprocessor.h:51
int numNodes(void)
Definition: ParExeProc.h:129
void deleteNodes(void)
Definition: ParExeProc.h:128
void removeNode(ParExeNode *node)
Definition: ParExeProc.h:109
StageIterator(const ParExePipeline *pipeline)
Definition: ParExeProc.h:173
void setFetchStage(ParExeStage *stage)
Declares a stage as the fetch stage (it will undergo a special processing when building a ParExeGraph...
Definition: ParExeProc.h:218
void setExecStage(ParExeStage *stage)
Declares a stage as the execution stage (it will undergo a special processing when building a ParExeG...
Definition: ParExeProc.h:220
ParExeStage * _first_stage
Definition: ParExeProc.h:162