clangformat

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-10-28 17:10:42 +02:00
parent 6bae89b8b7
commit 74d7ebc71f
3 changed files with 30 additions and 35 deletions

View File

@ -927,7 +927,8 @@ class StaticPlacer
compute_overlap();
}
void legalise_step(bool dsp_bram) {
void legalise_step(bool dsp_bram)
{
// assume DSP and BRAM are all groups 2+ for now
for (int i = 0; i < int(ccells.size()); i++) {
auto &mc = mcells.at(i);
@ -959,7 +960,8 @@ class StaticPlacer
log_info("HPWL after legalise: %f (delta: %f)\n", post_hpwl, post_hpwl - pre_hpwl);
}
void enqueue_legalise(int cell_idx) {
void enqueue_legalise(int cell_idx)
{
NPNR_ASSERT(cell_idx < int(ccells.size())); // we should never be legalising spacers or dark nodes
auto &ccell = ccells.at(cell_idx);
if (ccell.macro_idx != -1) {
@ -971,7 +973,8 @@ class StaticPlacer
}
}
void enqueue_legalise(CellInfo *ci) {
void enqueue_legalise(CellInfo *ci)
{
if (ci->udata != -1) {
// managed by static
enqueue_legalise(ci->udata);
@ -1043,12 +1046,10 @@ class StaticPlacer
while (radius < std::max(width + 1, height + 1)) {
// Keep increasing the radius until it will actually increase the number of cells we are
// checking (e.g. BRAM and DSP will not be in all cols/rows), so we don't waste effort
for (int x = std::max(0, cx - radius);
x <= std::min(width+1, cx + radius); x++) {
for (int x = std::max(0, cx - radius); x <= std::min(width + 1, cx + radius); x++) {
if (x >= int(fb->size()))
break;
for (int y = std::max(0, cy - radius);
y <= std::min(height+1, cy + radius); y++) {
for (int y = std::max(0, cy - radius); y <= std::min(height + 1, cy + radius); y++) {
if (y >= int(fb->at(x).size()))
break;
if (fb->at(x).at(y).size() > 0)

View File

@ -49,8 +49,8 @@ void IdString::initialize_arch(const BaseCtx *ctx)
// ---------------------------------------------------------------
static void get_chip_info(std::string device, const ChipInfoPOD **chip_info, const PackageInfoPOD **package_info,
const SpeedGradePOD **speed_grade,
const char **device_name, const char **package_name, int *device_speed)
const SpeedGradePOD **speed_grade, const char **device_name, const char **package_name,
int *device_speed)
{
std::stringstream ss(available_devices);
std::string name;
@ -381,14 +381,11 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
auto phys_wire = getPipSrcWire(*(getPipsUphill(w).begin()));
return std::make_pair(int(phys_wire.location.x), int(phys_wire.location.y));
} else if (wire.bel_pins.size() > 0) {
return std::make_pair(wire.bel_pins[0].rel_bel_loc.x,
wire.bel_pins[0].rel_bel_loc.y);
return std::make_pair(wire.bel_pins[0].rel_bel_loc.x, wire.bel_pins[0].rel_bel_loc.y);
} else if (wire.pips_downhill.size() > 0) {
return std::make_pair(wire.pips_downhill[0].rel_loc.x,
wire.pips_downhill[0].rel_loc.y);
return std::make_pair(wire.pips_downhill[0].rel_loc.x, wire.pips_downhill[0].rel_loc.y);
} else if (wire.pips_uphill.size() > 0) {
return std::make_pair(wire.pips_uphill[0].rel_loc.x,
wire.pips_uphill[0].rel_loc.y);
return std::make_pair(wire.pips_uphill[0].rel_loc.x, wire.pips_uphill[0].rel_loc.y);
} else {
return std::make_pair(int(w.location.x), int(w.location.y));
}
@ -430,14 +427,11 @@ BoundingBox Arch::getRouteBoundingBox(WireId src, WireId dst) const
auto phys_wire = getPipSrcWire(*(getPipsUphill(w).begin()));
return std::make_pair(int(phys_wire.location.x), int(phys_wire.location.y));
} else if (wire.bel_pins.size() > 0) {
return std::make_pair(wire.bel_pins[0].rel_bel_loc.x,
wire.bel_pins[0].rel_bel_loc.y);
return std::make_pair(wire.bel_pins[0].rel_bel_loc.x, wire.bel_pins[0].rel_bel_loc.y);
} else if (wire.pips_downhill.size() > 0) {
return std::make_pair(wire.pips_downhill[0].rel_loc.x,
wire.pips_downhill[0].rel_loc.y);
return std::make_pair(wire.pips_downhill[0].rel_loc.x, wire.pips_downhill[0].rel_loc.y);
} else if (wire.pips_uphill.size() > 0) {
return std::make_pair(wire.pips_uphill[0].rel_loc.x,
wire.pips_uphill[0].rel_loc.y);
return std::make_pair(wire.pips_uphill[0].rel_loc.x, wire.pips_uphill[0].rel_loc.y);
} else {
return std::make_pair(int(w.location.x), int(w.location.y));
}
@ -851,8 +845,8 @@ TimingClockingInfo Arch::getPortClockingInfo(const CellInfo *cell, IdString port
if (cell->ramInfo.is_pdp) {
bool is_output = cell->ports.at(port).type == PORT_OUT;
// In PDP mode, all read signals are in CLKB domain and write signals in CLKA domain
if (is_output || port.in(id_OCEB, id_CEB, id_ADB5, id_ADB6, id_ADB7, id_ADB8, id_ADB9, id_ADB10, id_ADB11,
id_ADB12))
if (is_output ||
port.in(id_OCEB, id_CEB, id_ADB5, id_ADB6, id_ADB7, id_ADB8, id_ADB9, id_ADB10, id_ADB11, id_ADB12))
info.clock_port = id_CLKB;
else
info.clock_port = id_CLKA;