OpenASIP
2.0
|
#include <ProcessorGenerator.hh>
Public Member Functions | |
ProcessorGenerator () | |
virtual | ~ProcessorGenerator () |
void | generateProcessor (const ProGeOptions &options, const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, ICDecoderGeneratorPlugin &plugin, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream) |
const NetlistBlock & | processorTopLevel () const |
const ProGeContext & | generatorContext () const |
TCEString | entityName () const |
Static Public Member Functions | |
static int | iMemAddressWidth (const TTAMachine::Machine &mach) |
static int | iMemWidth (const TTAMachine::Machine &mach, int imemWidthInMAUs) |
static void | removeUnconnectedSockets (TTAMachine::Machine &machine, std::ostream &warningStream) |
Private Member Functions | |
void | validateMachine (const TTAMachine::Machine &machine, std::ostream &errorStream, std::ostream &warningStream) |
void | checkIULatencies (const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, const ICDecoderGeneratorPlugin &plugin) |
void | generateGlobalsPackage (HDL language, const TTAMachine::Machine &machine, int imemWidthInMAUs, const std::string &dstDirectory, ICDecoderGeneratorPlugin &plugin) |
void | generateGCUOpcodesPackage (HDL language, const TTAMachine::Machine &machine, const std::string &dstDirectory) |
Static Private Member Functions | |
static std::string | coreIdString (int i) |
static const NetlistPortGroup * | instructionBus (NetlistBlock &block) |
Private Attributes | |
NetlistBlock * | coreTopBlock_ |
TCEString | entityStr_ |
ProGeContext * | generatorContext_ |
Static Private Attributes | |
static const TCEString | DEFAULT_ENTITY_STR = "tta0" |
Controller class of ProGe.
Acts as a middle-man between user interface, netlist generator, IC/decoder plugin and HDL writers.
Definition at line 74 of file ProcessorGenerator.hh.
ProGe::ProcessorGenerator::ProcessorGenerator | ( | ) |
|
virtual |
|
private |
Checks that the latencies of the HW implementations of the immediate units are compatible with the given IC/GCU generator plugin.
machine | The machine. |
implementation | The machine implementation. |
plugin | The plugin. |
InvalidData | If the latencies are incompatible. |
Definition at line 390 of file ProcessorGenerator.cc.
References __func__, HDB::RFEntry::architecture(), TTAMachine::Machine::Navigator< ComponentType >::count(), Exception::errorMessage(), HDB::RFEntry::hasArchitecture(), IDF::UnitImplementationLocation::hdbFile(), IDF::UnitImplementationLocation::id(), TTAMachine::Machine::immediateUnitNavigator(), implementation, TTAMachine::Machine::Navigator< ComponentType >::item(), IDF::MachineImplementation::iuImplementation(), HDB::RFArchitecture::latency(), machine, TCEString::makeString(), TTAMachine::Component::name(), ProGe::ICDecoderGeneratorPlugin::requiredRFLatencies(), and HDB::HDBManager::rfByEntryID().
Referenced by generateProcessor().
|
staticprivate |
TCEString ProGe::ProcessorGenerator::entityName | ( | ) | const |
Definition at line 524 of file ProcessorGenerator.cc.
References entityStr_.
Referenced by generateGlobalsPackage().
|
private |
Generates the package that defines opcodes of Global Control Unit.
language | The language of the hardware code, VHDL/Verilog |
machine | The machine. |
dstDirectory | The destination directory. |
Definition at line 306 of file ProcessorGenerator.cc.
References FileSystem::DIRECTORY_SEPARATOR, entityStr_, ProGe::CUOpcodeGenerator::generateOpcodePackage(), machine, and ProGe::VHDL.
Referenced by generateProcessor().
|
private |
Generates the package that defines global constants used in processor definition files.
language | The language of the hardware code, VHDL/Verilog |
machine | The machine. |
imemWidthInMAUs | Width of the instruction memory in MAUs. |
dstDirectory | The destination directory. |
plugin | The ICDecoderGeneratorPlugin, which gives us bem and bit info |
IOException | If an IO error occurs. |
Definition at line 230 of file ProcessorGenerator.cc.
References __func__, abortWithError, TTAMachine::Machine::busNavigator(), FileSystem::createFile(), FileSystem::DIRECTORY_SEPARATOR, entityName(), entityStr_, iMemAddressWidth(), TTAMachine::Machine::Navigator< ComponentType >::item(), machine, ProGe::Verilog, ProGe::VHDL, and ProGe::ICDecoderGeneratorPlugin::writeGlobalDefinitions().
Referenced by generateProcessor().
void ProGe::ProcessorGenerator::generateProcessor | ( | const ProGeOptions & | options, |
const TTAMachine::Machine & | machine, | ||
const IDF::MachineImplementation & | implementation, | ||
ICDecoderGeneratorPlugin & | plugin, | ||
int | imemWidthInMAUs, | ||
std::ostream & | errorStream, | ||
std::ostream & | warningStream, | ||
std::ostream & | verboseStream | ||
) |
Generates the processor.
Definition at line 130 of file ProcessorGenerator.cc.
References __func__, ProGe::ProGeContext::adf(), checkIULatencies(), ProGe::BlockSourceCopier::copyProcessorSpecific(), ProGe::BlockSourceCopier::copyShared(), coreTopBlock_, FileSystem::createDirectory(), FileSystem::DIRECTORY_SEPARATOR, entityStr_, FileSystem::fileExists(), IDF::MachineImplementation::FUGenerations(), ProGe::NetlistGenerator::generate(), ProGe::ICDecoderGeneratorPlugin::generate(), generateGCUOpcodesPackage(), generateGlobalsPackage(), generatorContext_, ProGe::BlockSourceCopier::getTemplateInstatiator(), ProGe::ProGeContext::idf(), FUGen::implement(), implementation, TTAMachine::Machine::isRISCVMachine(), machine, options, HDLTemplateInstantiator::replacePlaceholder(), Application::spamVerbose(), validateMachine(), ProGe::ICDecoderGeneratorPlugin::verifyCompatibility(), ProGe::VHDL, ProGe::NetlistVisualization::visualizeBlockTree(), and ProGe::NetlistBlock::write().
Referenced by ProGe::ProGeUI::generateProcessor().
const ProGeContext & ProGe::ProcessorGenerator::generatorContext | ( | ) | const |
Returns the context (adf, idf, entity name, etc.) that is used in the processor generation.
Definition at line 519 of file ProcessorGenerator.cc.
References generatorContext_.
Referenced by ProGe::ProGeUI::generateTestBench().
|
static |
Returns the width of the memory address of instruction memory of the given machine.
If the memory address width set in machine instruction memory address space differ from gcu port widths, the value set in the address space is used. In this case, GCU port widths are changed accordingly.
mach | The machine. |
InvalidData | If the GCU of the machine does not have an address space. |
Definition at line 449 of file ProcessorGenerator.cc.
References TTAMachine::FunctionUnit::addressSpace(), assert, CALL, TTAMachine::Machine::controlUnit(), TTAMachine::AddressSpace::end(), TTAMachine::FunctionUnit::hasOperation(), TTAMachine::ControlUnit::hasReturnAddressPort(), JUMP, TTAMachine::FunctionUnit::operation(), TTAMachine::HWOperation::port(), MathTools::requiredBits(), TTAMachine::ControlUnit::returnAddressPort(), TTAMachine::BaseFUPort::setWidth(), and TTAMachine::BaseFUPort::width().
Referenced by generateGlobalsPackage().
|
static |
Returns the width of the instruction memory of the given machine.
mach | The machine. |
Definition at line 493 of file ProcessorGenerator.cc.
References TTAMachine::FunctionUnit::addressSpace(), assert, TTAMachine::Machine::controlUnit(), and TTAMachine::AddressSpace::width().
|
staticprivate |
Definition at line 319 of file ProcessorGenerator.cc.
References assert, ProGe::INSTRUCTION_LINE, and ProGe::BaseNetlistBlock::portGroupsBy().
const NetlistBlock & ProGe::ProcessorGenerator::processorTopLevel | ( | ) | const |
Returns Toplevel block of the core.
Definition at line 510 of file ProcessorGenerator.cc.
References coreTopBlock_.
Referenced by ProGe::ProGeUI::generateTestBench(), and ProGe::ProGeUI::integrateProcessor().
|
static |
Definition at line 529 of file ProcessorGenerator.cc.
References machine, and MachineResourceModifier::removeNotConnectedSockets().
Referenced by ProGe::ProGeUI::generateProcessor().
|
private |
Validates the machine for compatibility with the given block implementations.
If the target architecture contains errors (incomplete definition) or if its structure is not compatible with this HDL generator, this method throws IllegalMachine exception. For less serious errors (such as non-critical bit width discrepancies), warning messages are written to the given stream.
machine | The machine to validate. |
errorStream | Output stream where errors are printed |
warningStream | Output stream where warnings are printed |
IllegalMachine | If there is a fundamental error in the machine. |
Definition at line 341 of file ProcessorGenerator.cc.
References __func__, MachineValidator::DIFFERENT_PORT_FOR_JUMP_AND_CALL, MachineValidatorResults::error(), MachineValidatorResults::errorCount(), MachineValidator::GCU_AS_MISSING, MachineValidator::GCU_MISSING, MachineValidator::IMEM_ADDR_WIDTH_DIFFERS_FROM_RA_AND_PC, machine, MachineValidator::PC_AND_RA_PORTS_HAVE_UNEQUAL_WIDTH, MachineValidator::PC_PORT_MISSING, MachineValidator::RA_PORT_MISSING, MachineValidator::USED_IO_NOT_BOUND, and MachineValidator::validate().
Referenced by generateProcessor().
|
private |
Definition at line 116 of file ProcessorGenerator.hh.
Referenced by generateProcessor(), processorTopLevel(), and ~ProcessorGenerator().
|
staticprivate |
Definition at line 120 of file ProcessorGenerator.hh.
|
private |
Definition at line 117 of file ProcessorGenerator.hh.
Referenced by entityName(), generateGCUOpcodesPackage(), generateGlobalsPackage(), and generateProcessor().
|
private |
Definition at line 118 of file ProcessorGenerator.hh.
Referenced by generateProcessor(), and generatorContext().