OpenASIP
2.0
|
#include <ConflictDetectionCodeGenerator.hh>
Public Member Functions | |
ConflictDetectionCodeGenerator (const TTAMachine::Machine &machine, const CompiledSimSymbolGenerator &, bool conflictDetectionEnabled=false) | |
virtual | ~ConflictDetectionCodeGenerator () |
std::string | includes () |
std::string | symbolDeclaration (const TTAMachine::FunctionUnit &fu) |
std::string | extraInitialization () |
std::string | notifyOfConflicts () |
std::string | updateSymbolDeclarations () |
std::string | advanceClockCode () |
std::string | detectConflicts (const TTAMachine::HWOperation &op) |
bool | conflictDetectionEnabled () const |
Private Types | |
typedef std::map< std::string, std::string > | ConflictDetectorObjectNameMap |
1=fu.name(), 2=conflict detector object name More... | |
Private Member Functions | |
ConflictDetectionCodeGenerator (const ConflictDetectionCodeGenerator &) | |
Copying not allowed. More... | |
ConflictDetectionCodeGenerator & | operator= (const ConflictDetectionCodeGenerator &) |
Assignment not allowed. More... | |
Private Attributes | |
const TTAMachine::Machine & | machine_ |
The machine. More... | |
bool | conflictDetectionEnabled_ |
True, if the conflict detection is enabled. More... | |
std::string | conflictDetectorType_ |
The FU resource conflict detector used, empty string if disabled. More... | |
std::string | conflictDetectorMethod_ |
The method in the resource conflict detector used to detect conflicts, empty string if disabled. More... | |
std::string | conflictDetectorAdvanceCycle_ |
The method to be called on the conflict detector on cycle advance. More... | |
std::string | conflictDetectorExtraInitMethod_ |
A method to be called on the conflict detector for initialization, empty if none. More... | |
ConflictDetectorObjectNameMap | conflictDetectors_ |
The resource conflict detector object name for each FU if any. More... | |
const CompiledSimSymbolGenerator & | symbolGen_ |
Symbol generator. More... | |
A class that generates C/C++ code for FU conflict detection cases
Used for the compiled simulation
Definition at line 67 of file ConflictDetectionCodeGenerator.hh.
|
private |
1=fu.name(), 2=conflict detector object name
Definition at line 109 of file ConflictDetectionCodeGenerator.hh.
ConflictDetectionCodeGenerator::ConflictDetectionCodeGenerator | ( | const TTAMachine::Machine & | machine, |
const CompiledSimSymbolGenerator & | symbolGenerator, | ||
bool | conflictDetectionEnabled = false |
||
) |
The constructor.
Gets the conflict detection settings and initializes the generator
machine | The machine model |
Definition at line 57 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled(), conflictDetectionEnabled_, conflictDetectorAdvanceCycle_, conflictDetectorExtraInitMethod_, conflictDetectorMethod_, conflictDetectors_, CompiledSimSymbolGenerator::conflictDetectorSymbol(), conflictDetectorType_, TTAMachine::Machine::Navigator< ComponentType >::count(), Environment::environmentVariable(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Machine::Navigator< ComponentType >::item(), Application::logStream(), machine_, TTAMachine::Component::name(), TTAMachine::FunctionUnit::needsConflictDetection(), and symbolGen_.
|
virtual |
|
private |
Copying not allowed.
string ConflictDetectionCodeGenerator::advanceClockCode | ( | ) |
Generates code for a function that advances clocks of each conflict detector
Definition at line 234 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_, conflictDetectorAdvanceCycle_, and conflictDetectors_.
Referenced by CompiledSimCodeGenerator::generateAdvanceClockCode().
bool ConflictDetectionCodeGenerator::conflictDetectionEnabled | ( | ) | const |
Returns a boolean describing if the conflict detection is enabled or not
Definition at line 288 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_.
Referenced by ConflictDetectionCodeGenerator(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), and CompiledSimCodeGenerator::generateInstruction().
string ConflictDetectionCodeGenerator::detectConflicts | ( | const TTAMachine::HWOperation & | op | ) |
Generates code for detecting an FU pipeline resource conflicts.
op | the triggered operation |
Definition at line 257 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_, conflictDetectorMethod_, conflictDetectors_, TTAMachine::HWOperation::name(), TTAMachine::Component::name(), TTAMachine::FunctionUnit::operation(), TTAMachine::FunctionUnit::operationCount(), and TTAMachine::HWOperation::parentUnit().
Referenced by CompiledSimCodeGenerator::generateInstruction().
string ConflictDetectionCodeGenerator::extraInitialization | ( | ) |
Generates exra initialization call for conflict detectors that require a one
Definition at line 174 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_, conflictDetectorExtraInitMethod_, and conflictDetectors_.
Referenced by CompiledSimCodeGenerator::generateConstructorCode().
string ConflictDetectionCodeGenerator::includes | ( | ) |
Generates code for including the conflict detectors
Definition at line 139 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_.
Referenced by CompiledSimCodeGenerator::generateHeaderAndMainCode().
string ConflictDetectionCodeGenerator::notifyOfConflicts | ( | ) |
Generates code for notifying of detected conflicts
Definition at line 192 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_.
Referenced by CompiledSimCodeGenerator::generateConstructorCode().
|
private |
Assignment not allowed.
string ConflictDetectionCodeGenerator::symbolDeclaration | ( | const TTAMachine::FunctionUnit & | fu | ) |
Creates symbol declaration code for the given FU's conflict detectors
fu | FU to create the conflict detector for |
Definition at line 156 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_, CompiledSimSymbolGenerator::conflictDetectorSymbol(), conflictDetectorType_, TTAMachine::FunctionUnit::needsConflictDetection(), and symbolGen_.
Referenced by CompiledSimCodeGenerator::generateHeaderAndMainCode().
string ConflictDetectionCodeGenerator::updateSymbolDeclarations | ( | ) |
Generates code for notifying of detected conflicts
Definition at line 213 of file ConflictDetectionCodeGenerator.cc.
References conflictDetectionEnabled_, and conflictDetectors_.
Referenced by CompiledSimCodeGenerator::updateDeclaredSymbolsList().
|
private |
True, if the conflict detection is enabled.
Definition at line 95 of file ConflictDetectionCodeGenerator.hh.
Referenced by advanceClockCode(), ConflictDetectionCodeGenerator(), conflictDetectionEnabled(), detectConflicts(), extraInitialization(), includes(), notifyOfConflicts(), symbolDeclaration(), and updateSymbolDeclarations().
|
private |
The method to be called on the conflict detector on cycle advance.
Definition at line 103 of file ConflictDetectionCodeGenerator.hh.
Referenced by advanceClockCode(), and ConflictDetectionCodeGenerator().
|
private |
A method to be called on the conflict detector for initialization, empty if none.
Definition at line 106 of file ConflictDetectionCodeGenerator.hh.
Referenced by ConflictDetectionCodeGenerator(), and extraInitialization().
|
private |
The method in the resource conflict detector used to detect conflicts, empty string if disabled.
Definition at line 101 of file ConflictDetectionCodeGenerator.hh.
Referenced by ConflictDetectionCodeGenerator(), and detectConflicts().
|
private |
The resource conflict detector object name for each FU if any.
Definition at line 111 of file ConflictDetectionCodeGenerator.hh.
Referenced by advanceClockCode(), ConflictDetectionCodeGenerator(), detectConflicts(), extraInitialization(), and updateSymbolDeclarations().
|
private |
The FU resource conflict detector used, empty string if disabled.
Definition at line 98 of file ConflictDetectionCodeGenerator.hh.
Referenced by ConflictDetectionCodeGenerator(), and symbolDeclaration().
|
private |
The machine.
Definition at line 92 of file ConflictDetectionCodeGenerator.hh.
Referenced by ConflictDetectionCodeGenerator().
|
private |
Symbol generator.
Definition at line 114 of file ConflictDetectionCodeGenerator.hh.
Referenced by ConflictDetectionCodeGenerator(), and symbolDeclaration().