Go to the documentation of this file.
34 #ifndef TTA_DEFAULT_DECODER_GENERATOR_HH
35 #define TTA_DEFAULT_DECODER_GENERATOR_HH
59 class InstructionTemplate;
60 class BaseRegisterFile;
67 class NetlistGenerator;
106 const std::string& dstDirectory);
121 typedef std::set<TTAMachine::Bus*>
BusSet;
125 typedef std::map<GlockBitType, const TTAMachine::Unit*>
127 typedef std::map<const TTAMachine::Unit*, GlockReqBitType>
134 std::string comment)
const;
136 std::string sigName,
int width)
const;
148 std::ostream& stream);
160 std::ostream& stream)
const;
177 std::ostream& stream)
const;
180 std::ostream& stream)
const;
183 std::ostream& stream)
const;
186 std::ostream& stream)
const;
189 std::ostream& stream)
const;
192 std::ostream& stream)
const;
197 std::ostream& stream)
const;
199 const std::set<TTAMachine::Socket*> outputSockets,
200 std::ostream& stream)
const;
207 std::ostream& stream,
210 const std::set<TTAMachine::PortGuard*>& guardSet,
213 const std::set<TTAMachine::RegisterGuard*>& guardSet,
222 static std::string
simmDataPort(
const std::string& busName);
228 const std::string& fuName,
229 const std::string& portName);
231 const std::string& fuName,
232 const std::string& portName);
236 const std::string& rfName,
237 const std::string& portName);
239 const std::string& rfName,
240 const std::string& portName,
243 const std::string& rfName,
244 const std::string& portName,
247 const std::string& rfName,
248 const std::string& portName);
250 const std::string& unitName,
251 const std::string& portName);
253 const std::string& unitName,
254 const std::string& portName);
256 const std::string& unitName,
257 const std::string& portName);
259 const std::string& unitName,
260 const std::string& portName);
261 static std::string
iuWritePort(
const std::string& iuName);
264 const std::string& unitName);
266 const std::string& unitName);
268 const std::string& unitName);
270 const std::string& unitName);
283 static std::string
immSlotSignal(
const std::string& immSlot);
284 static std::string
squashSignal(
const std::string& busName);
287 static std::string
gcuDataPort(
const std::string& nameInADF);
298 const std::string& socketName);
305 const std::string& iTempName)
const;
315 static std::string
indentation(
unsigned int level);
316 bool sacEnabled(
const std::string& rfName)
const;
std::set< int > requiredRFLatencies(const TTAMachine::ImmediateUnit &iu) const
static std::string socketDataCntrlSignalName(const std::string &name)
void setGenerateLockTrace(bool generate)
int opcode(const TTAMachine::HWOperation &operation) const
const TTAMachine::Machine & machine_
The machine.
void writeSquashSignalGenerationProcesses(std::ostream &stream) const
void setLockTraceStartingCycle(unsigned int startCycle)
void writeRFCntrlSignals(std::ostream &stream)
static int simmPortWidth(const TTAMachine::Bus &bus)
std::string busCntrlSignalPinOfSocket(const TTAMachine::Socket &socket, const TTAMachine::Bus &bus) const
static std::string socketDataControlPort(const std::string &name)
const CentralizedControlICGenerator & icGenerator_
The IC generator.
static std::string rfLoadCntrlPort(const std::string &rfName, const std::string &portName)
static std::string iuWriteOpcodeCntrlPort(const std::string &unitName)
void completeDecoderBlock(const ProGe::NetlistGenerator &nlGenerator, ProGe::NetlistBlock &coreBlock)
void writeLongImmediateWriteProcess(std::ostream &stream) const
void writeSocketCntrlSignals(std::ostream &stream)
static std::string dstFieldSignal(const std::string &busName)
void writeImmediateSlotSignals(std::ostream &stream) const
TTAMachine::Machine * machine
the architecture definition of the estimated processor
ProGe::NetlistBlock * decoderBlock_
The instruction decoder block in the netlist.
static std::string srcFieldSignal(const std::string &busName)
void generateInstructionDecoder(const ProGe::NetlistGenerator &nlGenerator, const std::string &dstDirectory)
std::set< TTAMachine::Bus * > BusSet
Set type for buses.
UnitGlockReqBitMapType unitGlockReqBitMap_
Maps TTA Units to associated glock request port bits.
static BusSet connectedBuses(const TTAMachine::Socket &socket)
static std::string busMuxEnableSignal(const TTAMachine::Bus &bus)
void addLockReqPortToDecoder()
void writeMoveFieldSignals(std::ostream &stream) const
std::map< GlockBitType, const TTAMachine::Unit * > UnitGlockBitMapType
static std::string iuWriteLoadCntrlSignal(const std::string &unitName)
void writeDismemberingAndITDecompression(std::ostream &stream) const
static std::string iuWritePort(const std::string &iuName)
static std::string gcuDataPort(const std::string &nameInADF)
unsigned int lockTraceStartingCycle_
The starting cycle for bus tracing.
void writeInstructionTemplateProcedures(const ProGe::HDL language, const TTAMachine::InstructionTemplate &iTemp, int indLevel, std::ostream &stream) const
void verifyCompatibility() const
void addGlockPortToDecoder()
void writeInstructionDecoder(std::ostream &stream)
static std::string busMuxEnableRegister(const TTAMachine::Bus &bus)
void writeControlRulesOfFUOutputPort(const TTAMachine::BaseFUPort &port, std::ostream &stream) const
void writeControlRulesOfFUInputPort(const TTAMachine::BaseFUPort &port, std::ostream &stream) const
static std::string indentation(unsigned int level)
static std::string iuWriteLoadCntrlPort(const std::string &unitName)
static std::string fuOpcodeCntrlPort(const std::string &fu)
static std::string socketBusControlPort(const std::string &name)
void writeSimmDataSignal(const TTAMachine::Bus &bus, std::ostream &stream) const
std::vector< std::string > registerBits
std::string instructionTemplateCondition(const ProGe::HDL language, const std::string &iTempName) const
bool generateDebugger_
Generate debugger signals?
void writeBusControlRulesOfOutputSocket(const TTAMachine::Socket &socket, std::ostream &stream) const
static std::string rfOpcodeFromSrcOrDstField(const ProGe::HDL language, const SocketEncoding &socketEnc, const PortCode &code)
static std::string guardFieldSignal(const std::string &busName)
UnitGlockBitMapType unitGlockBitMap_
Maps connected glock port bits to associated TTA Units.
TTAMachine::RegisterGuard & findGuard(const GPRGuardEncoding &encoding) const
static void writeSquashSignalSubstitution(const ProGe::HDL language, const TTAMachine::Bus &bus, const GuardEncoding &enc, const TTAMachine::Guard &guard, std::ostream &stream, int indLevel)
static std::string simmControlPort(const std::string &busName)
static std::string iuReadOpcodeCntrlSignal(const std::string &unitName, const std::string &portName)
std::string writeNOPEncodingVHDL() const
static std::string busMuxCntrlSignal(const TTAMachine::Bus &bus)
static std::string rfOpcodeCntrlPort(const std::string &rfName, const std::string &portName)
void writeControlRulesOfRFWritePort(const TTAMachine::RFPort &port, std::ostream &stream) const
static std::string fuLoadCntrlPort(const std::string &fuName, const std::string &portName)
void writeInstructionDismembering(std::ostream &stream) const
static std::string guardPortName(const TTAMachine::Guard &guard)
void writeRulesForSourceControlSignals(std::ostream &stream) const
static const std::string GLOCK_PORT_NAME
static std::string iuReadLoadCntrlPort(const std::string &unitName, const std::string &portName)
virtual ~DefaultDecoderGenerator()
void writePipelineFillProcess(std::ostream &stream) const
static bool needsDataControl(const TTAMachine::Socket &socket)
void writeBusMuxControlLogic(const TTAMachine::Bus &bus, const std::set< TTAMachine::Socket * > outputSockets, std::ostream &stream) const
static std::string iuWriteOpcodeCntrlSignal(const std::string &unitName)
static std::string iuReadOpcodeCntrlPort(const std::string &unitName, const std::string &portName)
static std::string socketEncodingCondition(const ProGe::HDL language, const SlotField &srcField, const std::string &socketName)
void writeBusControlRulesOfSImmSocketOfBus(const TTAMachine::Bus &bus, std::ostream &stream) const
static int busControlWidth(const TTAMachine::Socket &socket)
static std::string fuLoadSignalName(const std::string &fuName, const std::string &portName)
int glockRequestWidth() const
void writeSquashSignals(std::ostream &stream) const
const ProGe::NetlistGenerator * nlGenerator_
The netlist generator.
void writeFUCntrlSignals(std::ostream &stream)
static std::string simmCntrlSignalName(const std::string &busName)
void writeFullNOPConstant(std::ostream &stream) const
static int rfOpcodeWidth(const TTAMachine::BaseRegisterFile &rf)
static std::string moveFieldSignal(const std::string &busName)
void writeMainDecodingProcess(std::ostream &stream) const
static std::string rfOpcodeSignalName(const std::string &rfName, const std::string &portName, bool async=false)
void SetHDL(ProGe::HDL language)
const BinaryEncoding & bem_
The binary encoding map.
void writeRulesForDestinationControlSignals(std::ostream &stream) const
void writeSquashSignalGenerationProcess(const TTAMachine::Bus &bus, std::ostream &stream) const
void writeControlRegisterMappings(std::ostream &stream) const
void writeComment(std::ostream &stream, int indent, std::string comment) const
void writeInstructionDecoding(std::ostream &stream) const
void setSyncReset(bool value)
void writeLongImmediateTagSignal(std::ostream &stream) const
DataType
Data types of hardware ports.
void setGenerateBusEnable(bool value)
static const std::string RISCV_SIMM_PORT_IN_NAME
static int dataControlWidth(const TTAMachine::Socket &socket)
static std::string rfLoadSignalName(const std::string &rfName, const std::string &portName, bool async=false)
static std::string squashSignal(const std::string &busName)
static std::string fuOpcodeSignalName(const std::string &fu)
static std::string iuReadLoadCntrlSignal(const std::string &unitName, const std::string &portName)
void writeRFSRAMDecodingProcess(std::ostream &stream) const
int GlockBitType
Types for mapping global lock and global lock request signals.
void writePipelineFillSignals(std::ostream &stream) const
static std::string busMuxCntrlRegister(const TTAMachine::Bus &bus)
static std::string socketBusCntrlSignalName(const std::string &name)
static std::string immSlotSignal(const std::string &immSlot)
void writeResettingOfControlRegisters(std::ostream &stream) const
HDL
HDLs supported by ProGe.
void setGenerateDebugger(bool generate)
std::map< const TTAMachine::Unit *, GlockReqBitType > UnitGlockReqBitMapType
static bool needsBusControl(const TTAMachine::Socket &socket)
bool sacEnabled(const std::string &rfName) const
int opcodeWidth(const TTAMachine::FunctionUnit &fu) const
void writeSignalDeclaration(std::ostream &stream, ProGe::DataType type, std::string sigName, int width) const
void writeGlockHandlingSignals(std::ostream &stream) const
DefaultDecoderGenerator(const TTAMachine::Machine &machine, const BinaryEncoding &bem, const CentralizedControlICGenerator &icGenerator)
static std::string portCodeCondition(const ProGe::HDL language, const SocketEncoding &socketEnc, const PortCode &code)
std::vector< std::string > registerVectors
Bookkeeping for reset-needing signals.
void writeLockDumpCode(std::ostream &stream) const
void writeDecompressSignalsVHDL(std::ostream& stream) const; TBR
static std::string simmDataSignalName(const std::string &busName)
static bool containsSimilarGuard(const std::set< TTAMachine::PortGuard * > &guardSet, const TTAMachine::PortGuard &guard)
void writeGlockMapping(std::ostream &stream) const
bool generateLockTrace_
Tells whether to generate global lock tracing code.
bool generateBusEnable_
Bus enable signals for bustrace.
static std::string simmDataPort(const std::string &busName)
bool generateAlternateGlockReqHandling_
The flag to generate global lock request handling in decoder. False means delegating the lock request...
static std::string iuWriteSignal(const std::string &iuName)
int glockPortWidth() const
void writeControlRulesOfRFReadPort(const TTAMachine::RFPort &port, std::ostream &stream) const
void setGenerateNoLoopbackGlock(bool generate)
bool syncReset_
Reset synchronously (otherwise asynchronous)