aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5')
-rw-r--r--ecp5/bitstream.cc3
-rw-r--r--ecp5/globals.cc13
-rw-r--r--ecp5/lpf.cc3
-rw-r--r--ecp5/main.cc10
-rw-r--r--ecp5/pack.cc12
5 files changed, 35 insertions, 6 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc
index 542ee6ca..d6b1c701 100644
--- a/ecp5/bitstream.cc
+++ b/ecp5/bitstream.cc
@@ -932,7 +932,8 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex
else
log_error("cannot set DRIVE on differential IO at location %s\n", pio.c_str());
cc.tiles[pio_tile].add_enum(pio + ".DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12"));
- cc.tiles[pio_tile].add_enum(other + ".DRIVE", str_or_default(ci->attrs, ctx->id("DRIVE"), "12"));
+ cc.tiles[pio_tile].add_enum(other + ".DRIVE",
+ str_or_default(ci->attrs, ctx->id("DRIVE"), "12"));
}
} else {
if (!drive_3v3_warning_done)
diff --git a/ecp5/globals.cc b/ecp5/globals.cc
index 65b1710f..550af615 100644
--- a/ecp5/globals.cc
+++ b/ecp5/globals.cc
@@ -63,11 +63,20 @@ class Ecp5GlobalRouter
return false;
}
+ bool is_logic_port(const PortRef &user)
+ {
+ if (user.cell->type == id_TRELLIS_SLICE && user.port != id_CLK && user.port != id_WCK)
+ return true;
+ return false;
+ }
+
std::vector<NetInfo *> get_clocks()
{
std::unordered_map<IdString, int> clockCount;
for (auto &net : ctx->nets) {
NetInfo *ni = net.second.get();
+ if (ni->name == ctx->id("$PACKER_GND_NET") || ni->name == ctx->id("$PACKER_VCC_NET"))
+ continue;
clockCount[ni->name] = 0;
for (const auto &user : ni->users) {
if (is_clock_port(user)) {
@@ -160,6 +169,8 @@ class Ecp5GlobalRouter
if (ctx->checkWireAvail(next)) {
for (auto pip : ctx->getPipsUphill(next)) {
WireId src = ctx->getPipSrcWire(pip);
+ if (backtrace.count(src))
+ continue;
backtrace[src] = pip;
upstream.push(src);
}
@@ -412,6 +423,8 @@ class Ecp5GlobalRouter
keep_users.push_back(user);
} else if (net->driver.cell->type == id_EXTREFB && user.cell->type == id_DCUA) {
keep_users.push_back(user);
+ } else if (is_logic_port(user)) {
+ keep_users.push_back(user);
} else {
glbnet->users.push_back(user);
user.cell->ports.at(user.port).net = glbnet.get();
diff --git a/ecp5/lpf.cc b/ecp5/lpf.cc
index e626cc54..e740b737 100644
--- a/ecp5/lpf.cc
+++ b/ecp5/lpf.cc
@@ -48,6 +48,9 @@ bool Arch::applyLPF(std::string filename, std::istream &in)
size_t cstart = line.find('#');
if (cstart != std::string::npos)
line = line.substr(0, cstart);
+ cstart = line.find("//");
+ if (cstart != std::string::npos)
+ line = line.substr(0, cstart);
if (isempty(line))
continue;
linebuf += line;
diff --git a/ecp5/main.cc b/ecp5/main.cc
index a24011db..f1cb9760 100644
--- a/ecp5/main.cc
+++ b/ecp5/main.cc
@@ -174,12 +174,12 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st
if (values.find("arch.name") != values.end()) {
std::string arch_name = values["arch.name"].as_string();
if (arch_name != "ecp5")
- log_error("Unsuported architecture '%s'.\n", arch_name.c_str());
+ log_error("Unsupported architecture '%s'.\n", arch_name.c_str());
}
if (values.find("arch.type") != values.end()) {
std::string arch_type = values["arch.type"].as_string();
if (chipArgs.type != ArchArgs::NONE)
- log_error("Overriding architecture is unsuported.\n");
+ log_error("Overriding architecture is unsupported.\n");
if (arch_type == "lfe5u_12f")
chipArgs.type = ArchArgs::LFE5U_12F;
@@ -203,11 +203,11 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st
chipArgs.type = ArchArgs::LFE5UM5G_85F;
if (chipArgs.type == ArchArgs::NONE)
- log_error("Unsuported FPGA type '%s'.\n", arch_type.c_str());
+ log_error("Unsupported FPGA type '%s'.\n", arch_type.c_str());
}
if (values.find("arch.package") != values.end()) {
if (vm.count("package"))
- log_error("Overriding architecture is unsuported.\n");
+ log_error("Overriding architecture is unsupported.\n");
chipArgs.package = values["arch.package"].as_string();
}
if (values.find("arch.speed") != values.end()) {
@@ -219,7 +219,7 @@ std::unique_ptr<Context> ECP5CommandHandler::createContext(std::unordered_map<st
else if (arch_speed == "8")
chipArgs.speed = ArchArgs::SPEED_8;
else
- log_error("Unsuported speed '%s'.\n", arch_speed.c_str());
+ log_error("Unsupported speed '%s'.\n", arch_speed.c_str());
}
if (chipArgs.type == ArchArgs::NONE)
chipArgs.type = ArchArgs::LFE5U_45F;
diff --git a/ecp5/pack.cc b/ecp5/pack.cc
index 55b2c791..fb8a95e9 100644
--- a/ecp5/pack.cc
+++ b/ecp5/pack.cc
@@ -1617,6 +1617,18 @@ class Ecp5Packer
for (auto pin : ctx->getBelPins(exemplar_bel))
if (ctx->getBelPinType(exemplar_bel, pin) == PORT_IN)
autocreate_empty_port(ci, pin);
+ // Disconnect these ports if connected to constant to prevent routing failure
+ for (auto ndport : {id_D_TXBIT_CLKP_FROM_ND, id_D_TXBIT_CLKN_FROM_ND, id_D_SYNC_ND,
+ id_D_TXPLL_LOL_FROM_ND, id_CH0_HDINN, id_CH0_HDINP, id_CH1_HDINN, id_CH1_HDINP}) {
+ const NetInfo *net = get_net_or_empty(ci, ndport);
+ if (net == nullptr || net->driver.cell == nullptr)
+ continue;
+ IdString ct = net->driver.cell->type;
+ if (ct == ctx->id("GND") || ct == ctx->id("VCC")) {
+ disconnect_port(ctx, ci, ndport);
+ ci->ports.erase(ndport);
+ }
+ }
}
}
for (auto cell : sorted(ctx->cells)) {