From 4111cc25d653bde9fbda72b9cf9dc13a876e214a Mon Sep 17 00:00:00 2001 From: gatecat Date: Fri, 17 Mar 2023 09:31:38 +0100 Subject: clangformat Signed-off-by: gatecat --- gui/machxo2/mainwindow.cc | 13 ++++++++----- machxo2/arch.cc | 19 +++++++++++-------- machxo2/arch.h | 8 ++------ machxo2/bitstream.cc | 2 +- machxo2/gfx.cc | 16 +++++++--------- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/gui/machxo2/mainwindow.cc b/gui/machxo2/mainwindow.cc index 4a7ffeaf..9b7cfb17 100644 --- a/gui/machxo2/mainwindow.cc +++ b/gui/machxo2/mainwindow.cc @@ -20,8 +20,8 @@ #include "mainwindow.h" #include #include "bitstream.h" -#include "log.h" #include "embed.h" +#include "log.h" #include "machxo2_available.h" #include @@ -49,7 +49,8 @@ MainWindow::~MainWindow() {} void MainWindow::newContext(Context *ctx) { - std::string title = "nextpnr-machxo2 - " + std::string(ctx->device_name) + " (" + std::string(ctx->package_name) + ") - Part : " + ctx->getChipName(); + std::string title = "nextpnr-machxo2 - " + std::string(ctx->device_name) + " (" + std::string(ctx->package_name) + + ") - Part : " + ctx->getChipName(); setWindowTitle(title.c_str()); } @@ -84,7 +85,7 @@ void MainWindow::new_proj() std::stringstream ss(available_devices); std::string name; - while(getline(ss, name, ';')){ + while (getline(ss, name, ';')) { std::string chipdb = stringf("machxo2/chipdb-%s.bin", name.c_str()); auto db_ptr = reinterpret_cast *>(get_chipdb(chipdb)); if (!db_ptr) @@ -93,7 +94,8 @@ void MainWindow::new_proj() for (auto &pkg : chip.packages) { for (auto &speedgrade : chip.speed_grades) { for (auto &rating : chip.suffixes) { - std::string devname = stringf("%s-%d%s%s", chip.name.get(), speedgrade.speed, pkg.short_name.get(), rating.suffix.get()); + std::string devname = stringf("%s-%d%s%s", chip.name.get(), speedgrade.speed, + pkg.short_name.get(), rating.suffix.get()); arch.append(QString::fromLocal8Bit(devname.c_str())); } } @@ -105,7 +107,8 @@ void MainWindow::new_proj() QString item = QInputDialog::getItem(this, "Select new context", "Part:", arch, 0, false, &ok); if (ok && !item.isEmpty()) { ArchArgs chipArgs; - chipArgs.device = item.toUtf8().constData();; + chipArgs.device = item.toUtf8().constData(); + ; handler->clear(); currentProj = ""; diff --git a/machxo2/arch.cc b/machxo2/arch.cc index e0ddd0d5..60e2203c 100644 --- a/machxo2/arch.cc +++ b/machxo2/arch.cc @@ -22,13 +22,13 @@ #include #include "embed.h" #include "gfx.h" +#include "machxo2_available.h" #include "nextpnr.h" #include "placer1.h" #include "placer_heap.h" #include "router1.h" #include "router2.h" #include "util.h" -#include "machxo2_available.h" NEXTPNR_NAMESPACE_BEGIN @@ -45,11 +45,12 @@ void IdString::initialize_arch(const BaseCtx *ctx) // --------------------------------------------------------------- -static void get_chip_info(std::string device, const ChipInfoPOD **chip_info, const PackageInfoPOD **package_info, const char **device_name, const char **package_name) +static void get_chip_info(std::string device, const ChipInfoPOD **chip_info, const PackageInfoPOD **package_info, + const char **device_name, const char **package_name) { std::stringstream ss(available_devices); std::string name; - while(getline(ss, name, ';')){ + while (getline(ss, name, ';')) { std::string chipdb = stringf("machxo2/chipdb-%s.bin", name.c_str()); auto db_ptr = reinterpret_cast *>(get_chipdb(chipdb)); if (!db_ptr) @@ -58,7 +59,8 @@ static void get_chip_info(std::string device, const ChipInfoPOD **chip_info, con for (auto &pkg : chip.packages) { for (auto &speedgrade : chip.speed_grades) { for (auto &rating : chip.suffixes) { - std::string devname = stringf("%s-%d%s%s", chip.name.get(), speedgrade.speed, pkg.short_name.get(), rating.suffix.get()); + std::string devname = stringf("%s-%d%s%s", chip.name.get(), speedgrade.speed, + pkg.short_name.get(), rating.suffix.get()); if (device == devname) { *chip_info = db_ptr->get(); *package_info = nullptr; @@ -118,7 +120,7 @@ void Arch::list_devices() log("Supported devices: \n"); std::stringstream ss(available_devices); std::string name; - while(getline(ss, name, ';')){ + while (getline(ss, name, ';')) { std::string chipdb = stringf("machxo2/chipdb-%s.bin", name.c_str()); auto db_ptr = reinterpret_cast *>(get_chipdb(chipdb)); if (!db_ptr) @@ -127,7 +129,8 @@ void Arch::list_devices() for (auto &pkg : chip.packages) { for (auto &speedgrade : chip.speed_grades) { for (auto &rating : chip.suffixes) { - log(" %s-%d%s%s\n", chip.name.get(), speedgrade.speed, pkg.short_name.get(), rating.suffix.get()); + log(" %s-%d%s%s\n", chip.name.get(), speedgrade.speed, pkg.short_name.get(), + rating.suffix.get()); } } } @@ -428,8 +431,8 @@ std::vector Arch::getDecalGraphics(DecalId decal) const GfxTileWireId src_id = GfxTileWireId(tile_info(src_wire)->wire_data[src_wire.index].tile_wire); GfxTileWireId dst_id = GfxTileWireId(tile_info(dst_wire)->wire_data[dst_wire.index].tile_wire); GraphicElement::style_t style = decal.active ? GraphicElement::STYLE_ACTIVE : GraphicElement::STYLE_HIDDEN; - gfxTilePip(ret, x, chip_info->height - y - 1, chip_info->width, chip_info->height, src_wire, getWireType(src_wire), src_id, dst_wire, - getWireType(dst_wire), dst_id, style); + gfxTilePip(ret, x, chip_info->height - y - 1, chip_info->width, chip_info->height, src_wire, + getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style); } else if (decal.type == DecalId::TYPE_BEL) { BelId bel; bel.index = decal.z; diff --git a/machxo2/arch.h b/machxo2/arch.h index 3eaa0684..efb5ee41 100644 --- a/machxo2/arch.h +++ b/machxo2/arch.h @@ -129,13 +129,9 @@ NPNR_PACKED_STRUCT(struct PackageSupportedPOD { RelPtr short_name; }); -NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD { - RelPtr suffix; -}); +NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD { RelPtr suffix; }); -NPNR_PACKED_STRUCT(struct SpeedSupportedPOD { - int32_t speed; -}); +NPNR_PACKED_STRUCT(struct SpeedSupportedPOD { int32_t speed; }); NPNR_PACKED_STRUCT(struct VariantInfoPOD { RelPtr name; diff --git a/machxo2/bitstream.cc b/machxo2/bitstream.cc index c04df52e..232598f3 100644 --- a/machxo2/bitstream.cc +++ b/machxo2/bitstream.cc @@ -195,7 +195,7 @@ void write_bitstream(Context *ctx, std::string text_config_file) { ChipConfig cc; IdString base_id = ctx->id(ctx->chip_info->device_name.get()); - //IdString device_id = ctx->id(ctx->device_name); + // IdString device_id = ctx->id(ctx->device_name); if (base_id == ctx->id("LCMXO2-1200")) BaseConfigs::config_empty_lcmxo2_1200(cc); else diff --git a/machxo2/gfx.cc b/machxo2/gfx.cc index 97876ad2..08b2e01d 100644 --- a/machxo2/gfx.cc +++ b/machxo2/gfx.cc @@ -23,7 +23,7 @@ NEXTPNR_NAMESPACE_BEGIN const float slice_x1 = 0.800; const float slice_x2_comb = 0.927; -//const float slice_x1_ff = 0.933; +// const float slice_x1_ff = 0.933; const float slice_x2 = 0.94; const float slice_y1 = 0.60; const float slice_y2 = 0.65 + 0.1 / 4; @@ -37,7 +37,6 @@ const float io_cell_h_x1 = 0.05; const float io_cell_h_y1 = 0.05; const float io_cell_h_y2 = 0.24; - void gfxTileBel(std::vector &g, int x, int y, int z, int w, int h, IdString bel_type, GraphicElement::style_t style) { @@ -50,12 +49,12 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int el.y1 = y + slice_y1 + z * slice_pitch; el.y2 = y + slice_y2 + z * slice_pitch; g.push_back(el); -/* } else if (bel_type == id_FACADE_FF) { - el.x1 = x + slice_x1_ff; - el.x2 = x + slice_x2; - el.y1 = y + slice_y1 + z * slice_pitch; - el.y2 = y + slice_y2 + z * slice_pitch; - g.push_back(el);*/ + /* } else if (bel_type == id_FACADE_FF) { + el.x1 = x + slice_x1_ff; + el.x2 = x + slice_x2; + el.y1 = y + slice_y1 + z * slice_pitch; + el.y2 = y + slice_y2 + z * slice_pitch; + g.push_back(el);*/ } else if (bel_type.in(id_FACADE_IO)) { bool top_bottom = (y == 0 || y == (h - 1)); if (top_bottom) { @@ -88,7 +87,6 @@ void gfxTileWire(std::vector &g, int x, int y, int w, int h, IdS { } - void gfxTilePip(std::vector &g, int x, int y, int w, int h, WireId src, IdString src_type, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id, GraphicElement::style_t style) -- cgit v1.2.3