Merge pull request #440 from YosysHQ/lattice-fixes
Fixes for the Lattice SERDES eye demo designs
This commit is contained in:
commit
2d406f3e27
@ -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();
|
||||
|
@ -46,6 +46,9 @@ bool Arch::applyLPF(std::string filename, std::istream &in)
|
||||
while (std::getline(in, line)) {
|
||||
++lineno;
|
||||
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))
|
||||
|
12
ecp5/pack.cc
12
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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user