Go to the documentation of this file.
38 #include <boost/format.hpp>
96 using namespace ProGe;
116 const string BZ =
"bz";
160 icGenerator_(icGenerator),
163 generateLockTrace_(
false),
165 generateDebugger_(
false),
166 lockTraceStartingCycle_(1),
167 generateAlternateGlockReqHandling_(
false),
169 unitGlockReqBitMap_() {}
234 for (
int i = 0; i < busNav.
count(); i++) {
240 simmCntrlPort(bus->
name());
255 for (
int i = 0; i < socketNav.
count(); i++) {
258 (socket->
direction() == Socket::OUTPUT)) {
286 for (
int i = 0; i < fuNav.
count(); i++) {
288 for (
int i = 0; i < fu->
portCount(); i++) {
312 for (
int i = 0; i < gcu->
portCount(); i++) {
330 for (
int i = 0; i < rfNav.
count(); i++) {
332 for (
int i = 0; i < rf->
portCount(); i++) {
360 for (
int i = 0; i < iuNav.
count(); i++) {
364 for (
int i = 0; i < iu->
portCount(); i++) {
368 std::string portName =
412 std::set<PortGuard*> generatedPortGuards;
413 std::set<RegisterGuard*> generatedRegGuards;
414 for (
int i = 0; i < busNav.
count(); i++) {
420 if (portGuard != NULL) {
422 generatedPortGuards, *portGuard)) {
433 generatedPortGuards.insert(portGuard);
434 }
else if (regGuard != NULL) {
436 generatedRegGuards, *regGuard)) {
449 generatedRegGuards.insert(regGuard);
472 if (lockReqWidth == 0) {
486 for (
int i = 0; i < fuNav.
count(); i++) {
494 netlist.
connect(*lockReqPort, glockReqPort, bitToConnect, 0, 1);
511 if (glockWidth == 0) {
514 int bitToConnect = 0;
523 for (
int i = 0; i < fuNav.
count(); i++) {
531 assert(bitToConnect < glockWidth);
532 netlist.
connect(*decGlockPort, glockPort, bitToConnect, 0, 1);
539 for (
int i = 0; i < rfNav.
count(); i++) {
547 assert(bitToConnect < glockWidth);
548 netlist.
connect(*decGlockPort, glockPort, bitToConnect, 0, 1);
555 for (
int i = 0; i < iuNav.
count(); i++) {
563 assert(bitToConnect < glockWidth);
564 netlist.
connect(*decGlockPort, glockPort, bitToConnect, 0, 1);
590 for (
int i = 0; i < fuNav.
count(); i++) {
617 for (
int i = 0; i < fuNav.
count(); i++) {
629 for (
int i = 0; i < rfNav.
count(); i++) {
641 for (
int i = 0; i < iuNav.
count(); i++) {
668 const std::string& dstDirectory) {
671 string iDecoderFile = dstDirectory
676 string errorMsg =
"Unable to create file " + iDecoderFile;
679 std::ofstream decoderStream(
680 iDecoderFile.c_str(), std::ofstream::out);
682 decoderStream.close();
694 int acceptableLatencies[] = {0, 1};
695 return std::set<int>(acceptableLatencies, acceptableLatencies + 2);
715 supportedOps.insert(riscvOps.begin(), riscvOps.end());
718 cuOps.begin(), cuOps.end(), supportedOps.begin(), supportedOps.end(),
719 std::inserter(unsupportedOps, unsupportedOps.begin()));
720 if (!unsupportedOps.empty()) {
722 "Decoder generator does not support operation %1% in CU.");
730 TCEString(
"APC operation requires an output port in the GCU");
739 TCEString(
"Decoder generator supports only 4-stage transport ") +
740 "pipeline of CU. Given machine has " +
746 string errorMsg =
TCEString(
"Decoder generator supports only ") +
747 "global guard latency of 1. Given machine has " +
780 stream <<
" : std_logic_vector(" << width - 1 <<
" downto 0);"
783 stream <<
" : std_logic;" << endl;
788 stream <<
"[" << width - 1 <<
":0]";
790 stream <<
" " << sigName <<
";" << endl;
796 std::ostream& stream,
int indent, std::string comment)
const {
798 stream <<
indentation(indent) << delim << comment << endl;
809 stream <<
"library IEEE;" << endl;
810 stream <<
"use IEEE.std_logic_1164.all;" << endl;
811 stream <<
"use IEEE.std_logic_arith.all;" << endl;
813 stream <<
"use STD.textio.all;" << endl;
815 stream <<
"use work." <<
entityNameStr_ <<
"_globals.all;" << endl;
818 stream <<
"use work.tce_util.all;" << endl << endl;
821 stream <<
"entity " << entityName <<
" is" << endl << endl;
824 VHDLNetlistWriter::writeGenericDeclaration(
826 VHDLNetlistWriter::writePortDeclaration(
830 stream <<
"end " << entityName <<
";" << endl << endl;
831 string architectureName =
"rtl_andor";
832 stream <<
"architecture " << architectureName <<
" of " << entityName
833 <<
" is" << endl << endl;
853 stream <<
"begin" << endl << endl;
876 stream << endl <<
"end " << architectureName <<
";" << endl;
880 stream <<
"`timescale 1ns/1ns" << endl
881 <<
"module " << entityName << endl
886 <<
"`include \"" <<
"gcu_opcodes_pkg.vh\"" << endl
889 VerilogNetlistWriter::writePortDeclaration(
893 VerilogNetlistWriter::writeGenericDeclaration(
933 << NetlistGenerator::DECODER_LOCK_REQ_OUT_PORT <<
"=";
934 if (lockReqWidth > 0) {
935 for (
int i = 0; i < lockReqWidth; i++) {
937 if (i+1 < lockReqWidth) {
941 stream <<
";" << endl;
943 stream <<
"1'b0;" << endl;
949 << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT <<
"}};" << endl
951 stream << endl <<
"endmodule" << endl;
966 <<
"-- Dump the status of global lock into a file once "
970 <<
"-- setting DUMP false will disable dumping"
974 <<
"-- Do not synthesize this process!"
977 <<
"-- pragma synthesis_off"
981 <<
"file_output : process" << endl;
983 <<
"file fileout : text;" << endl << endl
985 <<
"variable lineout : line;" << endl
987 <<
"variable start : boolean := true;" << endl
989 <<
"variable count : integer := 0;" << endl
991 <<
"constant SEPARATOR : string := \" | \";" << endl
993 <<
"constant DUMP : boolean := true;" << endl
995 <<
"constant DUMPFILE : string := \"lock.dump\";" << endl;
1001 <<
"if DUMP = true then" << endl;
1004 <<
"if start = true then" << endl;
1007 <<
"file_open(fileout, DUMPFILE, write_mode);" << endl
1009 <<
"start := false;" << endl;
1012 <<
"end if;" << endl;
1015 <<
"wait on clk until clk = '1' and clk'last_value = '0';"
1022 stream <<
indentation(4) <<
"write(lineout, count-"
1024 <<
indentation(4) <<
"write(lineout, SEPARATOR);" << endl
1026 <<
"write(lineout, conv_integer(unsigned'(\"\" & "
1028 <<
indentation(4) <<
"write(lineout, SEPARATOR);" << endl
1029 <<
indentation(4) <<
"writeline(fileout, lineout);" << endl;
1032 <<
"end if;" << endl;
1034 <<
"count := count + 1;" << endl;
1037 <<
"end if;" << endl;
1040 <<
"end process file_output;" << endl;
1043 <<
"-- pragma synthesis_on"
1048 <<
"// Dump the status of global lock into a file once "
1052 <<
"// setting DUMP false will disable dumping"
1054 <<
indentation(1) <<
"// Do not synthesize!" << endl
1055 <<
indentation(1) <<
"//synthesis translate_off" << endl
1056 <<
indentation(1) <<
"integer fileout;" << endl << endl
1057 <<
indentation(1) <<
"integer count=0;" << endl << endl
1058 <<
indentation(1) <<
"`define DUMPFILE \"lock.dump\""
1063 <<
indentation(2) <<
"fileout = $fopen(`DUMPFILE,\"w\");"
1073 <<
indentation(4) <<
"fileout = $fopen(`DUMPFILE,\"a\");"
1076 <<
" %11d | %11d | \\n\"" <<
", count - "
1078 << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT <<
");"
1085 <<
indentation(1) <<
"//synthesis translate_on" << endl;
1098 stream, 1,
"signals for source, destination and guard fields");
1102 if (slot.
width() > 0) {
1136 std::ostream& stream)
const {
1137 writeComment(stream, 1,
"signals for dedicated immediate slots");
1153 std::ostream& stream)
const {
1155 writeComment(stream, 1,
"signal for long immediate tag");
1170 std::ostream& stream)
const {
1174 stream <<
indentation(1) << comment <<
"squash signals" << endl;
1175 for (
int i = 0; i < busNav.
count(); i++) {
1180 <<
" : std_logic;" << endl;
1206 for (
int i = 0; i < socketNav.
count(); i++) {
1229 for (
int i = 0; i < busNav.
count(); i++) {
1260 functionUnitNavigator();
1261 for (
int i = 0; i < fuNav.
count(); i++) {
1281 for (
int i = 0; i < fu.
portCount(); i++) {
1311 registerFileNavigator();
1312 for (
int i = 0; i < rfNav.
count(); i++) {
1315 for (
int i = 0; i < rf->
portCount(); i++) {
1321 std::string sigName =
1329 rf->
name(), port->
name(), async_signal);
1339 for (
int i = 0; i < iuNav.
count(); i++) {
1341 for (
int i = 0; i < iu->
portCount(); i++) {
1352 std::string sigName =
1387 std::ostream& stream)
const {
1404 std::ostream& stream)
const {
1415 std::ostream& stream)
const {
1416 std::string instructionPort = NetlistGenerator::DECODER_INSTR_WORD_PORT;
1419 stream <<
indentation(1) <<
"-- dismembering of instruction" << endl;
1420 stream <<
indentation(1) <<
"process (" << instructionPort <<
")"
1422 stream <<
indentation(1) <<
"begin --process" << endl;
1428 if (slot.
width() > 0) {
1430 <<
" <= " << instructionPort <<
"("
1431 << slotPosition + slot.
width() <<
"-1 downto "
1432 << slotPosition <<
");" << endl;
1437 <<
" <= " << instructionPort <<
"("
1439 srcField.
width() - 1
1440 <<
" downto " << slotPosition + srcField.
bitPosition()
1447 <<
" <= " << instructionPort <<
"("
1449 dstField.
width() - 1
1450 <<
" downto " << slotPosition + dstField.
bitPosition()
1456 <<
" <= " << instructionPort <<
"("
1458 grdField.
width() - 1
1459 <<
" downto " << slotPosition + grdField.
bitPosition()
1467 <<
" <= " << instructionPort <<
"("
1474 <<
" <= " << instructionPort <<
"("
1476 <<
" downto " << icField.
bitPosition() <<
");" << endl;
1478 stream <<
indentation(1) <<
"end process;" << endl;
1480 stream <<
indentation(1) <<
"// dismembering of instruction" << endl;
1482 stream <<
indentation(1) <<
"begin //process" << endl;
1488 if (slot.
width() > 0) {
1490 <<
" = " << instructionPort <<
"["
1491 << slotPosition + slot.
width() - 1 <<
" : "
1492 << slotPosition <<
"];" << endl;
1497 <<
" = " << instructionPort <<
"["
1499 srcField.
width() - 1
1507 <<
" = " << instructionPort <<
"["
1509 dstField.
width() - 1
1516 <<
" = " << instructionPort <<
"["
1518 grdField.
width() - 1
1527 << instructionPort <<
"["
1534 << instructionPort <<
"["
1549 std::ostream& stream)
const {
1552 for (
int i = 0; i < busNav.
count(); i++) {
1568 std::ostream& stream)
const {
1573 std::set<InstructionTemplate*> affectingInstTemplates =
1575 bool ifClauseStarted =
false;
1577 if (!slot.
hasGuardField() && affectingInstTemplates.size() == 0) {
1581 stream <<
indentation(1) <<
"-- generate signal " << squashName
1583 stream <<
indentation(1) << squashName <<
" <= '0';" << endl;
1587 std::set<string> sensitivyList;
1596 if (affectingInstTemplates.size() > 0) {
1604 for (
const string& signal : sensitivyList) {
1608 assert(!listStr.empty());
1609 stream << listStr <<
")" << endl;
1611 stream <<
indentation(2) <<
"variable sel : integer;" << endl;
1613 stream <<
indentation(1) <<
"begin --process" << endl;
1615 if (affectingInstTemplates.size() > 0) {
1616 ifClauseStarted =
true;
1618 for (set<InstructionTemplate*>::const_iterator iter =
1619 affectingInstTemplates.begin();
1620 iter != affectingInstTemplates.end(); iter++) {
1621 if (iter != affectingInstTemplates.begin()) {
1622 stream <<
" or " << endl
1630 stream <<
") then" << endl;
1632 <<
" <= '1';" << endl;
1636 if (ifClauseStarted) {
1637 stream <<
indentation(indLevel) <<
"else" << endl;
1640 if (grdField !=
nullptr) {
1641 stream <<
indentation(indLevel) <<
"sel := conv_integer(unsigned("
1643 stream <<
indentation(indLevel) <<
"case sel is" << endl;
1649 bus, enc, regGuard, stream, indLevel);
1656 bus, enc, portGuard, stream, indLevel);
1668 stream <<
indentation(indLevel) <<
"when others =>" << endl;
1670 <<
" <= '0';" << endl;
1671 stream <<
indentation(indLevel-1) <<
"end case;" << endl;
1674 <<
" <= '0';" << endl;
1677 if (ifClauseStarted) {
1678 ifClauseStarted =
false;
1683 stream <<
indentation(1) <<
"end process;" << endl << endl;
1685 std::set<InstructionTemplate*> affectingInstTemplates =
1687 bool ifClauseStarted =
false;
1691 if (slot.
hasGuardField() || affectingInstTemplates.size() > 0) {
1694 std::set<string> sensitivyList;
1702 if (affectingInstTemplates.size() > 0) {
1710 for (
const string& signal : sensitivyList) {
1714 assert(!listStr.empty());
1715 stream << listStr <<
")" << endl;
1719 if (affectingInstTemplates.size() > 0) {
1720 ifClauseStarted =
true;
1722 for (set<InstructionTemplate*>::const_iterator iter =
1723 affectingInstTemplates.begin();
1724 iter != affectingInstTemplates.end(); iter++) {
1725 if (iter != affectingInstTemplates.begin()) {
1735 stream <<
")" << endl;
1737 <<
" <= 1'b1;" << endl;
1740 if (ifClauseStarted) {
1741 stream <<
indentation(indLevel) <<
"else" << endl;
1752 Verilog, bus, enc, regGuard, stream, indLevel);
1759 Verilog, bus, enc, portGuard, stream, indLevel);
1772 stream <<
indentation(indLevel) <<
"default:" << endl;
1775 stream <<
indentation(indLevel - 1) <<
"endcase" << endl;
1778 stream <<
indentation(indLevel) << squashName <<
" <= 1'b0;"
1781 stream <<
indentation(1) <<
"end" << endl << endl;
1786 stream <<
indentation(1) <<
"// generate signal " << squashName
1788 stream <<
indentation(1) <<
"assign " << squashName
1789 <<
" = 1'b0;" << endl;
1802 std::ostream& stream)
const {
1806 if (itNav.
count() == 0 || (itNav.
count() == 1 &&
1807 itNav.
item(0)->isEmpty())) {
1811 string resetPort = NetlistGenerator::DECODER_RESET_PORT;
1812 string clockPort = NetlistGenerator::DECODER_CLOCK_PORT;
1816 int indentLevel = 1;
1817 stream <<
indentation(indentLevel) <<
"--long immediate write process"
1819 stream <<
indentation(indentLevel) <<
"process (";
1820 stream << clockPort;
1822 stream <<
", " << resetPort;
1824 stream <<
")" << endl;
1825 stream <<
indentation(indentLevel) <<
"begin --process" << endl;
1830 <<
"if (clk'event and clk = '1') then" << endl;
1833 stream <<
indentation(indentLevel) <<
"if (" << resetPort
1834 <<
" = '0') then" << endl;
1839 for (
int i = 0; i < iuNav.
count(); i++) {
1844 <<
" <= (others => '0');" << endl;
1848 <<
" <= (others => '0');" << endl;
1851 stream <<
indentation(indentLevel - 1) <<
"elsif ";
1853 stream <<
"(clk'event and clk = '1') then" << endl
1859 for (
int i = 0; i < itNav.
count(); i++) {
1866 <<
") then" << endl;
1867 }
else if (i+1 < itNav.
count()) {
1871 <<
") then" << endl;
1873 stream <<
indentation(indentLevel) <<
"else" << endl;
1877 VHDL, *iTemp, indentLevel + 1, stream);
1881 stream <<
indentation(indentLevel) <<
"end if;" << endl;
1887 stream <<
indentation(1) <<
"end process;" << endl;
1889 stream <<
indentation(1) <<
"//long immediate write process" << endl
1891 << clockPort <<
" or negedge " << resetPort <<
")" << endl
1893 <<
indentation(2) <<
"if (" << resetPort <<
" == 0)"
1899 for (
int i = 0; i < iuNav.
count(); i++) {
1902 <<
" <= 1'b0;" << endl
1904 <<
" <= 0;" << endl;
1907 <<
" <= 0;" << endl;
1913 << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT <<
" == 0)"
1916 for (
int i = 0; i < itNav.
count(); i++) {
1926 }
else if (i+1 < itNav.
count()) {
1937 Verilog, *iTemp, indLevel, stream);
1959 std::ostream& stream)
const {
1963 if (language ==
VHDL) {
1965 for (
int i = 0; i < iuNav.
count(); i++) {
1972 <<
"(" << (iu->
width() - 1) <<
" downto 0"
1973 <<
") <= tce_sxt(\"0\", " << iu->
width() <<
");"
1977 for (
int i = 0; i < iuNav.
count(); i++) {
1980 int msb = iu->
width() - 1;
1990 int immPartWidth = msb - lsb + 1;
1993 <<
"(" << msb <<
" downto " << lsb <<
") <= ";
1996 stream <<
"tce_sxt(";
1998 stream <<
"tce_ext(";
2004 stream << NetlistGenerator::DECODER_INSTR_WORD_PORT
2011 stream << NetlistGenerator::DECODER_INSTR_WORD_PORT
2018 stream <<
", " << immPartWidth <<
");" << endl;
2020 stream <<
";" << endl;
2031 << NetlistGenerator::DECODER_INSTR_WORD_PORT
2036 <<
"'length);" << endl;
2050 for (
int i = 0; i < iuNav.
count(); i++) {
2054 <<
" <= 1'b0;" << endl;
2058 <<
"[" << (iu->
width() - 1) <<
" : 0"
2059 <<
"] <= {" << iu->
width() <<
"{1'b0}};" << endl;
2062 for (
int i = 0; i < iuNav.
count(); i++) {
2065 int msb = iu->
width() - 1;
2077 <<
"[" << msb <<
" : " << lsb <<
"] <= ";
2080 stream <<
"$signed(";
2082 stream <<
"$unsigned(";
2088 stream << NetlistGenerator::DECODER_INSTR_WORD_PORT
2095 stream << NetlistGenerator::DECODER_INSTR_WORD_PORT
2102 stream <<
");" << endl;
2104 stream <<
";" << endl;
2113 <<
" <= " <<
"$unsigned("
2114 << NetlistGenerator::DECODER_INSTR_WORD_PORT
2142 set<const RegisterFile*> sramRFset;
2143 set<const RegisterFile*>::const_iterator sramrf_it;
2146 bool hasSramRFs =
false;
2149 for (
int i = 0; i < rfNav.
count(); i++) {
2152 sramRFset.insert(rfNav.
item(i));
2161 string resetPort = NetlistGenerator::DECODER_RESET_PORT;
2165 <<
"-- separate SRAM RF read decoding process" << endl;
2166 stream <<
indentation(1) <<
"process (" << resetPort;
2169 BusSet connectedToSramRFs;
2170 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2174 for (
int ip = 0; ip < rf.
portCount(); ip++) {
2178 connectedToSramRFs.insert(tmp.begin(), tmp.end());
2183 BusSet::const_iterator busSet_it;
2184 for (busSet_it = connectedToSramRFs.begin();
2185 busSet_it != connectedToSramRFs.end();
2187 string busName = (*busSet_it)->name();
2191 stream <<
")" << endl;
2195 stream <<
indentation(2) <<
"if (" << resetPort <<
" = '0') then"
2197 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2201 for (
int i = 0; i < rf.
portCount(); i++) {
2209 <<
" <= '0';" << endl;
2213 <<
" <= (others => '0');" << endl;
2219 stream << endl <<
indentation(2) <<
"else" << endl;
2220 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2224 for(
int i = 0; i < rf.
portCount(); i++) {
2234 stream <<
indentation(1) <<
"end process;" << endl;
2238 string resetPort = NetlistGenerator::DECODER_RESET_PORT;
2241 <<
"// separate SRAM RF read decoding process" << endl;
2242 stream <<
indentation(1) <<
"always@(" << resetPort;
2245 BusSet connectedToSramRFs;
2246 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2250 for (
int ip = 0; ip < rf.
portCount(); ip++) {
2254 connectedToSramRFs.insert(tmp.begin(), tmp.end());
2259 BusSet::const_iterator busSet_it;
2260 for (busSet_it = connectedToSramRFs.begin();
2261 busSet_it != connectedToSramRFs.end();
2263 string busName = (*busSet_it)->name();
2267 stream <<
")" << endl;
2271 stream <<
indentation(2) <<
"if (" << resetPort <<
" == 0)" << endl
2274 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2278 for (
int i = 0; i < rf.
portCount(); i++) {
2286 <<
" <= 1'b0;" << endl;
2290 <<
" <= 0;" << endl;
2299 for (sramrf_it = sramRFset.begin(); sramrf_it != sramRFset.end();
2303 for(
int i = 0; i < rf.
portCount(); i++) {
2313 stream <<
indentation(1) <<
"end // process" << endl;
2324 std::ostream& stream)
const {
2326 string resetPort = NetlistGenerator::DECODER_RESET_PORT;
2327 string clockPort = NetlistGenerator::DECODER_CLOCK_PORT;
2329 stream <<
indentation(1) <<
"-- main decoding process" << endl;
2332 stream << clockPort;
2334 stream <<
", " << resetPort;
2336 stream <<
")" << endl;
2341 stream <<
indentation(2) <<
"if (clk'event and clk = '1') then"
2343 <<
indentation(2) <<
"if (" << resetPort <<
" = '0') then"
2346 stream << endl <<
indentation(2) <<
"else" << endl;
2348 stream <<
indentation(2) <<
"if (" << resetPort <<
" = '0') then"
2353 <<
"elsif (clk'event and clk = '1') then "
2354 <<
"-- rising clock edge" << endl;
2357 string softResetPort =
"db_tta_nreset";
2358 stream <<
indentation(3) <<
"if (" << softResetPort
2368 stream <<
" = '0')";
2369 stream <<
" then" << endl << endl;
2375 stream <<
indentation(1) <<
"end process;" << endl;
2377 string resetPort = NetlistGenerator::DECODER_RESET_PORT;
2378 string clockPort = NetlistGenerator::DECODER_CLOCK_PORT;
2380 stream <<
indentation(1) <<
"// main decoding process" << endl
2381 <<
indentation(1) <<
"always@(posedge " << clockPort
2382 <<
" or negedge " << resetPort <<
")" << endl
2384 <<
indentation(2) <<
"if (" << resetPort <<
" == 0)" << endl
2391 << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT
2392 <<
" == 0)" << endl << endl
2407 "writeGlockMapping() is not yet implemented "
2411 string propagateGlock(
2416 stream <<
" lock_reg_proc : process (clk)\n"
2418 <<
" if (clk'event and clk = '1') then\n"
2419 <<
" if (rstx = '0') then\n"
2420 <<
" -- Locked during active reset"
2421 <<
" " << assertGlock <<
"\n"
2423 <<
" " << propagateGlock <<
"\n"
2426 <<
" end process lock_reg_proc;\n\n";
2428 stream <<
" lock_reg_proc : process (clk, rstx)\n"
2430 <<
" if (rstx = '0') then\n"
2431 <<
" -- Locked during active reset"
2432 <<
" " << assertGlock <<
"\n"
2433 <<
" elsif (clk'event and clk = '1') then\n"
2434 <<
" " << propagateGlock <<
"\n"
2436 <<
" end process lock_reg_proc;\n\n";
2441 stream <<
indentation(1) << NetlistGenerator::DECODER_LOCK_REQ_OUT_PORT
2444 if (lockReqWidth > 0) {
2445 for (
int i = 0; i < lockReqWidth; i++) {
2447 if (i + 1 < lockReqWidth) {
2451 stream <<
";" << endl;
2453 stream <<
"'0';" << endl;
2457 <<
" <= " << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT;
2458 if (lockReqWidth > 0) {
2461 stream <<
";" << endl;
2466 stream <<
indentation(1) << NetlistGenerator::DECODER_LOCK_STATUS_PORT
2471 for (
GlockBitType glockBitToConnect = 0; glockBitToConnect < glockWidth;
2472 glockBitToConnect++) {
2486 const Unit* associatedToGlockReq =
2488 UnitGlockReqBitMapType::const_iterator gr_it;
2491 if (gr_it->first == associatedToGlockReq) {
2499 stream << NetlistGenerator::DECODER_LOCK_REQ_IN_PORT <<
";";
2519 std::ostream& stream)
const {
2520 auto indstream = [&](
unsigned level) -> std::ostream& {
2526 indstream(1) <<
"decode_pipeline_fill_lock: process (clk)"
2528 indstream(1) <<
"begin" << endl;
2529 indstream(2) <<
"if clk'event and clk = '1' then" << endl;
2530 indstream(3) <<
"if rstx = '0' then" << endl;
2532 indstream(3) <<
"elsif lock = '0' then" << endl;
2534 indstream(1) <<
"decode_pipeline_fill_lock: process (clk, rstx)"
2536 indstream(1) <<
"begin" << endl;
2537 indstream(2) <<
"if rstx = '0' then" << endl;
2539 indstream(2) <<
"elsif clk'event and clk = '1' then" << endl;
2540 indstream(3) <<
"if lock = '0' then" << endl;
2542 indstream(4) <<
"decode_fill_lock_reg <= '0';" << endl;
2543 indstream(3) <<
"end if;" << endl;
2544 indstream(2) <<
"end if;" << endl;
2545 indstream(1) <<
"end process decode_pipeline_fill_lock;" << endl;
2559 std::ostream& stream)
const {
2560 std::string vector_reset =
" <= (others => '0');";
2561 std::string bit_reset =
" <= '0';";
2563 vector_reset =
" <= 0;";
2564 bit_reset =
" <= 1'b0;";
2568 stream <<
indentation(3) << signal << vector_reset << endl;
2572 stream <<
indentation(3) << signal << bit_reset << endl;
2584 std::ostream& stream)
const {
2600 std::ostream& stream)
const {
2605 for (
int i = 0; i < socketNav.
count(); i++) {
2607 if (socket->
direction() == Socket::OUTPUT &&
2614 "bus control signals for short immediate sockets");
2616 for (
int i = 0; i < busNav.
count(); i++) {
2626 "data control signals for output sockets connected to FUs");
2628 for (
int i = 0; i < fuNav.
count(); i++) {
2630 for (
int i = 0; i < fu->
portCount(); i++) {
2640 for (
int i = 0; i < gcu->
portCount(); i++) {
2648 writeComment(stream, indent,
"control signals for RF read ports");
2650 for (
int i = 0; i < rfNav.
count(); i++) {
2656 for (
int i = 0; i < rf->
portCount(); i++) {
2666 <<
"control signals for IU read ports" << endl;
2667 writeComment(stream, indent,
"control signals for IU read ports");
2670 for (
int i = 0; i < iuNav.
count(); i++) {
2672 for (
int i = 0; i < iu->
portCount(); i++) {
2690 std::ostream& stream)
const {
2691 writeComment(stream, 4,
"control signals for FU inputs");
2693 for (
int i = 0; i < fuNav.
count(); i++) {
2695 for (
int i = 0; i < fu->
portCount(); i++) {
2704 for (
int i = 0; i < gcu->
portCount(); i++) {
2711 writeComment(stream, 4,
"control signals for RF inputs");
2713 for (
int i = 0; i < rfNav.
count(); i++) {
2715 for (
int i = 0; i < rf->
portCount(); i++) {
2733 std::ostream& stream)
const {
2749 stream <<
") then" << endl;
2751 stream <<
indentation(indent + 1) << busCntrlPin <<
" <= '1';"
2755 stream <<
indentation(indent + 1) << busCntrlPin <<
" <= '0';"
2757 stream <<
indentation(indent) <<
"end if;" << endl;
2772 stream <<
indentation(5) << busCntrlPin <<
" <= 1'b1;" << endl
2774 <<
indentation(5) << busCntrlPin <<
" <= 1'b0;" << endl << endl;
2788 stream <<
"tce_sxt(";
2790 stream <<
"tce_ext(";
2808 std::ostream& stream)
const {
2828 stream <<
") then" << endl;
2830 <<
"(0) <= '1';" << endl;
2834 <<
"(0) <= '0';" << endl;
2845 stream <<
")" << endl <<
indentation(4) <<
"begin" << endl;
2847 <<
"[0] <= 1'b1;" << endl;
2851 stream <<
"$signed(";
2853 stream <<
"$unsigned(";
2862 <<
"[0] <= 1'b0;" << endl
2878 std::ostream& stream)
const {
2899 <<
") then" << endl;
2901 stream <<
") then" << endl;
2905 <<
"conv_std_logic_vector("
2908 <<
"'length);" << endl;
2909 stream <<
indentation(indent) <<
"end if;" << endl;
2929 stream <<
")" << endl;
2949 std::ostream& stream)
const {
2955 bool writeLoadSignal =
true;
2957 writeLoadSignal =
false;
2966 string opcodeString =
"";
2970 BusSet::const_iterator nextIter = iter;
2988 if (scTable != NULL) {
3000 stream <<
") then" << endl;
3002 string loadSignalName;
3003 string opcodeSignalName;
3015 if (writeLoadSignal) {
3016 stream <<
indentation(indent + 1) << loadSignalName
3017 <<
" <= '1';" << endl;
3020 opcodeString =
indentation(indent + 1) + opcodeSignalName +
3023 ", " + opcodeSignalName +
"'length);";
3024 stream << opcodeString << endl;
3030 <<
" <= conv_std_logic_vector("
3034 <<
"'length);" << endl;
3038 if (writeLoadSignal) {
3045 rf->
name(), port.
name(), async_signal);
3047 stream <<
" <= '0';" << endl;
3049 stream <<
indentation(indent) <<
"end if;" << endl;
3053 BusSet::const_iterator nextIter = iter;
3071 if (scTable != NULL) {
3083 stream <<
")" << endl
3086 string loadSignalName;
3087 string opcodeSignalName;
3100 stream <<
indentation(5) << loadSignalName <<
" <= 1'b1;" << endl;
3125 stream <<
" <= 1'b0;" << endl
3140 std::ostream& stream)
const {
3148 string opcodeAssignString =
"";
3149 string cntrlSignalString =
"";
3150 for (BusSet::const_iterator iter = buses.begin(); iter != buses.end();
3161 stream <<
") then" << endl;
3187 <<
" <= '1';" << endl;
3188 if (gcu !=
nullptr) {
3193 "std_logic_vector(conv_"
3194 "unsigned(IFE_JUMP, "
3196 <<
"'length));" << endl;
3197 }
else if (operation->
name() ==
CALL) {
3201 "std_logic_vector(conv_"
3202 "unsigned(IFE_CALL, "
3204 <<
"'length));" << endl;
3209 <<
" <= conv_std_logic_vector("
3210 <<
opcode(*operation) <<
", "
3212 <<
"'length);" << endl;
3219 stream <<
indentation(indent + 1) <<
"else" << endl;
3222 <<
" <= '0';" << endl;
3243 assert(codeEnd >= codeStart);
3246 <<
" <= '1';" << endl;
3247 opcodeAssignString =
3250 " <= " + signalName +
"(" +
3253 stream << opcodeAssignString << endl;
3262 <<
" <= '1';" << endl;
3266 stream <<
") then" << endl;
3269 <<
" <= '1';" << endl;
3275 " <= conv_std_logic_vector(" +
3280 stream << cntrlSignalString << endl;
3283 BusSet::const_iterator nextIter = iter;
3285 if (nextIter != buses.end()) {
3294 stream <<
indentation(indent) <<
"end if;" << endl;
3296 for (BusSet::const_iterator iter = buses.begin(); iter != buses.end();
3307 stream <<
")" << endl
3319 <<
" <= 1'b1;" << endl;
3325 <<
" <= IFE_JUMP;" << endl;
3326 }
else if (operation->
name() ==
CALL) {
3329 <<
" <= IFE_CALL;" << endl;
3358 <<
" <= 1'b1;" << endl;
3361 stream <<
")" << endl
3370 if (&port == jumpOp->
port(1)) {
3373 <<
" <= IFE_JUMP;" << endl;
3378 if (&port == callOp->
port(1)) {
3381 <<
" <= IFE_CALL;" << endl;
3391 *socket, *bus->
segment(0)) <<
";"
3395 BusSet::const_iterator nextIter = iter;
3398 if (nextIter != buses.end()) {
3405 <<
" <= 1'b0;" << endl;
3419 std::ostream& stream)
const {
3427 string opcodeSignalString =
"";
3428 string controlSignalString =
"";
3429 for (BusSet::const_iterator iter = buses.begin(); iter != buses.end();
3444 stream <<
") then" << endl;
3447 <<
" <= '1';" << endl;
3448 opcodeSignalString =
3452 stream << opcodeSignalString << endl;
3455 stream <<
") then" << endl;
3458 <<
" <= '1';" << endl;
3462 controlSignalString =
3465 " <= conv_std_logic_vector(" +
3471 stream << controlSignalString << endl;
3474 BusSet::const_iterator nextIter = iter;
3476 if (nextIter != buses.end()) {
3484 stream <<
indentation(indent) <<
"end if;" << endl;
3486 for (BusSet::const_iterator iter = buses.begin(); iter != buses.end();
3501 stream <<
")" << endl
3510 stream <<
")" << endl
3522 *socket, *bus->
segment(0)) <<
";"
3526 BusSet::const_iterator nextIter = iter;
3529 if (nextIter != buses.end()) {
3535 <<
" <= 1'b0;" << endl;
3548 std::ostream& stream)
const {
3550 stream <<
indentation(1) <<
"-- map control registers to outputs"
3555 functionUnitNavigator();
3556 for (
int i = 0; i < fuNav.
count(); i++) {
3558 for (
int i = 0; i < fu->
portCount(); i++) {
3583 stream <<
indentation(1) << NetlistGenerator::DECODER_RA_LOAD_PORT
3590 if (pcPort != NULL) {
3591 stream <<
indentation(1) << NetlistGenerator::DECODER_PC_LOAD_PORT
3599 << NetlistGenerator::DECODER_PC_OPCODE_PORT
3605 for (
int i = 0; i < gcu->
portCount(); i++) {
3619 for (
int i = 0; i < gcu->
portCount(); i++) {
3634 registerFileNavigator();
3635 for (
int i = 0; i < rfNav.
count(); i++) {
3638 for (
int i = 0; i < rf->
portCount(); i++) {
3647 async_signal) <<
";"
3653 if (OpcodePortExists) {
3670 for (
int i = 0; i < iuNav.
count(); i++) {
3672 for (
int i = 0; i < iu->
portCount(); i++) {
3676 bool writeOpcodePortExists =
3678 assert(readOpcodePortExists == writeOpcodePortExists);
3680 writeOpcodePortExists) {
3698 for (
int i = 0; i < socketNav.
count(); i++) {
3717 for (
int i = 0; i < busNav.
count(); i++) {
3735 stream <<
indentation(1) <<
"// map control registers to outputs"
3740 functionUnitNavigator();
3741 for (
int i = 0; i < fuNav.
count(); i++) {
3743 for (
int i = 0; i < fu->
portCount(); i++) {
3773 << NetlistGenerator::DECODER_RA_LOAD_PORT
3782 pcPort = callOp->
port(1);
3785 pcPort = jumpOp->
port(1);
3787 if (pcPort != NULL) {
3790 << NetlistGenerator::DECODER_PC_LOAD_PORT
3799 << NetlistGenerator::DECODER_PC_OPCODE_PORT
3805 registerFileNavigator();
3806 for (
int i = 0; i < rfNav.
count(); i++) {
3808 for (
int i = 0; i < rf->
portCount(); i++) {
3818 async_signal) <<
";"
3835 for (
int i = 0; i < iuNav.
count(); i++) {
3837 for (
int i = 0; i < iu->
portCount(); i++) {
3869 <<
" = 1'b0;" << endl;
3882 for (
int i = 0; i < socketNav.
count(); i++) {
3906 for (
int i = 0; i < busNav.
count(); i++) {
3940 std::ostream& stream,
3971 const std::set<TTAMachine::PortGuard*>& guardSet,
3974 for (std::set<PortGuard*>::const_iterator iter = guardSet.begin();
3975 iter != guardSet.end(); iter++) {
3977 if (containedGuard->
port() == guard.
port()) {
3996 const std::set<TTAMachine::RegisterGuard*>& guardSet,
3999 for (std::set<RegisterGuard*>::const_iterator iter = guardSet.begin();
4000 iter != guardSet.end(); iter++) {
4026 socket.
direction() == Socket::OUTPUT)) {
4062 Bus* bus = busNav.
item(busName);
4063 for (
int i = 0; i < bus->
guardCount(); i++) {
4066 if (regGuard != NULL) {
4092 Bus* bus = busNav.
item(busName);
4093 for (
int i = 0; i < bus->
guardCount(); i++) {
4096 if (portGuard != NULL) {
4118 return "simm_" + busName;
4131 return "simm_cntrl_" + busName;
4148 assert(
false &&
"Unknown extension policy.");
4162 return "simm_" + busName +
"_reg";
4174 return "simm_cntrl_" + busName +
"_reg";
4187 const std::string& fuName,
4188 const std::string& portName) {
4190 return "fu_" + fuName +
"_" + portName +
"_load";
4204 const std::string& fuName,
4205 const std::string& portName) {
4219 return "fu_" + fu +
"_opc";
4244 const std::string& rfName,
4245 const std::string& portName) {
4247 return "rf_" + rfName +
"_" + portName +
"_load";
4262 const std::string& rfName,
4263 const std::string& portName,
4286 const std::string& rfName,
4287 const std::string& portName,
4306 const std::string& rfName,
4307 const std::string& portName) {
4309 return "rf_" + rfName +
"_" + portName +
"_opc";
4323 const std::string& unitName,
4324 const std::string& portName) {
4326 return "iu_" + unitName +
"_" + portName +
"_read_opc";
4340 const std::string& unitName,
4341 const std::string& portName) {
4357 const std::string& unitName,
4358 const std::string& portName) {
4360 return "iu_" + unitName +
"_" + portName +
"_read_load";
4374 const std::string& unitName,
4375 const std::string& portName) {
4389 return "iu_" + iuName +
"_write";
4427 const std::string& unitName) {
4459 return bus.
name() +
"_src_sel";
4469 return bus.
name() +
"_src_ena";
4482 return "move_" + busName;
4496 if (portGuard != NULL) {
4499 return "fu_guard_" + fu->
name() +
"_" + port->
name();
4500 }
else if (regGuard != NULL) {
4502 return "rf_guard_" + rf->
name() +
"_" +
4519 return "socket_" + name +
"_bus_cntrl";
4531 return "socket_" + name +
"_data_cntrl";
4543 return "src_" + busName;
4556 return "dst_" + busName;
4568 return "grd_" + busName;
4580 return "limmslot_" + immSlot;
4592 return "squash_" + busName;
4646 return gcuBlock.
port(NetlistGenerator::DECODER_PC_OPCODE_PORT)
4650 return ops > 1 ?
static_cast<int>(std::ceil(std::log2(ops))) : 0;
4664 if (socket.
direction() == Socket::INPUT) {
4681 if (socket.
direction() == Socket::OUTPUT) {
4711 for (
int i = 0; i < segmentCount; i++) {
4730 const std::string& socketName) {
4733 if (
dynamic_cast<const SourceField*
>(&slotField) != NULL) {
4741 if (language ==
VHDL) {
4745 return "conv_integer(unsigned(" + signalName +
"("
4754 return signalName +
"["
4779 if (language==
VHDL) {
4800 assert(codeEnd >= codeStart);
4803 return "conv_integer(unsigned(" + signalName +
"(" +
4808 return signalName +
"[" +
4824 const std::string& iTempName)
const {
4854 if (
dynamic_cast<SourceField*
>(slotField) != NULL) {
4863 opcStart = slotField->
width() - table.
width();
4867 int opcEnd = opcStart + code.
indexWidth() - 1;
4916 std::vector<std::string> operations;
4920 std::sort(operations.begin(), operations.end());
4921 for (
size_t i = 0; i < operations.size(); ++i) {
4922 if (operations[i] == operation.
name()) {
4927 assert(
false &&
"should not get here");
4939 for (
unsigned int i = 0; i < level; i++) {
ProGe::NetlistPort & busCntrlPortOfSocket(const std::string &socketName) const
int immediateWidth() 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)
static std::set< TTAMachine::InstructionTemplate * > templatesUsingSlot(const TTAMachine::Machine &mach, const std::string &slotName)
virtual const Netlist & netlist() const
ImmediateSlotField & immediateSlot(int index) const
void writeRFCntrlSignals(std::ostream &stream)
bool hasGlockReqPort(const NetlistBlock &block) const
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)
virtual std::string slotOfDestination(const ImmediateUnit &dstUnit, int index) const
const CentralizedControlICGenerator & icGenerator_
The IC generator.
virtual Socket * inputSocket() const
static std::string rfLoadCntrlPort(const std::string &rfName, const std::string &portName)
bool hasOperation(const TCEString &opName) const
bool hasMoveSlot(const std::string &name) const
static std::string iuWriteOpcodeCntrlPort(const std::string &unitName)
void completeDecoderBlock(const ProGe::NetlistGenerator &nlGenerator, ProGe::NetlistBlock &coreBlock)
virtual TCEString name() const
void writeLongImmediateWriteProcess(std::ostream &stream) const
void writeSocketCntrlSignals(std::ostream &stream)
static std::string dstFieldSignal(const std::string &busName)
bool isRISCVMachine() const
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.
int registerIndex() const
@ BIT_VECTOR
Several bits.
FunctionUnit * parentUnit() const
FUGuardEncoding & fuGuardEncoding(int index) const
UnitGlockReqBitMapType unitGlockReqBitMap_
Maps TTA Units to associated glock request port bits.
std::string registerFile() const
static BusSet connectedBuses(const TTAMachine::Socket &socket)
static std::string busMuxEnableSignal(const TTAMachine::Bus &bus)
void addLockReqPortToDecoder()
FUPortCode & fuPortCode(int index) const
HDB::RFEntry & rfEntry(const std::string &rfName) const
virtual BaseFUPort * triggerPort() const
void writeMoveFieldSignals(std::ostream &stream) const
bool hasImmediateEncoding() const
std::string widthFormula() const
bool isGuardInverted() const
static std::string iuWriteLoadCntrlSignal(const std::string &unitName)
const string POST_DECODE_MERGED_GLOCK_SIGNAL
Direction direction() const
bool hasImmediateControlField() const
bool hasGuardField() const
NetlistPort & fuGuardPort(const NetlistPort &fuPort) const
static std::string iuWritePort(const std::string &iuName)
RFPortCode & rfPortCode(int index) const
static std::string gcuDataPort(const std::string &nameInADF)
unsigned int lockTraceStartingCycle_
The starting cycle for bus tracing.
virtual BaseFUPort * port(const std::string &name) const
UnconditionalGuardEncoding & unconditionalGuardEncoding(bool inverted) const
virtual const NetlistBlock & parentBlock() const override
void writeInstructionTemplateProcedures(const ProGe::HDL language, const TTAMachine::InstructionTemplate &iTemp, int indLevel, std::ostream &stream) const
Segment * segment(int index) const
NetlistPort & glockReqPort(const NetlistBlock &block) const
NetlistPort & glockPort(const NetlistBlock &block) const
Direction direction() const
virtual Segment * segment(int index) const
void verifyCompatibility() const
SocketEncoding & socketEncoding(int index) const
NetlistPort & loadPort(const NetlistPort &port) const
virtual int slotCount() const
NetlistBlock & netlistBlock(const TTAMachine::Unit &unit) const
void addGlockPortToDecoder()
void writeInstructionDecoder(std::ostream &stream)
static std::string toString(const T &source)
static std::string busMuxEnableRegister(const TTAMachine::Bus &bus)
void writeControlRulesOfFUOutputPort(const TTAMachine::BaseFUPort &port, std::ostream &stream) const
virtual bool isOpcodeSetting() const =0
bool connect(const NetlistPort &port1, const NetlistPort &port2, int port1FirstBit, int port2FirstBit, int width=1)
virtual int numberOfRegisters() 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)
virtual bool hasParentBlock() const
static std::string fuOpcodeCntrlPort(const std::string &fu)
#define assert(condition)
static std::string socketBusControlPort(const std::string &name)
void writeSimmDataSignal(const TTAMachine::Bus &bus, std::ostream &stream) const
virtual FUPort * port(int operand) const
GPRGuardEncoding & gprGuardEncoding(int index) const
std::vector< std::string > registerBits
bool hasSourceField() const
std::string instructionTemplateCondition(const ProGe::HDL language, const std::string &iTempName) const
ProGe::NetlistPort & simmDataPort(const std::string &busName) const
std::string functionUnit() const
bool generateDebugger_
Generate debugger signals?
virtual ControlUnit * controlUnit() const
void writeBusControlRulesOfOutputSocket(const TTAMachine::Socket &socket, std::ostream &stream) const
virtual int numberOfSlots(const ImmediateUnit &dstUnit) const
static std::string rfOpcodeFromSrcOrDstField(const ProGe::HDL language, const SocketEncoding &socketEnc, const PortCode &code)
const std::string & name() const
static std::string guardFieldSignal(const std::string &busName)
UnitGlockBitMapType unitGlockBitMap_
Maps connected glock port bits to associated TTA Units.
GuardField & guardField() const
const string LIMM_TAG_SIGNAL
virtual ImmediateUnitNavigator immediateUnitNavigator() const
#define THROW_EXCEPTION(exceptionType, message)
Exception wrapper macro that automatically includes file name, line number and function name where th...
TTAMachine::RegisterGuard & findGuard(const GPRGuardEncoding &encoding) const
ImmediateEncoding & immediateEncoding() const
static void writeSquashSignalSubstitution(const ProGe::HDL language, const TTAMachine::Bus &bus, const GuardEncoding &enc, const TTAMachine::Guard &guard, std::ostream &stream, int indLevel)
bool hasDestinationField() const
static std::string simmControlPort(const std::string &busName)
MoveSlot * parent() const
const string POST_DECODE_MERGED_GLOCK_OUTREG
static std::string iuReadOpcodeCntrlSignal(const std::string &unitName, const std::string &portName)
static std::string busMuxCntrlSignal(const TTAMachine::Bus &bus)
bool hasItem(const std::string &name) const
static std::string rfOpcodeCntrlPort(const std::string &rfName, const std::string &portName)
IUPortCode & iuPortCode(int index) const
virtual int outputSocketDataControlValue(const TTAMachine::Socket &socket, const TTAMachine::Port &port) const =0
const string GLOCK_PORT_NAME
void writeControlRulesOfRFWritePort(const TTAMachine::RFPort &port, std::ostream &stream) const
virtual FunctionUnitNavigator functionUnitNavigator() const
static std::string fuLoadCntrlPort(const std::string &fuName, const std::string &portName)
virtual int width() const
void writeInstructionDismembering(std::ostream &stream) const
static OperationSet getOpset(const TTAMachine::Machine &mach)
static std::string guardPortName(const TTAMachine::Guard &guard)
void writeRulesForSourceControlSignals(std::ostream &stream) const
static const std::string GLOCK_PORT_NAME
virtual int operationCount() const
static std::string iuReadLoadCntrlPort(const std::string &unitName, const std::string &portName)
virtual ~DefaultDecoderGenerator()
void writePipelineFillProcess(std::ostream &stream) const
bool hasSocketCodes() const
static bool needsDataControl(const TTAMachine::Socket &socket)
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)
virtual int width() const
virtual int outputSocketCntrlPinForSegment(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment) const =0
virtual int supportedWidth() const
RFImplementation & implementation() const
unsigned int encoding() const
bool hasUnconditionalGuardEncoding(bool inverted) const
void writeBusControlRulesOfSImmSocketOfBus(const TTAMachine::Bus &bus, std::ostream &stream) const
BinaryEncoding::Position componentIDPosition() const
virtual bool hasOperation(const std::string &name) const
unsigned int encoding() const
virtual SocketNavigator socketNavigator() const
virtual int width() const
SourceField & sourceField() const
virtual bool isOneOfDestinations(const ImmediateUnit &dstUnit) const
static int busControlWidth(const TTAMachine::Socket &socket)
virtual bool isTriggering() const =0
virtual bool isOutput() const
static bool createFile(const std::string &file)
static std::string fuLoadSignalName(const std::string &fuName, const std::string &portName)
Guard * guard(int index) const
int glockRequestWidth() const
virtual int portCount() 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)
static int rfOpcodeWidth(const TTAMachine::BaseRegisterFile &rf)
static const std::string DIRECTORY_SEPARATOR
static std::string moveFieldSignal(const std::string &busName)
int encodingWidth() const
size_t encoding(const std::string &operName) const
void writeMainDecodingProcess(std::ostream &stream) const
virtual int outputPortCount(bool countBidir=false) const
static std::string rfOpcodeSignalName(const std::string &rfName, const std::string &portName, bool async=false)
void SetHDL(ProGe::HDL language)
int gprGuardEncodingCount() const
NetlistPort & rfGuardPort(const NetlistBlock &rfBlock) const
const BinaryEncoding & bem_
The binary encoding map.
void writeRulesForDestinationControlSignals(std::ostream &stream) const
void writeSquashSignalGenerationProcess(const TTAMachine::Bus &bus, std::ostream &stream) const
const string LOCK_REQ_PORT_NAME
virtual RFPort * port(const std::string &name) const
int immediateSlotCount() const
void writeControlRegisterMappings(std::ostream &stream) const
BaseRegisterFile * parentUnit() const
virtual RegisterFileNavigator registerFileNavigator() const
int socketIDWidth() const
void writeComment(std::ostream &stream, int indent, std::string comment) const
int socketIDPosition() const
virtual bool isInverted() const
TCETools::CIStringSet OperationSet
void writeInstructionDecoding(std::ostream &stream) const
find Finds info of the inner loops in the false
void setSyncReset(bool value)
int fuGuardEncodingCount() const
static std::string & appendToNonEmpty(std::string &toAppend, stringCRef appender)
void writeLongImmediateTagSignal(std::ostream &stream) const
virtual std::string name() const
DataType
Data types of hardware ports.
void setGenerateBusEnable(bool value)
static const std::string RISCV_SIMM_PORT_IN_NAME
NetlistBlock & instructionDecoder() const
ProGe::NetlistPort & glockPort() const
NetlistPort & fuOpcodePort(const NetlistBlock &fuBlock) const
static int dataControlWidth(const TTAMachine::Socket &socket)
SlotField * parent() const
NetlistPort & rfOpcodePort(const NetlistPort &port) const
FunctionUnit * parentUnit() const
static std::string rfLoadSignalName(const std::string &rfName, const std::string &portName, bool async=false)
virtual BusNavigator busNavigator() const
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.
const string PRE_DECODE_MERGED_GLOCK_SIGNAL
virtual Socket * outputSocket() const
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 makeString(const IterableContainer &container, const std::string &separator=", ")
static std::string immSlotSignal(const std::string &immSlot)
virtual bool isInput() const
void writeResettingOfControlRegisters(std::ostream &stream) const
HDL
HDLs supported by ProGe.
void setGenerateDebugger(bool generate)
ImmediateControlField & immediateControlField() const
NetlistPort & netlistPort(const TTAMachine::Port &port, Direction dir=IN) const
MoveSlot & moveSlot(int index) const
const std::string & moduleName() const
static bool needsBusControl(const TTAMachine::Socket &socket)
const string INTERNAL_MERGED_GLOCK_REQ_SIGNAL
ComponentType * item(int index) const
DestinationField & destinationField() const
bool sacEnabled(const std::string &rfName) const
virtual HWOperation * operation(const std::string &name) const
const string PIPELINE_FILL_LOCK_SIGNAL
NetlistPort & immediateUnitWritePort(const TTAMachine::ImmediateUnit &iu) 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
bool hasOpcodePort(const NetlistPort &port) const
int globalGuardLatency() const
bool hasGlockPort() const
int moveSlotCount() const
SpecialRegisterPort * returnAddressPort() const
int registerIndex() const
ProGe::NetlistPort & dataCntrlPortOfSocket(const std::string &socketName) 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)
virtual int inputSocketControlValue(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment) const =0
SocketCodeTable & socketCodes() const
std::vector< std::string > registerVectors
Bookkeeping for reset-needing signals.
MoveSlot * parent() const
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
unsigned int encoding() const
virtual int width() const
void writeLockDumpCode(std::ostream &stream) const
void writeDecompressSignalsVHDL(std::ostream& stream) const; TBR
LImmDstRegisterField & longImmDstRegisterField(int index) const
static std::string simmDataSignalName(const std::string &busName)
const RegisterFile * registerFile() const
static bool containsSimilarGuard(const std::set< TTAMachine::PortGuard * > &guardSet, const TTAMachine::PortGuard &guard)
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
void writeGlockMapping(std::ostream &stream) const
bool separateAddressCycleParameter() const
bool generateLockTrace_
Tells whether to generate global lock tracing code.
bool hasReturnAddressPort() const
bool generateBusEnable_
Bus enable signals for bustrace.
virtual int width() const
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
bool hasGlockPort(const NetlistBlock &block) const
GuardField * parent() const
void setGenerateNoLoopbackGlock(bool generate)
bool syncReset_
Reset synchronously (otherwise asynchronous)