ice40: Only place IO at valid pins
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
2479b4ecbf
commit
cabdfe3616
@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
NEXTPNR_NAMESPACE_BEGIN
|
||||||
|
|
||||||
static const NetInfo *
|
static const NetInfo *get_net_or_nullptr(const CellInfo *cell,
|
||||||
get_net_or_nullptr(const CellInfo *cell, const IdString port)
|
const IdString port)
|
||||||
{
|
{
|
||||||
auto found = cell->ports.find(port);
|
auto found = cell->ports.find(port);
|
||||||
if (found != cell->ports.end())
|
if (found != cell->ports.end())
|
||||||
@ -97,7 +97,8 @@ bool isValidBelForCell(Design *design, CellInfo *cell, BelId bel)
|
|||||||
|
|
||||||
cells.push_back(cell);
|
cells.push_back(cell);
|
||||||
return logicCellsCompatible(cells);
|
return logicCellsCompatible(cells);
|
||||||
|
} else if (cell->type == "SB_IO") {
|
||||||
|
return design->chip.getBelPackagePin(bel) != "";
|
||||||
} else {
|
} else {
|
||||||
// TODO: IO cell clock checks
|
// TODO: IO cell clock checks
|
||||||
return true;
|
return true;
|
||||||
|
@ -273,6 +273,15 @@ BelId Chip::getPackagePinBel(const std::string &pin) const
|
|||||||
return BelId();
|
return BelId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Chip::getBelPackagePin(BelId bel) const
|
||||||
|
{
|
||||||
|
for (int i = 0; i < package_info->num_pins; i++) {
|
||||||
|
if (package_info->pins[i].bel_index == bel.index) {
|
||||||
|
return std::string(package_info->pins[i].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
bool Chip::estimatePosition(BelId bel, float &x, float &y) const
|
bool Chip::estimatePosition(BelId bel, float &x, float &y) const
|
||||||
|
@ -691,6 +691,7 @@ struct Chip
|
|||||||
}
|
}
|
||||||
|
|
||||||
BelId getPackagePinBel(const std::string &pin) const;
|
BelId getPackagePinBel(const std::string &pin) const;
|
||||||
|
std::string getBelPackagePin(BelId bel) const;
|
||||||
|
|
||||||
// -------------------------------------------------
|
// -------------------------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user