OpenASIP  2.0
Private Member Functions | Private Attributes | Static Private Attributes | List of all members
VectorLSGenerator Class Reference
Inheritance diagram for VectorLSGenerator:
Inheritance graph
Collaboration diagram for VectorLSGenerator:
Collaboration graph

Private Member Functions

 PLUGIN_DESCRIPTION ("Explorer plugin that creates wide load/store unit.")
 
 VectorLSGenerator ()
 
virtual bool requiresStartingPointArchitecture () const
 
virtual bool producesArchitecture () const
 
virtual bool requiresHDB () const
 
virtual bool requiresSimulationData () const
 
virtual bool requiresApplication () const
 
virtual std::vector< RowIDexplore (const RowID &configurationID, const unsigned int &)
 
void readParameters ()
 
void addOperation (TTAMachine::FunctionUnit &lsUnit, Operation &op, bool scalar)
 
void createVectorLSU (TTAMachine::FunctionUnit &lsUnit, TTAMachine::AddressSpace &addrSpace)
 

Private Attributes

ComponentImplementationSelector selector_
 Selector used by the plugin. More...
 
int nodeCount_
 
TCEString addressSpaces_
 

Static Private Attributes

static const TCEString NodeCountPN_
 
static const TCEString AddressSpacesPN_
 

Additional Inherited Members

- Public Types inherited from DesignSpaceExplorerPlugin
typedef std::pair< std::string, ExplorerPluginParameterParameter
 
typedef std::map< std::string, ExplorerPluginParameterParameterMap
 
typedef std::map< std::string, ExplorerPluginParameter >::iterator PMIt
 
typedef std::map< std::string, ExplorerPluginParameter >::const_iterator PMCIt
 
- Public Member Functions inherited from DesignSpaceExplorerPlugin
virtual std::string description () const
 
void addParameter (TCEString name, ExplorerPluginParameterType type, bool compulsory=true, TCEString defaultValue="", TCEString description="")
 
template<typename T >
void readCompulsoryParameter (const std::string paramName, T &param) const
 
template<typename T >
void readOptionalParameter (const std::string paramName, T &param) const
 
template<typename RT >
RT parameterValue (const std::string &paramName) const
 
virtual ~DesignSpaceExplorerPlugin ()
 
virtual void giveParameter (const std::string &name, const std::string &value)
 
virtual std::string name () const
 
virtual void setPluginName (const std::string &pluginName)
 
virtual bool hasParameter (const std::string &paramName) const
 
ParameterMap parameters () const
 
virtual bool booleanValue (const std::string &parameter) const
 
- Public Member Functions inherited from DesignSpaceExplorer
 DesignSpaceExplorer ()
 
virtual ~DesignSpaceExplorer ()
 
virtual void setDSDB (DSDBManager &dsdb)
 
virtual bool evaluate (const DSDBManager::MachineConfiguration &configuration, CostEstimates &results=dummyEstimate_, bool estimate=false)
 
virtual DSDBManagerdb ()
 
std::vector< DesignSpaceExplorerPlugin * > getPlugins ()
 
