OpenASIP
2.0
|
#include <POMValidator.hh>
Public Types | |
enum | ErrorCode { CONNECTION_MISSING, LONG_IMMEDIATE_NOT_SUPPORTED, SIMULATION_NOT_POSSIBLE, COMPILED_SIMULATION_NOT_POSSIBLE } |
Error codes for different errors. More... | |
Public Member Functions | |
POMValidator (const TTAProgram::Program &program) | |
virtual | ~POMValidator () |
POMValidatorResults * | validate (const std::set< ErrorCode > &errorsToCheck) |
Private Member Functions | |
void | checkConnectivity (POMValidatorResults &results) |
void | checkLongImmediates (POMValidatorResults &results) |
void | checkSimulatability (POMValidatorResults &results) |
void | checkCompiledSimulatability (POMValidatorResults &results) |
Private Attributes | |
const TTAProgram::Program::InstructionVector | instructions_ |
The program's instructions in a quickly accessed vector. More... | |
POMValidator validates a program object model against a target processor architecture using varoius criteria.
Definition at line 49 of file POMValidator.hh.
Error codes for different errors.
Definition at line 53 of file POMValidator.hh.
POMValidator::POMValidator | ( | const TTAProgram::Program & | program | ) |
|
virtual |
|
private |
Checks for problems specific to compiled simulation only.
Used to check if the program cannot be simulated with the compiled simulator.
results | POMValidator results where the error messages are added. |
Definition at line 325 of file POMValidator.cc.
References POMValidatorResults::addError(), TTAProgram::Instruction::address(), COMPILED_SIMULATION_NOT_POSSIBLE, TTAProgram::Move::destination(), instructions_, Operation::isClocked(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isOpcodeSetting(), TTAProgram::Address::location(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), Operation::name(), TTAProgram::Terminal::operation(), and Conversion::toString().
Referenced by validate().
|
private |
Checks if the target machine has connectivity needed for program moves.
results | POMValidator results where the error messages are added. |
Definition at line 108 of file POMValidator.cc.
References POMValidatorResults::addError(), TTAProgram::Instruction::address(), TTAProgram::Move::bus(), CONNECTION_MISSING, TTAProgram::Move::destination(), TTAMachine::Port::inputSocket(), instructions_, TTAMachine::Socket::isConnectedTo(), TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isGPR(), TTAProgram::Terminal::isImmediateRegister(), TTAProgram::Address::location(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), TTAMachine::Port::name(), TTAMachine::Component::name(), TTAMachine::Port::outputSocket(), TTAMachine::Port::parentUnit(), TTAProgram::Terminal::port(), TTAProgram::Move::source(), and Conversion::toString().
Referenced by validate().
|
private |
Checks long immediate assignments.
results | POMValidator results where the error messages are added. |
Definition at line 192 of file POMValidator.cc.
References POMValidatorResults::addError(), TTAProgram::Instruction::address(), TTAProgram::Immediate::destination(), TTAMachine::ImmediateUnit::extensionMode(), TTAProgram::Instruction::immediate(), TTAProgram::Instruction::immediateCount(), TTAProgram::Terminal::immediateUnit(), instructions_, TTAProgram::Instruction::instructionTemplate(), INT_WORD_SIZE, SimValue::intValue(), TTAProgram::Terminal::isImmediateRegister(), TTAProgram::Address::location(), LONG_IMMEDIATE_NOT_SUPPORTED, TTAMachine::Component::name(), MathTools::requiredBits(), MathTools::requiredBitsSigned(), TTAMachine::InstructionTemplate::supportedWidth(), Conversion::toString(), SimValue::unsignedValue(), TTAProgram::TerminalImmediate::value(), TTAProgram::Immediate::value(), and SimValue::width().
Referenced by validate().
|
private |
Checks that all operations in the program have known behaviour and can be simulated.
results | POMValidator results where the error messages are added. |
Definition at line 281 of file POMValidator.cc.
References POMValidatorResults::addError(), TTAProgram::Instruction::address(), Operation::canBeSimulated(), ContainerTools::containsValue(), TTAProgram::Move::destination(), instructions_, TTAProgram::Terminal::isFUPort(), TTAProgram::Terminal::isOpcodeSetting(), TTAProgram::Address::location(), TTAProgram::Instruction::move(), TTAProgram::Instruction::moveCount(), Operation::name(), TTAProgram::Terminal::operation(), SIMULATION_NOT_POSSIBLE, and Conversion::toString().
Referenced by validate().
POMValidatorResults * POMValidator::validate | ( | const std::set< ErrorCode > & | errorsToCheck | ) |
Checks the program against the target machine for given error check set.
errorsToCheck | Set of error codes which are checked. |
Definition at line 79 of file POMValidator.cc.
References assert, checkCompiledSimulatability(), checkConnectivity(), checkLongImmediates(), checkSimulatability(), COMPILED_SIMULATION_NOT_POSSIBLE, CONNECTION_MISSING, LONG_IMMEDIATE_NOT_SUPPORTED, and SIMULATION_NOT_POSSIBLE.
Referenced by SimulatorFrontend::loadProgram().
|
private |
The program's instructions in a quickly accessed vector.
Definition at line 76 of file POMValidator.hh.
Referenced by checkCompiledSimulatability(), checkConnectivity(), checkLongImmediates(), and checkSimulatability().