This commit is contained in:
Miodrag Milanovic 2024-12-20 12:03:53 +01:00
parent 2f537d2ccc
commit b020a47bb8
2 changed files with 21 additions and 21 deletions

View File

@ -19,9 +19,9 @@
#include <fstream> #include <fstream>
#include <boost/algorithm/string.hpp>
#include "config.h" #include "config.h"
#include "gatemate.h" #include "gatemate.h"
#include <boost/algorithm/string.hpp>
#define HIMBAECHEL_CONSTIDS "uarch/gatemate/constids.inc" #define HIMBAECHEL_CONSTIDS "uarch/gatemate/constids.inc"
#include "himbaechel_constids.h" #include "himbaechel_constids.h"
@ -122,14 +122,12 @@ struct BitstreamBackend
cc.tiles[loc].add_word(stringf("GPIO.%s", p.first.c_str(ctx)), p.second.as_bits()); cc.tiles[loc].add_word(stringf("GPIO.%s", p.first.c_str(ctx)), p.second.as_bits());
} }
break; break;
case id_CPE.index: case id_CPE.index: {
{ int x = getInTileIndex(ctx, cell.second.get()->bel.tile);
int x = getInTileIndex(ctx,cell.second.get()->bel.tile);
for (auto &p : params) { for (auto &p : params) {
cc.tiles[loc].add_word(stringf("CPE%d.%s", x, p.first.c_str(ctx)), p.second.as_bits()); cc.tiles[loc].add_word(stringf("CPE%d.%s", x, p.first.c_str(ctx)), p.second.as_bits());
} }
} } break;
break;
default: default:
break; break;
} }
@ -149,9 +147,9 @@ struct BitstreamBackend
IdString name = IdString(extra_data.name); IdString name = IdString(extra_data.name);
CfgLoc loc = getConfigLoc(ctx, pip.tile); CfgLoc loc = getConfigLoc(ctx, pip.tile);
std::string word = name.c_str(ctx); std::string word = name.c_str(ctx);
int x = getInTileIndex(ctx,pip.tile); int x = getInTileIndex(ctx, pip.tile);
if (boost::starts_with(word, "IM.")) if (boost::starts_with(word, "IM."))
boost::replace_all(word, "IM.", stringf("IM%d.",x)); boost::replace_all(word, "IM.", stringf("IM%d.", x));
if (boost::starts_with(word, "IOES.")) if (boost::starts_with(word, "IOES."))
boost::replace_all(word, "IOES.", "IOES1."); boost::replace_all(word, "IOES.", "IOES1.");
cc.tiles[loc].add_word(word, int_to_bitvector(extra_data.value, extra_data.bits)); cc.tiles[loc].add_word(word, int_to_bitvector(extra_data.value, extra_data.bits));

View File

@ -64,19 +64,21 @@ void GateMateImpl::postRoute()
continue; continue;
if (extra_data.type == PipExtra::PIP_EXTRA_CPE) { if (extra_data.type == PipExtra::PIP_EXTRA_CPE) {
IdStringList id = ctx->getPipName(w.second.pip); IdStringList id = ctx->getPipName(w.second.pip);
BelId bel = ctx->getBelByName(IdStringList::concat(id[0], ctx->id("CPE"))); BelId bel = ctx->getBelByName(IdStringList::concat(id[0], id_CPE));
IdString type = ctx->getBelType(bel);
if (!ctx->getBoundBelCell(bel)) { if (!ctx->getBoundBelCell(bel)) {
CellInfo *cell = ctx->createCell(ctx->id(ctx->nameOfBel(bel)), type); CellInfo *cell = ctx->createCell(ctx->id(ctx->nameOfBel(bel)), id_CPE);
ctx->bindBel(bel, cell, PlaceStrength::STRENGTH_FIXED); ctx->bindBel(bel, cell, PlaceStrength::STRENGTH_FIXED);
cell->params[id_INIT_L00] = Property(5,4); //"0101"); }
cell->params[id_INIT_L01] = Property(15,4); //Property("1111"); CellInfo *cell = ctx->getBoundBelCell(bel);
cell->params[id_INIT_L02] = Property(15,4); //Property("1111"); if (IdString(extra_data.name) == id_RAM_O2) {
cell->params[id_INIT_L03] = Property(15,4); //Property("1111"); cell->params[id_INIT_L00] = Property(5, 4); //"0101");
cell->params[id_INIT_L10] = Property(8,4); //Property("1000"); cell->params[id_INIT_L01] = Property(15, 4); // Property("1111");
cell->params[id_INIT_L20] = Property(12,4); //Property("1100"); cell->params[id_INIT_L02] = Property(15, 4); // Property("1111");
cell->params[ctx->id("O2")] = Property(3,2); cell->params[id_INIT_L03] = Property(15, 4); // Property("1111");
cell->params[id_RAM_O2] = Property(1,1); cell->params[id_INIT_L10] = Property(8, 4); // Property("1000");
cell->params[id_INIT_L20] = Property(12, 4); // Property("1100");
cell->params[ctx->id("O2")] = Property(3, 2);
cell->params[id_RAM_O2] = Property(1, 1);
} }
} }
} }