Working compile of ECP5.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
This commit is contained in:
parent
71e210dd4b
commit
d03d9d839b
@ -187,7 +187,7 @@ class HeAPPlacer
|
|||||||
heap_runs.push_back(std::unordered_set<PartitionId>{partition});
|
heap_runs.push_back(std::unordered_set<PartitionId>{partition});
|
||||||
all_partitions.insert(partition);
|
all_partitions.insert(partition);
|
||||||
}
|
}
|
||||||
partition_count[cell->type]++;
|
partition_count[partition]++;
|
||||||
}
|
}
|
||||||
// If more than 98% of cells are one cell type, always solve all at once
|
// If more than 98% of cells are one cell type, always solve all at once
|
||||||
// Otherwise, follow full HeAP strategy of rotate&all
|
// Otherwise, follow full HeAP strategy of rotate&all
|
||||||
@ -252,8 +252,10 @@ class HeAPPlacer
|
|||||||
|
|
||||||
legal_hpwl = total_hpwl();
|
legal_hpwl = total_hpwl();
|
||||||
auto run_stopt = std::chrono::high_resolution_clock::now();
|
auto run_stopt = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
|
IdString partition_name = ctx->getPartitionName(*run.begin());
|
||||||
log_info(" at iteration #%d, type %s: wirelen solved = %d, spread = %d, legal = %d; time = %.02fs\n",
|
log_info(" at iteration #%d, type %s: wirelen solved = %d, spread = %d, legal = %d; time = %.02fs\n",
|
||||||
iter + 1, (run.size() > 1 ? "ALL" : run.begin()->c_str(ctx)), int(solved_hpwl),
|
iter + 1, (run.size() > 1 ? "ALL" : partition_name.c_str(ctx)), int(solved_hpwl),
|
||||||
int(spread_hpwl), int(legal_hpwl),
|
int(spread_hpwl), int(legal_hpwl),
|
||||||
std::chrono::duration<double>(run_stopt - run_startt).count());
|
std::chrono::duration<double>(run_stopt - run_startt).count());
|
||||||
}
|
}
|
||||||
@ -558,7 +560,7 @@ class HeAPPlacer
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup the cells to be solved, returns the number of rows
|
// Setup the cells to be solved, returns the number of rows
|
||||||
int setup_solve_cells(std::unordered_set<IdString> *celltypes = nullptr)
|
int setup_solve_cells(std::unordered_set<PartitionId> *partitions = nullptr)
|
||||||
{
|
{
|
||||||
int row = 0;
|
int row = 0;
|
||||||
solve_cells.clear();
|
solve_cells.clear();
|
||||||
@ -567,7 +569,7 @@ class HeAPPlacer
|
|||||||
cell.second->udata = dont_solve;
|
cell.second->udata = dont_solve;
|
||||||
// Then update cells to be placed, which excludes cell children
|
// Then update cells to be placed, which excludes cell children
|
||||||
for (auto cell : place_cells) {
|
for (auto cell : place_cells) {
|
||||||
if (celltypes && !celltypes->count(cell->type))
|
if (partitions && !partitions->count(ctx->getPartitionForCellType(cell->type)))
|
||||||
continue;
|
continue;
|
||||||
cell->udata = row++;
|
cell->udata = row++;
|
||||||
solve_cells.push_back(cell);
|
solve_cells.push_back(cell);
|
||||||
@ -958,7 +960,7 @@ class HeAPPlacer
|
|||||||
if (vc->region != nullptr && vc->region->constr_bels && !vc->region->bels.count(target))
|
if (vc->region != nullptr && vc->region->constr_bels && !vc->region->bels.count(target))
|
||||||
goto fail;
|
goto fail;
|
||||||
CellInfo *bound;
|
CellInfo *bound;
|
||||||
if (target == BelId() || ctx->isValidBelForCellType(vc->type, target))
|
if (target == BelId() || !ctx->isValidBelForCellType(vc->type, target))
|
||||||
goto fail;
|
goto fail;
|
||||||
bound = ctx->getBoundBelCell(target);
|
bound = ctx->getBoundBelCell(target);
|
||||||
// Chains cannot overlap
|
// Chains cannot overlap
|
||||||
|
@ -126,7 +126,7 @@ Arch::Arch(ArchArgs args) : args(args)
|
|||||||
|
|
||||||
PartitionId partition;
|
PartitionId partition;
|
||||||
partition.name = bel_type;
|
partition.name = bel_type;
|
||||||
partitions.push_back(partitions);
|
partitions.push_back(partition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,6 +131,10 @@ struct PartitionId {
|
|||||||
|
|
||||||
bool operator==(const PartitionId &other) const { return (name == other.name); }
|
bool operator==(const PartitionId &other) const { return (name == other.name); }
|
||||||
bool operator!=(const PartitionId &other) const { return (name != other.name); }
|
bool operator!=(const PartitionId &other) const { return (name != other.name); }
|
||||||
|
bool operator<(const PartitionId &other) const
|
||||||
|
{
|
||||||
|
return name < other.name;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GroupId
|
struct GroupId
|
||||||
@ -269,4 +273,14 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PartitionId>
|
||||||
|
{
|
||||||
|
std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX PartitionId &partition) const noexcept
|
||||||
|
{
|
||||||
|
std::size_t seed = 0;
|
||||||
|
boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(partition.name));
|
||||||
|
return seed;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
Loading…
Reference in New Issue
Block a user