RowID createImplementationAndStore (const DSDBManager::MachineConfiguration &conf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb")
 
bool createImplementation (const DSDBManager::MachineConfiguration &conf, DSDBManager::MachineConfiguration &newConf, const double &frequency=0.0, const double &maxArea=0.0, const bool &createEstimates=true, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb")
 
IDF::MachineImplementationselectComponents (const TTAMachine::Machine &mach, const double &frequency=0.0, const double &maxArea=0.0, const std::string &icDec="DefaultICDecoder", const std::string &icDecHDB="asic_130nm_1.5V.hdb") const
 
void createEstimateData (const TTAMachine::Machine &mach, const IDF::MachineImplementation &idf, CostEstimator::AreaInGates &area, CostEstimator::DelayInNanoSeconds &longestPathDelay)
 
RowID addConfToDSDB (const DSDBManager::MachineConfiguration &conf)
 
- Static Public Member Functions inherited from DesignSpaceExplorer
static DesignSpaceExplorerPluginloadExplorerPlugin (const std::string &pluginName, DSDBManager *dsdb=NULL)
 
- Protected Member Functions inherited from DesignSpaceExplorerPlugin
 DesignSpaceExplorerPlugin ()
 
void checkParameters () const
 
- Protected Member Functions inherited from DesignSpaceExplorer
TTAProgram::Programschedule (const std::string applicationFile, TTAMachine::Machine &machine, TCEString paramOptions="-O3")
 
const ExecutionTracesimulate (const TTAProgram::Program &program, const TTAMachine::Machine &machine, const TestApplication &testApplication, const ClockCycleCount &maxCycles, ClockCycleCount &runnedCycles, const bool tracing, const bool useCompiledSimulation=false, std::vector< ClockCycleCount > *executionCounts=NULL)
 
- Protected Attributes inherited from DesignSpaceExplorerPlugin
std::string pluginName_
 the name of the explorer plugin More...
 
ParameterMap parameters_
 Parameters for the plugin. More...
 

Detailed Description

Explorer plugin that creates wide load store unit.

Supported parameters:

Definition at line 68 of file VectorLSGenerator.cc.

Constructor & Destructor Documentation

◆ VectorLSGenerator()

VectorLSGenerator::VectorLSGenerator ( )
inlineprivate

Definition at line 71 of file VectorLSGenerator.cc.

72  nodeCount_(4),
73  addressSpaces_("data") {
74 
75 
76  // parameters that have a default value
81 
82  }

References STRING, Conversion::toString(), and UINT.

Here is the call graph for this function:

Member Function Documentation

◆ addOperation()

void VectorLSGenerator::addOperation ( TTAMachine::FunctionUnit lsUnit,
Operation op,
bool  scalar 
)
inlineprivate

Adds operation to function unit, sets the port bindings and pipeline parameters.

Definition at line 185 of file VectorLSGenerator.cc.

186  {
187 
188  TTAMachine::HWOperation* hwOp =
189  new TTAMachine::HWOperation(op.name(), lsUnit);
190  TTAMachine::ExecutionPipeline* pipeline = hwOp->pipeline();
191 
192  // Specificly define the triggering port
193  hwOp->bindPort(1, *lsUnit.operationPort("in1t"));
194  pipeline->addPortRead(1,0,1);
195  if (scalar) {
196  if (op.numberOfInputs() == 2) {
197  // this is stw operation
198  hwOp->bindPort(2, *lsUnit.operationPort("in_extra2"));
199  pipeline->addPortRead(2, 0, 1);
200  }
201  if (op.numberOfOutputs() == 1) {
202  // this is ldw operation
203  hwOp->bindPort(2, *lsUnit.operationPort("out_extra1"));
204  pipeline->addPortWrite(2, 2, 1);
205  }
206  assert(hwOp->isBound(*lsUnit.operationPort("in1t")));
207  return;
208  }
209  // Add other inputs, after triggering port.
210  for (int i = 1; i < op.numberOfInputs(); i++) {
211  hwOp->bindPort(
212  i+1, *lsUnit.operationPort("in" + Conversion::toString(i+1)));
213  pipeline->addPortRead(i+1,0,1);
214  }
215  // Add other outputs, after triggering port.
216  for (int i = 1; i <= op.numberOfOutputs(); i++) {
217  hwOp->bindPort(
218  i+1, *lsUnit.operationPort("out" + Conversion::toString(i)));
219  pipeline->addPortWrite(i+1,2,1);
220  }
221  assert(hwOp->isBound(*lsUnit.operationPort("in1t")));
222  }

References TTAMachine::ExecutionPipeline::addPortRead(), TTAMachine::ExecutionPipeline::addPortWrite(), assert, TTAMachine::HWOperation::bindPort(), TTAMachine::HWOperation::isBound(), Operation::name(), Operation::numberOfInputs(), Operation::numberOfOutputs(), TTAMachine::FunctionUnit::operationPort(), TTAMachine::HWOperation::pipeline(), and Conversion::toString().

Here is the call graph for this function:

◆ createVectorLSU()

void VectorLSGenerator::createVectorLSU ( TTAMachine::FunctionUnit lsUnit,
TTAMachine::AddressSpace addrSpace 
)
inlineprivate

Create single instance of vector load store unit, starting from empty unit.

Definition at line 228 of file VectorLSGenerator.cc.

230  {
231 
232  TTAMachine::FUPort* trigger =
233  new TTAMachine::FUPort("in1t",
234  MathTools::requiredBits(addrSpace.end()),
235  lsUnit, true, true);
236  assert(trigger->isTriggering());
237  int width = (nodeCount_ >= 8) ? 8 :
238  (nodeCount_ >= 4) ? 4 :
239  (nodeCount_ >= 2) ? 2 : 0;
240  if (width == 0) {
241  TCEString msg = "No reason for creating wide LSU since number"
242  " of nodes in cluster is just " + Conversion::toString(nodeCount_);
243  throw Exception(
244  __FILE__, __LINE__, __func__, msg);
245  }
246  for (int i = 1; i <= width; i++) {
247  TTAMachine::FUPort* inPort =
248  new TTAMachine::FUPort(
249  "in" + Conversion::toString(i+1), 32, lsUnit, false, false);
250  assert(inPort->isOpcodeSetting() == false);
251  TTAMachine::FUPort* outPort =
252  new TTAMachine::FUPort(
253  "out" + Conversion::toString(i), 32, lsUnit, false, false);
254  assert(outPort->isOpcodeSetting() == false);
255  }
256  TTAMachine::FUPort* inPort =
257  new TTAMachine::FUPort(
258  "in_extra" + Conversion::toString(2), 32, lsUnit, false, false);
259  assert(inPort->isOpcodeSetting() == false);
260  TTAMachine::FUPort* outPort =
261  new TTAMachine::FUPort(
262  "out_extra" + Conversion::toString(1), 32, lsUnit, false, false);
263  assert(outPort->isOpcodeSetting() == false);
264 
265  // Adds aditional read and write port for use with scalar load
266  // and stores from the extras
267 
268  OperationPool pool;
269  OperationIndex& index = pool.index();
270  for (int m = 0; m < index.moduleCount(); m++) {
271  OperationModule& module = index.module(m);
272  for (int i = 0; i < index.operationCount(module); i++) {
273  TCEString opName = index.operationName(i, module);
274  Operation& op = pool.operation(opName.c_str());
275  // Creates HWOperations for memory access operations with
276  // number as suffix. ATM this means vector operation.
277  if (op.usesMemory() &&
278  (opName.endsWith("2") ||
279  opName.endsWith("4") ||
280  opName.endsWith("8"))) {
281  if (!lsUnit.hasOperation(opName) &&
282  op.numberOfInputs() <= nodeCount_ +1 &&
283  op.numberOfOutputs() <= nodeCount_) {
284  addOperation(lsUnit, op, false);
285  }
286  }
287  if (op.usesMemory() &&
288  opName.startsWith("LD") &&
289  op.numberOfInputs() == 1 &&
290  op.numberOfOutputs() == 1 &&
291  !lsUnit.hasOperation(opName)) {
292  addOperation(lsUnit, op, true);
293  }
294  if (op.usesMemory() &&
295  opName.startsWith("ST") &&
296  op.numberOfInputs() == 2 &&
297  op.numberOfOutputs() == 0 &&
298  !lsUnit.hasOperation(opName)) {
299  addOperation(lsUnit, op, true);
300  }
301  }
302  }
303 
304  }

References __func__, assert, TTAMachine::AddressSpace::end(), TCEString::endsWith(), TTAMachine::FunctionUnit::hasOperation(), OperationPool::index(), TTAMachine::FUPort::isOpcodeSetting(), TTAMachine::FUPort::isTriggering(), OperationIndex::module(), OperationIndex::moduleCount(), Operation::numberOfInputs(), Operation::numberOfOutputs(), OperationPool::operation(), OperationIndex::operationCount(), OperationIndex::operationName(), MathTools::requiredBits(), TCEString::startsWith(), Conversion::toString(), and Operation::usesMemory().

Here is the call graph for this function:

◆ explore()

virtual std::vector<RowID> VectorLSGenerator::explore ( const RowID configurationID,
const unsigned int &   
)
inlineprivatevirtual

Explorer plugin that adds machine components to a given machine with adf parameter or with configuration id in dsdb.

Reimplemented from DesignSpaceExplorerPlugin.

Definition at line 95 of file VectorLSGenerator.cc.

95  {
97  std::vector<RowID> result;
98 
99  DSDBManager& dsdb = db();
101  dsdb.configuration(configurationID);
102  TTAMachine::Machine* mach = NULL;
103  try {
104  mach = dsdb.architecture(conf.architectureID);
105  } catch (const Exception& e) {
106  throw Exception(
107  __FILE__, __LINE__, __func__, e.errorMessageStack());
108  }
109 
111  mach->addressSpaceNavigator();
112  TTAMachine::AddressSpace* addrSpace = NULL;
113  std::vector<TCEString> addressSpaces =
115  for (unsigned int i = 0; i < addressSpaces.size(); i++) {
116  if (!addrNav.hasItem(addressSpaces[i])) {
117  TCEString msg = "Original architecture does not have \""
118  + addressSpaces[i] +"\" address space. Not adding Vector LSU.";
119  throw Exception(
120  __FILE__, __LINE__, __func__, msg);
121  }
122 
123  addrSpace = addrNav.item(addressSpaces[i]);
124 
125  if (addrSpace == NULL) {
126  }
127  TTAMachine::FunctionUnit* lsUnit =
128  new TTAMachine::FunctionUnit("VectorLSU_" + addrSpace->name());
129 
130  createVectorLSU(*lsUnit, *addrSpace);
131 
132  try {
133  mach->addFunctionUnit(*lsUnit);
134  } catch (const Exception& e) {
135  throw Exception(
136  __FILE__, __LINE__, __func__, e.errorMessageStack());
137  }
138  try {
139  lsUnit->setAddressSpace(addrSpace);
140  } catch (const Exception& e) {
141  throw Exception(
142  __FILE__, __LINE__, __func__, e.errorMessageStack());
143  }
144  }
145 
147  try {
148  tempConf.architectureID = dsdb.addArchitecture(*mach);
149  tempConf.hasImplementation = false;
150  } catch (const RelationalDBException& e) {
151  TCEString msg = "Error while adding ADF to the dsdb. "
152  "ADF probably too big.";
153  throw Exception(
154  __FILE__, __LINE__, __func__, msg);
155  }
156  // add config to database to pass it to
157  // RemoveUnconnectedComponents plugin
158  RowID tempConfID = dsdb.addConfiguration(tempConf);
159  result.push_back(tempConfID);
160  return result;
161 
162  }

References __func__, DSDBManager::addArchitecture(), DSDBManager::addConfiguration(), TTAMachine::Machine::addFunctionUnit(), TTAMachine::Machine::addressSpaceNavigator(), DSDBManager::architecture(), DSDBManager::MachineConfiguration::architectureID, StringTools::chopString(), DSDBManager::configuration(), Exception::errorMessageStack(), DSDBManager::MachineConfiguration::hasImplementation, TTAMachine::Machine::Navigator< ComponentType >::hasItem(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::name(), and TTAMachine::FunctionUnit::setAddressSpace().

Here is the call graph for this function:

◆ PLUGIN_DESCRIPTION()

VectorLSGenerator::PLUGIN_DESCRIPTION ( "Explorer plugin that creates wide load/store unit."  )
private

◆ producesArchitecture()

virtual bool VectorLSGenerator::producesArchitecture ( ) const
inlineprivatevirtual

Implements DesignSpaceExplorerPlugin.

Definition at line 85 of file VectorLSGenerator.cc.

85 { return true; }

◆ readParameters()

void VectorLSGenerator::readParameters ( )
inlineprivate

Reads the parameters given to the plugin.

Definition at line 177 of file VectorLSGenerator.cc.

◆ requiresApplication()

virtual bool VectorLSGenerator::requiresApplication ( ) const
inlineprivatevirtual

Reimplemented from DesignSpaceExplorerPlugin.

Definition at line 88 of file VectorLSGenerator.cc.

88 { return false; }

◆ requiresHDB()

virtual bool VectorLSGenerator::requiresHDB ( ) const
inlineprivatevirtual

Implements DesignSpaceExplorerPlugin.

Definition at line 86 of file VectorLSGenerator.cc.

86 { return false; }

◆ requiresSimulationData()

virtual bool VectorLSGenerator::requiresSimulationData ( ) const
inlineprivatevirtual

Implements DesignSpaceExplorerPlugin.

Definition at line 87 of file VectorLSGenerator.cc.

87 { return false; }

◆ requiresStartingPointArchitecture()

virtual bool VectorLSGenerator::requiresStartingPointArchitecture ( ) const
inlineprivatevirtual

Implements DesignSpaceExplorerPlugin.

Definition at line 84 of file VectorLSGenerator.cc.

84 { return true; }

Member Data Documentation

◆ addressSpaces_

TCEString VectorLSGenerator::addressSpaces_
private

Definition at line 172 of file VectorLSGenerator.cc.

◆ AddressSpacesPN_

const TCEString VectorLSGenerator::AddressSpacesPN_
staticprivate

Definition at line 169 of file VectorLSGenerator.cc.

◆ nodeCount_

int VectorLSGenerator::nodeCount_
private

Definition at line 171 of file VectorLSGenerator.cc.

◆ NodeCountPN_

const TCEString VectorLSGenerator::NodeCountPN_
staticprivate

Definition at line 168 of file VectorLSGenerator.cc.

◆ selector_

ComponentImplementationSelector VectorLSGenerator::selector_
private

Selector used by the plugin.

Definition at line 166 of file VectorLSGenerator.cc.


The documentation for this class was generated from the following file:
OperationPool::operation
Operation & operation(const char *name)
Definition: OperationPool.cc:99
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
VectorLSGenerator::createVectorLSU
void createVectorLSU(TTAMachine::FunctionUnit &lsUnit, TTAMachine::AddressSpace &addrSpace)
Definition: VectorLSGenerator.cc:228
DesignSpaceExplorer::db
virtual DSDBManager & db()
Definition: DesignSpaceExplorer.cc:300
TCEString::startsWith
bool startsWith(const std::string &str) const
RelationalDBException
Definition: Exception.hh:692
TTAMachine::FUPort::isOpcodeSetting
virtual bool isOpcodeSetting() const
Definition: FUPort.cc:195
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
UINT
@ UINT
Definition: ExplorerPluginParameter.hh:40
DSDBManager::architecture
TTAMachine::Machine * architecture(RowID id) const
Definition: DSDBManager.cc:807
TTAMachine::HWOperation::bindPort
virtual void bindPort(int operand, const FUPort &port)
Definition: HWOperation.cc:269
DSDBManager::MachineConfiguration::hasImplementation
bool hasImplementation
Definition: DSDBManager.hh:80
VectorLSGenerator::addOperation
void addOperation(TTAMachine::FunctionUnit &lsUnit, Operation &op, bool scalar)
Definition: VectorLSGenerator.cc:185
OperationPool::index
OperationIndex & index()
Definition: OperationPool.cc:109
Operation::numberOfInputs
virtual int numberOfInputs() const
Definition: Operation.cc:192
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
DesignSpaceExplorerPlugin::DesignSpaceExplorerPlugin
DesignSpaceExplorerPlugin()
Definition: DesignSpaceExplorerPlugin.cc:48
TTAMachine::FUPort::isTriggering
virtual bool isTriggering() const
Definition: FUPort.cc:182
Operation::name
virtual TCEString name() const
Definition: Operation.cc:93
Conversion::toString
static std::string toString(const T &source)
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::FUPort
Definition: FUPort.hh:46
DesignSpaceExplorerPlugin::readOptionalParameter
void readOptionalParameter(const std::string paramName, T &param) const
DSDBManager::MachineConfiguration
Definition: DSDBManager.hh:78
TCEString::endsWith
bool endsWith(const std::string &str) const
VectorLSGenerator::AddressSpacesPN_
static const TCEString AddressSpacesPN_
Definition: VectorLSGenerator.cc:169
STRING
@ STRING
Definition: ExplorerPluginParameter.hh:40
TTAMachine::Machine::Navigator::hasItem
bool hasItem(const std::string &name) const
VectorLSGenerator::NodeCountPN_
static const TCEString NodeCountPN_
Definition: VectorLSGenerator.cc:168
TTAMachine::HWOperation::isBound
bool isBound(const FUPort &port) const
Definition: HWOperation.cc:338
__func__
#define __func__
Definition: Application.hh:67
TTAMachine::ExecutionPipeline::addPortRead
void addPortRead(int operand, int start, int duration)
Definition: ExecutionPipeline.cc:141
VectorLSGenerator::nodeCount_
int nodeCount_
Definition: VectorLSGenerator.cc:171
VectorLSGenerator::readParameters
void readParameters()
Definition: VectorLSGenerator.cc:177
Exception::errorMessageStack
std::string errorMessageStack(bool messagesOnly=false) const
Definition: Exception.cc:138
MathTools::requiredBits
static int requiredBits(unsigned long int number)
TTAMachine::FunctionUnit::hasOperation
virtual bool hasOperation(const std::string &name) const
Definition: FunctionUnit.cc:330
Exception
Definition: Exception.hh:54
TTAMachine::FunctionUnit::setAddressSpace
virtual void setAddressSpace(AddressSpace *as)
Definition: FunctionUnit.cc:594
DSDBManager
Definition: DSDBManager.hh:76
TTAMachine::Machine::addressSpaceNavigator
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition: Machine.cc:392
Operation
Definition: Operation.hh:59
DSDBManager::addConfiguration
RowID addConfiguration(const MachineConfiguration &conf)
Definition: DSDBManager.cc:299
Operation::usesMemory
virtual bool usesMemory() const
Definition: Operation.cc:232
DSDBManager::addArchitecture
RowID addArchitecture(const TTAMachine::Machine &mom)
Definition: DSDBManager.cc:191
DSDBManager::configuration
MachineConfiguration configuration(RowID id) const
Definition: DSDBManager.cc:361
OperationIndex::moduleCount
int moduleCount() const
TTAMachine::Machine::addFunctionUnit
virtual void addFunctionUnit(FunctionUnit &unit)
Definition: Machine.cc:202
OperationModule
Definition: OperationModule.hh:46
TCEString
Definition: TCEString.hh:53
StringTools::chopString
static std::vector< TCEString > chopString(const std::string &source, const std::string &delimiters)
Definition: StringTools.cc:181
OperationIndex
Definition: OperationIndex.hh:58
TTAMachine::HWOperation::pipeline
ExecutionPipeline * pipeline() const
Definition: HWOperation.cc:201
TTAMachine::ExecutionPipeline
Definition: ExecutionPipeline.hh:55
TTAMachine::ExecutionPipeline::addPortWrite
void addPortWrite(int operand, int start, int duration)
Definition: ExecutionPipeline.cc:167
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
TTAMachine::FunctionUnit::operationPort
virtual FUPort * operationPort(const std::string &name) const
Definition: FunctionUnit.cc:224
OperationPool
Definition: OperationPool.hh:52
OperationIndex::operationCount
int operationCount(const OperationModule &om)
Definition: OperationIndex.cc:363
DSDBManager::MachineConfiguration::architectureID
RowID architectureID
Definition: DSDBManager.hh:79
Operation::numberOfOutputs
virtual int numberOfOutputs() const
Definition: Operation.cc:202
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::AddressSpace::end
virtual ULongWord end() const
Definition: AddressSpace.cc:177
OperationIndex::module
OperationModule & module(int i)
DesignSpaceExplorerPlugin::addParameter
void addParameter(TCEString name, ExplorerPluginParameterType type, bool compulsory=true, TCEString defaultValue="", TCEString description="")
OperationIndex::operationName
std::string operationName(int i, const OperationModule &om)
Definition: OperationIndex.cc:337
TTAMachine::Machine
Definition: Machine.hh:73
VectorLSGenerator::addressSpaces_
TCEString addressSpaces_
Definition: VectorLSGenerator.cc:172