ice40: Remove use of deprecated APIs
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
e200c281d9
commit
5a170f286c
@ -71,7 +71,8 @@ bool Arch::isBelLocationValid(BelId bel) const
|
|||||||
{
|
{
|
||||||
if (getBelType(bel) == TYPE_ICESTORM_LC) {
|
if (getBelType(bel) == TYPE_ICESTORM_LC) {
|
||||||
std::vector<const CellInfo *> bel_cells;
|
std::vector<const CellInfo *> bel_cells;
|
||||||
for (auto bel_other : getBelsAtSameTile(bel)) {
|
Loc bel_loc = getBelLocation(bel);
|
||||||
|
for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) {
|
||||||
IdString cell_other = getBoundBelCell(bel_other);
|
IdString cell_other = getBoundBelCell(bel_other);
|
||||||
if (cell_other != IdString()) {
|
if (cell_other != IdString()) {
|
||||||
const CellInfo *ci_other = cells.at(cell_other).get();
|
const CellInfo *ci_other = cells.at(cell_other).get();
|
||||||
@ -94,8 +95,8 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
|
|||||||
NPNR_ASSERT(getBelType(bel) == TYPE_ICESTORM_LC);
|
NPNR_ASSERT(getBelType(bel) == TYPE_ICESTORM_LC);
|
||||||
|
|
||||||
std::vector<const CellInfo *> bel_cells;
|
std::vector<const CellInfo *> bel_cells;
|
||||||
|
Loc bel_loc = getBelLocation(bel);
|
||||||
for (auto bel_other : getBelsAtSameTile(bel)) {
|
for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) {
|
||||||
IdString cell_other = getBoundBelCell(bel_other);
|
IdString cell_other = getBoundBelCell(bel_other);
|
||||||
if (cell_other != IdString() && bel_other != bel) {
|
if (cell_other != IdString() && bel_other != bel) {
|
||||||
const CellInfo *ci_other = cells.at(cell_other).get();
|
const CellInfo *ci_other = cells.at(cell_other).get();
|
||||||
|
@ -311,8 +311,9 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne
|
|||||||
(user.port != ctx->id("CLK") &&
|
(user.port != ctx->id("CLK") &&
|
||||||
((constval && user.port == ctx->id("CE")) || (!constval && user.port != ctx->id("CE"))))) {
|
((constval && user.port == ctx->id("CE")) || (!constval && user.port != ctx->id("CE"))))) {
|
||||||
uc->ports[user.port].net = nullptr;
|
uc->ports[user.port].net = nullptr;
|
||||||
} else if (is_ram(ctx, uc) && !constval && user.port != ctx->id("RCLK") && user.port != ctx->id("RCLKN") && user.port != ctx->id("WCLK") && user.port != ctx->id("WCLKN")
|
} else if (is_ram(ctx, uc) && !constval && user.port != ctx->id("RCLK") && user.port != ctx->id("RCLKN") &&
|
||||||
&& user.port != ctx->id("RCLKE") && user.port != ctx->id("WCLKE")) {
|
user.port != ctx->id("WCLK") && user.port != ctx->id("WCLKN") && user.port != ctx->id("RCLKE") &&
|
||||||
|
user.port != ctx->id("WCLKE")) {
|
||||||
uc->ports[user.port].net = nullptr;
|
uc->ports[user.port].net = nullptr;
|
||||||
} else {
|
} else {
|
||||||
uc->ports[user.port].net = constnet;
|
uc->ports[user.port].net = constnet;
|
||||||
|
@ -75,11 +75,9 @@ static void get_chain_midpoint(const Context *ctx, const CellChain &chain, float
|
|||||||
for (auto cell : chain.cells) {
|
for (auto cell : chain.cells) {
|
||||||
if (cell->bel == BelId())
|
if (cell->bel == BelId())
|
||||||
continue;
|
continue;
|
||||||
int bel_x, bel_y;
|
Loc bel_loc = ctx->getBelLocation(cell->bel);
|
||||||
bool bel_gb;
|
total_x += bel_loc.x;
|
||||||
ctx->estimatePosition(cell->bel, bel_x, bel_y, bel_gb);
|
total_y += bel_loc.y;
|
||||||
total_x += bel_x;
|
|
||||||
total_y += bel_y;
|
|
||||||
N++;
|
N++;
|
||||||
}
|
}
|
||||||
NPNR_ASSERT(N > 0);
|
NPNR_ASSERT(N > 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user