Go to the documentation of this file.
85 evaluateResult_(true),
86 preserveMinimalOpset_(true) {
92 addParameter(tpefPN_,
STRING,
false,
"");
93 addParameter(addOnlyPN_,
BOOL,
false,
95 addParameter(evaluatePN_,
BOOL,
false,
97 addParameter(preserveMinOpsPN_,
BOOL,
false,
124 virtual std::vector<RowID>
127 std::vector<RowID> result;
143 std::ostringstream msg(std::ostringstream::out);
150 removeAllConnections(*mach);
159 std::set<RowID>::const_iterator iter = appIDs.begin();
160 if (iter == appIDs.end()) {
164 for (; iter != appIDs.end(); iter++) {
170 std::string msg =
"SimpleICOptimizer: Schedule "
171 "failed for program: " +
177 addConnections(*mach, *
program);
180 std::ostringstream msg(std::ostringstream::out);
191 addConnections(*mach, *
program);
193 std::ostringstream msg(std::ostringstream::out);
194 msg <<
"Error while loading the program in "
195 <<
"SimpleICOptimizer:" << endl
207 std::ostringstream msg(std::ostringstream::out);
208 msg <<
"Error while adding ADF to the dsdb. "
209 <<
"ADF probably too big." << endl;
222 "RemoveUnconnectedComponents", &db());
227 std::vector<RowID> cleanedTempConfIDs =
228 removeUnconnected->
explore(tempConfID);
229 delete removeUnconnected;
230 removeUnconnected = NULL;
231 if (cleanedTempConfIDs.size() < 1) {
232 std::string errorMsg =
"SimpleICOptimizer plugin: "
233 "RemoveUnconnectedComponents plugin failed to produce"
248 if (fixIntRegisters(*cleanedMach)) {
257 createImplementation(newConf, newConf);
264 if (evaluateResult_) {
267 if (evaluate(newConf, estimates, estimate)) {
269 result.push_back(confID);
272 std::ostringstream msg(std::ostringstream::out);
273 msg <<
"SimpleICOptimizer plugin couldn't evaluate "
274 <<
"generated config - nothing done." << endl;
280 result.push_back(confID);
284 std::ostringstream msg(std::ostringstream::out);
285 msg <<
"Error while using SimpleICOptimizer:" << endl
315 readOptionalParameter(tpefPN_, tpef_);
316 readOptionalParameter(addOnlyPN_, addOnly_);
317 readOptionalParameter(evaluatePN_, evaluateResult_);
318 readOptionalParameter(preserveMinOpsPN_, preserveMinimalOpset_);
333 if (!preserveMinimalOpset_) {
334 for (
int i = 0; i < socketNav.
count(); i++) {
336 for (
int bus = 0; bus < busNav.
count(); bus++) {
342 for (
int i = 0; i < socketNav.
count(); i++) {
344 std::set<std::string> ignoreFUNames;
345 std::set<std::string> ignoreRFNames;
347 for (
int si = 0; si < socket->
portCount(); ++si) {
349 if (
dynamic_cast<FUPort*
>(port)) {
351 }
else if (
dynamic_cast<RFPort*
>(port)) {
361 if (!ignoreFUNames.empty()) {
363 if (!ignoreRFNames.empty()) {
366 for (
int bus = 0; bus < busNav.
count(); bus++)
372 for (
int bus = 0; bus < busNav.
count(); bus++) {
377 }
else if (!ignoreRFNames.empty()) {
379 for (
int bus = 0; bus < busNav.
count(); bus++) {
384 for (
int bus = 0; bus < busNav.
count(); bus++) {
404 verboseLog(
"Failed to add missing integer registers to the"
437 for (
int m = 0; m < instruction.
moveCount(); m++) {
439 std::string busName = move.
bus().
name();
440 std::string sourceName =
"";
447 std::string destinationName =
449 Bus* bus = busNav.
item(busName);
452 if (sourceName !=
"") {
463 Socket* socket = socketNav.
item(destinationName);
bool checkWithIgnore(const TTAMachine::Machine &machine, const std::set< std::string > &ignoreFUName) const
TTAMachine::Socket & destinationSocket() const
bool checkWithIgnore(const TTAMachine::Machine &mach, const std::set< std::string > &ignoreRFs) const
virtual bool requiresApplication() const
Port * port(int index) const
const std::string applicationPath() const
virtual TCEString name() const
bool preserveMinimalOpset_
respect minimal opset when removing connections
int procedureCount() const
TTAMachine::Machine * architecture(RowID id) const
void addConnections(TTAMachine::Machine &mach, Program &prog)
virtual bool requiresStartingPointArchitecture() const
bool addOnly_
can we remove connections
static const std::string evaluatePN_
static const std::string tpefDefaultPN_
int RowID
Type definition of row ID in relational databases.
const TTAMachine::Bus & bus() const
static const std::string addOnlyPN_
virtual Segment * segment(int index) const
static std::string toString(const T &source)
virtual bool producesArchitecture() const
#define assert(condition)
TTAMachine::Socket & sourceSocket() const
TTAProgram::Program * schedule(const std::string applicationFile, TTAMachine::Machine &machine, TCEString paramOptions="-O3")
static const std::string tpefPN_
virtual bool requiresHDB() const
void attachBus(Segment &bus)
const std::string PLUGIN_DESCRIPTION
#define EXPORT_DESIGN_SPACE_EXPLORER_PLUGIN(PLUGIN_NAME__)
#define verboseLogC(text, neededVerbosity)
virtual int instructionCount() const
bool evaluateResult_
evaluate the result(s)
virtual void giveParameter(const std::string &name, const std::string &value)
void removeAllConnections(TTAMachine::Machine &mach)
std::string errorMessageStack(bool messagesOnly=false) const
static const std::string preserveMinOpsPN_
static DesignSpaceExplorerPlugin * loadExplorerPlugin(const std::string &pluginName, DSDBManager *dsdb=NULL)
virtual SocketNavigator socketNavigator() const
void setDirection(Direction direction)
bool isConnectedTo(const Bus &bus) const
bool fixIntRegs(TTAMachine::Machine &mach) const
void detachBus(Segment &bus)
std::string errorMessage() const
RowID addConfiguration(const MachineConfiguration &conf)
RowID addArchitecture(const TTAMachine::Machine &mom)
MachineConfiguration configuration(RowID id) const
virtual std::vector< RowID > explore(const RowID &startPointConfigurationID, const unsigned int &maxIter=0)
find Finds info of the inner loops in the false
virtual std::vector< RowID > explore(const RowID &startPointConfigurationID, const unsigned int &)
virtual BusNavigator busNavigator() const
static Program * loadFromTPEF(const std::string &tpefFileName, const TTAMachine::Machine &theMachine)
std::string tpef_
name of the tpef file
virtual Instruction & instructionAtIndex(int index) const
Terminal & source() const
ComponentType * item(int index) const
find Finds info of the inner loops in the program
std::string applicationPath(RowID id) const
bool checkIntRegs(const TTAMachine::Machine &mach) const
virtual bool isImmediate() const
Procedure & procedure(int index) const
virtual int segmentCount() const
virtual bool requiresSimulationData() const
bool canFixIntRegs(const TTAMachine::Machine &mach) const
std::set< RowID > applicationIDs() const
Unit * parentUnit() const
bool fixIntRegisters(TTAMachine::Machine &mach)