clangformat
This commit is contained in:
parent
ae9ccfa5ad
commit
a0b6d3b19b
71
xc7/arch.cc
71
xc7/arch.cc
@ -48,7 +48,8 @@ TorcInfo::TorcInfo(Arch *ctx, const std::string &inDeviceName, const std::string
|
||||
const auto &pd = site.getPrimitiveDefPtr();
|
||||
const auto &type = pd->getName();
|
||||
const auto &tile_info = tiles.getTileInfo(site.getTileIndex());
|
||||
const auto x = (tile_info.getCol() + 1) / 2; // Divide by 2 because XDL coordinate space counts the INT tiles between CLBs
|
||||
const auto x = (tile_info.getCol() + 1) /
|
||||
2; // Divide by 2 because XDL coordinate space counts the INT tiles between CLBs
|
||||
const auto y = tile_info.getRow();
|
||||
if (type == "SLICEL" || type == "SLICEM") {
|
||||
bel_to_site_index.push_back(i);
|
||||
@ -134,11 +135,20 @@ TorcInfo::TorcInfo(Arch *ctx, const std::string &inDeviceName, const std::string
|
||||
auto wire_name = wireInfo.getName();
|
||||
if (boost::regex_match(wire_name, what, re_124)) {
|
||||
switch (what.str(2)[0]) {
|
||||
case '1': tile_delays[wireIndex] = 150; break;
|
||||
case '2': tile_delays[wireIndex] = 170; break;
|
||||
case '4': tile_delays[wireIndex] = 210; break;
|
||||
case '6': tile_delays[wireIndex] = 210; break;
|
||||
default: throw;
|
||||
case '1':
|
||||
tile_delays[wireIndex] = 150;
|
||||
break;
|
||||
case '2':
|
||||
tile_delays[wireIndex] = 170;
|
||||
break;
|
||||
case '4':
|
||||
tile_delays[wireIndex] = 210;
|
||||
break;
|
||||
case '6':
|
||||
tile_delays[wireIndex] = 210;
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
}
|
||||
} else if (boost::regex_match(wire_name, what, re_L)) {
|
||||
std::string l(what[2]);
|
||||
@ -157,13 +167,26 @@ TorcInfo::TorcInfo(Arch *ctx, const std::string &inDeviceName, const std::string
|
||||
tile_delays[wireIndex] = 190;
|
||||
} else if (boost::regex_match(wire_name, what, re_CLB_I1_6)) {
|
||||
switch (what.str(2)[0]) {
|
||||
case '1': tile_delays[wireIndex] = 280; break;
|
||||
case '2': tile_delays[wireIndex] = 280; break;
|
||||
case '3': tile_delays[wireIndex] = 180; break;
|
||||
case '4': tile_delays[wireIndex] = 180; break;
|
||||
case '5': tile_delays[wireIndex] = 80; break;
|
||||
case '6': tile_delays[wireIndex] = 40; break;
|
||||
default: throw;
|
||||
case '1':
|
||||
tile_delays[wireIndex] = 280;
|
||||
break;
|
||||
case '2':
|
||||
tile_delays[wireIndex] = 280;
|
||||
break;
|
||||
case '3':
|
||||
tile_delays[wireIndex] = 180;
|
||||
break;
|
||||
case '4':
|
||||
tile_delays[wireIndex] = 180;
|
||||
break;
|
||||
case '5':
|
||||
tile_delays[wireIndex] = 80;
|
||||
break;
|
||||
case '6':
|
||||
tile_delays[wireIndex] = 40;
|
||||
break;
|
||||
default:
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -198,9 +221,9 @@ TorcInfo::TorcInfo(Arch *ctx, const std::string &inDeviceName, const std::string
|
||||
tileTypeName, "CLB"); // Disable all CLB route-throughs (i.e. LUT in->out, LUT A->AMUX, for now)
|
||||
|
||||
arcs.clear();
|
||||
const_cast<DDB &>(*ddb).expandSegmentSinks(currentTilewire, arcs, DDB::eExpandDirectionNone, false /* inUseTied */,
|
||||
true /*inUseRegular */, true /* inUseIrregular */,
|
||||
!clb /* inUseRoutethrough */);
|
||||
const_cast<DDB &>(*ddb).expandSegmentSinks(currentTilewire, arcs, DDB::eExpandDirectionNone,
|
||||
false /* inUseTied */, true /*inUseRegular */,
|
||||
true /* inUseIrregular */, !clb /* inUseRoutethrough */);
|
||||
|
||||
auto &pips = wire_to_pips_downhill[w.index];
|
||||
pips.reserve(arcs.size());
|
||||
@ -411,8 +434,7 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bel_type == id_PS7) {
|
||||
} else if (bel_type == id_PS7) {
|
||||
// e.g. Convert DDRARB[0] -> DDRARB0
|
||||
boost::erase_all(pin_name, "[");
|
||||
boost::erase_all(pin_name, "]");
|
||||
@ -578,10 +600,7 @@ IdString Arch::getPipName(PipId pip) const
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
BelId Arch::getPackagePinBel(const std::string &pin) const
|
||||
{
|
||||
return getBelByName(id(pin));
|
||||
}
|
||||
BelId Arch::getPackagePinBel(const std::string &pin) const { return getBelByName(id(pin)); }
|
||||
|
||||
std::string Arch::getBelPackagePin(BelId bel) const
|
||||
{
|
||||
@ -732,10 +751,7 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay
|
||||
|
||||
bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); }
|
||||
|
||||
bool Arch::route()
|
||||
{
|
||||
return router1(getCtx(), Router1Cfg(getCtx()));
|
||||
}
|
||||
bool Arch::route() { return router1(getCtx(), Router1Cfg(getCtx())); }
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
@ -974,8 +990,7 @@ TimingPortClass Arch::getPortTimingClass(const CellInfo *cell, IdString port, in
|
||||
if (port == id_O)
|
||||
return TMG_COMB_OUTPUT;
|
||||
return TMG_COMB_INPUT;
|
||||
}
|
||||
else if (cell->type == id_PS7) {
|
||||
} else if (cell->type == id_PS7) {
|
||||
// TODO
|
||||
return TMG_IGNORE;
|
||||
}
|
||||
|
17
xc7/arch.h
17
xc7/arch.h
@ -324,7 +324,8 @@ struct TorcInfo
|
||||
private:
|
||||
void _construct();
|
||||
static std::vector<SiteIndex> construct_bel_to_site_index(Arch *ctx, const Sites &sites);
|
||||
static std::vector<BelId> construct_site_index_to_bel(Arch *ctx, const Sites &sites, const std::vector<SiteIndex> &bel_to_site_index);
|
||||
static std::vector<BelId> construct_site_index_to_bel(Arch *ctx, const Sites &sites,
|
||||
const std::vector<SiteIndex> &bel_to_site_index);
|
||||
static std::vector<IdString> construct_site_index_to_type(Arch *ctx, const Sites &sites);
|
||||
static std::vector<Loc> construct_bel_to_loc(const Sites &sites, const Tiles &tiles, const int num_bels,
|
||||
const std::vector<IdString> &site_index_to_type);
|
||||
@ -332,8 +333,8 @@ struct TorcInfo
|
||||
construct_wire_to_tilewire(const Segments &segments, const Tiles &tiles,
|
||||
std::unordered_map<Segments::SegmentReference, int> &segment_to_wire,
|
||||
std::unordered_map<Tilewire, int> &trivial_to_wire);
|
||||
static std::vector<DelayInfo> construct_wire_to_delay(const Tiles &tiles, const std::vector<Tilewire> &wire_to_tilewire,
|
||||
const DDB &ddb);
|
||||
static std::vector<DelayInfo>
|
||||
construct_wire_to_delay(const Tiles &tiles, const std::vector<Tilewire> &wire_to_tilewire, const DDB &ddb);
|
||||
static std::vector<Arc> construct_pip_to_arc(const std::vector<Tilewire> &wire_to_tilewire, const DDB &ddb,
|
||||
std::vector<std::vector<int>> &wire_to_pips_uphill,
|
||||
std::vector<std::vector<int>> &wire_to_pips_downhill);
|
||||
@ -678,10 +679,7 @@ struct Arch : BaseCtx
|
||||
return wire_to_net[wire.index];
|
||||
}
|
||||
|
||||
WireId getConflictingWireWire(WireId wire) const
|
||||
{
|
||||
return wire;
|
||||
}
|
||||
WireId getConflictingWireWire(WireId wire) const { return wire; }
|
||||
|
||||
NetInfo *getConflictingWireNet(WireId wire) const
|
||||
{
|
||||
@ -779,10 +777,7 @@ struct Arch : BaseCtx
|
||||
return pip_to_net[pip.index];
|
||||
}
|
||||
|
||||
WireId getConflictingPipWire(PipId pip) const
|
||||
{
|
||||
return WireId();
|
||||
}
|
||||
WireId getConflictingPipWire(PipId pip) const { return WireId(); }
|
||||
|
||||
NetInfo *getConflictingPipNet(PipId pip) const
|
||||
{
|
||||
|
17
xc7/delay.cc
17
xc7/delay.cc
@ -104,7 +104,8 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
|
||||
const auto &src_info = torc_info->tiles.getTileInfo(src_tw.getTileIndex());
|
||||
const auto &dst_tw = torc_info->wire_to_tilewire[dst.index];
|
||||
const auto &dst_info = torc_info->tiles.getTileInfo(dst_tw.getTileIndex());
|
||||
auto abs_delta_x = (abs(src_info.getCol() - dst_info.getCol()) + 1)/ 2; // Divide by 2 because XDL coordinate space counts the INT tiles between CLBs
|
||||
auto abs_delta_x = (abs(src_info.getCol() - dst_info.getCol()) + 1) /
|
||||
2; // Divide by 2 because XDL coordinate space counts the INT tiles between CLBs
|
||||
auto abs_delta_y = abs(src_info.getRow() - dst_info.getRow());
|
||||
#if 1
|
||||
auto div_LH = std::div(abs_delta_x, 12);
|
||||
@ -118,10 +119,9 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
|
||||
auto div_V2 = std::div(div_V4.rem, 2);
|
||||
auto num_H1 = div_H2.rem;
|
||||
auto num_V1 = div_V2.rem;
|
||||
return div_LH.quot * 360 + div_LVB.quot * 300 + div_LV.quot * 350
|
||||
+ (div_H6.quot + div_H4.quot + div_V6.quot + div_V4.quot) * 210
|
||||
+ (div_H2.quot + div_V2.quot) * 170
|
||||
+ (num_H1 + num_V1) * 150;
|
||||
return div_LH.quot * 360 + div_LVB.quot * 300 + div_LV.quot * 350 +
|
||||
(div_H6.quot + div_H4.quot + div_V6.quot + div_V4.quot) * 210 + (div_H2.quot + div_V2.quot) * 170 +
|
||||
(num_H1 + num_V1) * 150;
|
||||
#else
|
||||
return std::max(150, 33 * abs_delta_x + 66 * abs_delta_y);
|
||||
#endif
|
||||
@ -146,10 +146,9 @@ delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const
|
||||
auto div_V2 = std::div(div_V4.rem, 2);
|
||||
auto num_H1 = div_H2.rem;
|
||||
auto num_V1 = div_V2.rem;
|
||||
return div_LH.quot * 360 + div_LVB.quot * 300 + div_LV.quot * 350
|
||||
+ (div_H6.quot + div_H4.quot + div_V6.quot + div_V4.quot) * 210
|
||||
+ (div_H2.quot + div_V2.quot) * 170
|
||||
+ (num_H1 + num_V1) * 150;
|
||||
return div_LH.quot * 360 + div_LVB.quot * 300 + div_LV.quot * 350 +
|
||||
(div_H6.quot + div_H4.quot + div_V6.quot + div_V4.quot) * 210 + (div_H2.quot + div_V2.quot) * 170 +
|
||||
(num_H1 + num_V1) * 150;
|
||||
#else
|
||||
return std::max(150, 33 * abs_delta_x + 66 * abs_delta_y);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user