ecp5: Small DRAM routing fixes
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
9ebec3b87f
commit
8cbc92b7f3
@ -302,6 +302,14 @@ class Ecp5GlobalRouter
|
||||
ctx->nets[glbnet->name] = std::move(glbnet);
|
||||
return glbptr;
|
||||
}
|
||||
|
||||
int global_route_priority(const PortRef &load)
|
||||
{
|
||||
if (load.port == id_WCK || load.port == id_WRE)
|
||||
return 90;
|
||||
return 99;
|
||||
}
|
||||
|
||||
Context *ctx;
|
||||
|
||||
public:
|
||||
@ -333,7 +341,13 @@ class Ecp5GlobalRouter
|
||||
NetInfo *global = insert_dcc(clock);
|
||||
bool routed = route_onto_global(global, glbid);
|
||||
NPNR_ASSERT(routed);
|
||||
for (const auto &user : global->users) {
|
||||
|
||||
// WCK must have routing priority
|
||||
auto sorted_users = global->users;
|
||||
std::sort(sorted_users.begin(), sorted_users.end(), [this](const PortRef &a, const PortRef &b) {
|
||||
return global_route_priority(a) < global_route_priority(b);
|
||||
});
|
||||
for (const auto &user : sorted_users) {
|
||||
route_logic_tile_global(global, glbid, user);
|
||||
}
|
||||
}
|
||||
|
16
ecp5/pack.cc
16
ecp5/pack.cc
@ -598,9 +598,11 @@ class Ecp5Packer
|
||||
if (f0net != nullptr) {
|
||||
ff0 = net_only_drives(ctx, f0net, is_ff, ctx->id("DI"), false);
|
||||
if (ff0 != nullptr && can_add_ff_to_tile(tile_ffs, ff0)) {
|
||||
ff_packing.push_back(std::make_tuple(ff0, slice, 0));
|
||||
tile_ffs.push_back(ff0);
|
||||
packed_cells.insert(ff0->name);
|
||||
if (net_or_nullptr(ff0, ctx->id("CLK")) == net_or_nullptr(slice, ctx->id("WCK"))) {
|
||||
ff_packing.push_back(std::make_tuple(ff0, slice, 0));
|
||||
tile_ffs.push_back(ff0);
|
||||
packed_cells.insert(ff0->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -610,9 +612,11 @@ class Ecp5Packer
|
||||
ff1 = net_only_drives(ctx, f1net, is_ff, ctx->id("DI"), false);
|
||||
if (ff1 != nullptr && (ff0 == nullptr || can_pack_ffs(ff0, ff1)) &&
|
||||
can_add_ff_to_tile(tile_ffs, ff1)) {
|
||||
ff_packing.push_back(std::make_tuple(ff1, slice, 1));
|
||||
tile_ffs.push_back(ff1);
|
||||
packed_cells.insert(ff1->name);
|
||||
if (net_or_nullptr(ff1, ctx->id("CLK")) == net_or_nullptr(slice, ctx->id("WCK"))) {
|
||||
ff_packing.push_back(std::make_tuple(ff1, slice, 1));
|
||||
tile_ffs.push_back(ff1);
|
||||
packed_cells.insert(ff1->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user