ice40: Don't deduplicate local tracks when counting
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
d2ff5fec08
commit
7abfd36773
@ -39,8 +39,7 @@ static bool logicCellsCompatible(const Context *ctx,
|
|||||||
{
|
{
|
||||||
bool dffs_exist = false, dffs_neg = false;
|
bool dffs_exist = false, dffs_neg = false;
|
||||||
const NetInfo *cen = nullptr, *clk = nullptr, *sr = nullptr;
|
const NetInfo *cen = nullptr, *clk = nullptr, *sr = nullptr;
|
||||||
static std::unordered_set<IdString> locals;
|
int locals_count = 0;
|
||||||
locals.clear();
|
|
||||||
|
|
||||||
for (auto cell : cells) {
|
for (auto cell : cells) {
|
||||||
if (bool_or_default(cell->params, "DFF_ENABLE")) {
|
if (bool_or_default(cell->params, "DFF_ENABLE")) {
|
||||||
@ -51,11 +50,11 @@ static bool logicCellsCompatible(const Context *ctx,
|
|||||||
sr = get_net_or_empty(cell, "SR");
|
sr = get_net_or_empty(cell, "SR");
|
||||||
|
|
||||||
if (!is_global_net(ctx, cen) && cen != nullptr)
|
if (!is_global_net(ctx, cen) && cen != nullptr)
|
||||||
locals.insert(cen->name);
|
locals_count++;
|
||||||
if (!is_global_net(ctx, clk) && clk != nullptr)
|
if (!is_global_net(ctx, clk) && clk != nullptr)
|
||||||
locals.insert(clk->name);
|
locals_count++;
|
||||||
if (!is_global_net(ctx, sr) && sr != nullptr)
|
if (!is_global_net(ctx, sr) && sr != nullptr)
|
||||||
locals.insert(sr->name);
|
locals_count++;
|
||||||
|
|
||||||
if (bool_or_default(cell->params, "NEG_CLK")) {
|
if (bool_or_default(cell->params, "NEG_CLK")) {
|
||||||
dffs_neg = true;
|
dffs_neg = true;
|
||||||
@ -77,16 +76,16 @@ static bool logicCellsCompatible(const Context *ctx,
|
|||||||
*i2 = get_net_or_empty(cell, "I2"),
|
*i2 = get_net_or_empty(cell, "I2"),
|
||||||
*i3 = get_net_or_empty(cell, "I3");
|
*i3 = get_net_or_empty(cell, "I3");
|
||||||
if (i0 != nullptr)
|
if (i0 != nullptr)
|
||||||
locals.insert(i0->name);
|
locals_count++;
|
||||||
if (i1 != nullptr)
|
if (i1 != nullptr)
|
||||||
locals.insert(i1->name);
|
locals_count++;
|
||||||
if (i2 != nullptr)
|
if (i2 != nullptr)
|
||||||
locals.insert(i2->name);
|
locals_count++;
|
||||||
if (i3 != nullptr)
|
if (i3 != nullptr)
|
||||||
locals.insert(i3->name);
|
locals_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return locals.size() <= 32;
|
return locals_count <= 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isBelLocationValid(Context *ctx, BelId bel)
|
bool isBelLocationValid(Context *ctx, BelId bel)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Run ./nextpnr-ice40 --json ice40/blinky.json --run python/dump_design.py
|
# Run ./nextpnr-ice40 --json ice40/blinky.json --run python/dump_design.py
|
||||||
for cell, cinfo in sorted(design.cells, key=lambda x: x.first):
|
for cell, cinfo in sorted(ctx.cells, key=lambda x: x.first):
|
||||||
print("Cell {} : {}".format(cell, cinfo.type))
|
print("Cell {} : {}".format(cell, cinfo.type))
|
||||||
print("\tPorts:")
|
print("\tPorts:")
|
||||||
for port, pinfo in sorted(cinfo.ports, key=lambda x: x.first):
|
for port, pinfo in sorted(cinfo.ports, key=lambda x: x.first):
|
||||||
@ -21,5 +21,5 @@ for cell, cinfo in sorted(design.cells, key=lambda x: x.first):
|
|||||||
print("\t\t{}: {}".format(param, val))
|
print("\t\t{}: {}".format(param, val))
|
||||||
|
|
||||||
if cinfo.bel.index != -1:
|
if cinfo.bel.index != -1:
|
||||||
print("\tBel: {}".format(chip.getBelName(cinfo.bel)))
|
print("\tBel: {}".format(ctx.getBelName(cinfo.bel)))
|
||||||
print()
|
print()
|
||||||
|
Loading…
Reference in New Issue
Block a user