Merge remote-tracking branch 'origin/estdelay' into redist_slack
This commit is contained in:
commit
d5049bf0ed
@ -93,7 +93,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const
|
||||
WireId src_wire = getNetinfoSourceWire(net_info);
|
||||
if (src_wire == WireId())
|
||||
return 0;
|
||||
WireId cursor = getNetinfoSinkWire(net_info, user_idx);
|
||||
|
||||
WireId dst_wire = getNetinfoSinkWire(net_info, user_idx);
|
||||
WireId cursor = dst_wire;
|
||||
delay_t delay = 0;
|
||||
|
||||
while (cursor != WireId() && cursor != src_wire) {
|
||||
@ -107,11 +109,9 @@ delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const
|
||||
}
|
||||
|
||||
if (cursor == src_wire)
|
||||
delay += getWireDelay(src_wire).maxDelay();
|
||||
else
|
||||
delay += estimateDelay(src_wire, cursor);
|
||||
return delay + getWireDelay(src_wire).maxDelay();
|
||||
|
||||
return delay;
|
||||
return predictDelay(src_wire, dst_wire);
|
||||
}
|
||||
|
||||
static uint32_t xorshift32(uint32_t x)
|
||||
|
@ -413,6 +413,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
|
||||
return 200 * (abs(src.location.x - dst.location.x) + abs(src.location.y - dst.location.y));
|
||||
}
|
||||
|
||||
delay_t Arch::predictDelay(WireId src, WireId dst) const
|
||||
{
|
||||
return 200 * (abs(src.location.x - dst.location.x) + abs(src.location.y - dst.location.y));
|
||||
}
|
||||
|
||||
delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const { return budget; }
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
@ -776,6 +776,7 @@ struct Arch : BaseCtx
|
||||
// -------------------------------------------------
|
||||
|
||||
delay_t estimateDelay(WireId src, WireId dst) const;
|
||||
delay_t predictDelay(WireId src, WireId dst) const;
|
||||
delay_t getDelayEpsilon() const { return 20; }
|
||||
delay_t getRipupDelayPenalty() const { return 200; }
|
||||
float getDelayNS(delay_t v) const { return v * 0.001; }
|
||||
|
@ -403,6 +403,15 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
|
||||
return (dx + dy) * grid_distance_to_delay;
|
||||
}
|
||||
|
||||
delay_t Arch::predictDelay(WireId src, WireId dst) const
|
||||
{
|
||||
const WireInfo &s = wires.at(src);
|
||||
const WireInfo &d = wires.at(dst);
|
||||
int dx = abs(s.x - d.x);
|
||||
int dy = abs(s.y - d.y);
|
||||
return (dx + dy) * grid_distance_to_delay;
|
||||
}
|
||||
|
||||
delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const { return budget; }
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
@ -194,6 +194,7 @@ struct Arch : BaseCtx
|
||||
const std::vector<GroupId> &getGroupGroups(GroupId group) const;
|
||||
|
||||
delay_t estimateDelay(WireId src, WireId dst) const;
|
||||
delay_t predictDelay(WireId src, WireId dst) const;
|
||||
delay_t getDelayEpsilon() const { return 0.01; }
|
||||
delay_t getRipupDelayPenalty() const { return 1.0; }
|
||||
float getDelayNS(delay_t v) const { return v; }
|
||||
|
@ -584,6 +584,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
|
||||
int xd = x2 - x1, yd = y2 - y1;
|
||||
int xscale = 120, yscale = 120, offset = 0;
|
||||
|
||||
return xscale * abs(xd) + yscale * abs(yd) + offset;
|
||||
}
|
||||
|
||||
delay_t Arch::predictDelay(WireId src, WireId dst) const
|
||||
{
|
||||
NPNR_ASSERT(src != WireId());
|
||||
int x1 = chip_info->wire_data[src.index].x;
|
||||
int y1 = chip_info->wire_data[src.index].y;
|
||||
|
||||
NPNR_ASSERT(dst != WireId());
|
||||
int x2 = chip_info->wire_data[dst.index].x;
|
||||
int y2 = chip_info->wire_data[dst.index].y;
|
||||
|
||||
int xd = x2 - x1, yd = y2 - y1;
|
||||
int xscale = 120, yscale = 120, offset = 0;
|
||||
|
||||
// if (chip_info->wire_data[src.index].type == WIRE_TYPE_SP4_VERT) {
|
||||
// yd = yd < -4 ? yd + 4 : (yd < 0 ? 0 : yd);
|
||||
// offset = 500;
|
||||
|
@ -697,6 +697,7 @@ struct Arch : BaseCtx
|
||||
// -------------------------------------------------
|
||||
|
||||
delay_t estimateDelay(WireId src, WireId dst) const;
|
||||
delay_t predictDelay(WireId src, WireId dst) const;
|
||||
delay_t getDelayEpsilon() const { return 20; }
|
||||
delay_t getRipupDelayPenalty() const { return 200; }
|
||||
float getDelayNS(delay_t v) const { return v * 0.001; }
|
||||
|
Loading…
Reference in New Issue
Block a user