1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-05-03 14:48:34 +00:00

Remove isValidBelForCell

This Arch API dates from when we were first working out how to
implement placement validity checking, and in practice is little used by
the core parts of placer1/HeAP and the Arch implementation involves a
lot of duplication with isBelLocationValid.

In the short term; placement validity checking is better served by the
combination of checkBelAvail and isValidBelForCellType before placement;
followed by isBelLocationValid after placement (potentially after
moving/swapping multiple cells).

Longer term, removing this API makes things a bit cleaner for a new
validity checking API.

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat
2021-02-16 11:52:16 +00:00
parent 815b57b9e1
commit c7c13cd95f
24 changed files with 174 additions and 291 deletions

View File

@@ -652,8 +652,8 @@ strict legality enforcement. It is not required that all bels within a bucket
are strictly equivelant.
Strict legality step will enforce those differences, along with additional
local constraints. `isValidBelForCell`, `isValidBelForCellType`, and
`isBelLocationValid` are used to enforce strict legality checks.
local constraints. `isValidBelForCellType`, and `isBelLocationValid` are used
to enforce strict legality checks.
### BelBucketRangeT getBelBuckets() const
@@ -702,18 +702,10 @@ return the same value regardless if other cells are placed within the fabric.
*BaseArch default: returns `cell_type == getBelType(bel)`*
### bool isValidBelForCell(CellInfo \*cell, BelId bel) const
Returns true if the given cell can be bound to the given bel, considering
other bound resources. For example, this can be used if there is only
a certain number of different clock signals allowed for a group of bels.
*BaseArch default: returns true*
### bool isBelLocationValid(BelId bel) const
Returns true if a bell in the current configuration is valid, i.e. if
`isValidBelForCell()` would return true for the current mapping.
Returns true if a bel in the current configuration is legal (for example,
a flipflop's clock signal is correctly shared with all bels in a slice.)
*BaseArch default: returns true*

View File

@@ -75,7 +75,7 @@ The job of the placer in nextpnr is to find a suitable bel for each cell in the
Placers might want to create their own indices of bels (for example, bels by type and location) to speed up the search.
As nextpnr allows arbitrary constraints on bels for more advanced packer-free flows and complex real-world architectures; placements must be checked for legality using `isValidBelForCell` (before placement) or `isBelLocationValid` (after placement) and the placement rejected if invalid. For analytical placement algorithms; after creating a spread-out AP solution the legality of placing each cell needs to be checked. In practice, the cost of this is fairly low as the architecture should ensure these functions are as fast as possible.
As nextpnr allows arbitrary constraints on bels for more advanced packer-free flows and complex real-world architectures; placements must be checked for legality using `isBelLocationValid` (after placement) and the placement rejected if invalid. For analytical placement algorithms; after creating a spread-out AP solution the legality of placing each cell needs to be checked. In practice, the cost of this is fairly low as the architecture should ensure these functions are as fast as possible.
There are several routes for timing information in the placer:
- sink `PortRef`s have a `budget` value annotated by calling `assign_budget` which is an estimate of the maximum delay that an arc may have