clangformat

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-03-17 09:31:38 +01:00
parent 656bfdb819
commit 4111cc25d6
5 changed files with 29 additions and 29 deletions

View File

@ -20,8 +20,8 @@
#include "mainwindow.h" #include "mainwindow.h"
#include <fstream> #include <fstream>
#include "bitstream.h" #include "bitstream.h"
#include "log.h"
#include "embed.h" #include "embed.h"
#include "log.h"
#include "machxo2_available.h" #include "machxo2_available.h"
#include <QFileDialog> #include <QFileDialog>
@ -49,7 +49,8 @@ MainWindow::~MainWindow() {}
void MainWindow::newContext(Context *ctx) 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()); setWindowTitle(title.c_str());
} }
@ -93,7 +94,8 @@ void MainWindow::new_proj()
for (auto &pkg : chip.packages) { for (auto &pkg : chip.packages) {
for (auto &speedgrade : chip.speed_grades) { for (auto &speedgrade : chip.speed_grades) {
for (auto &rating : chip.suffixes) { 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())); 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); QString item = QInputDialog::getItem(this, "Select new context", "Part:", arch, 0, false, &ok);
if (ok && !item.isEmpty()) { if (ok && !item.isEmpty()) {
ArchArgs chipArgs; ArchArgs chipArgs;
chipArgs.device = item.toUtf8().constData();; chipArgs.device = item.toUtf8().constData();
;
handler->clear(); handler->clear();
currentProj = ""; currentProj = "";

View File

@ -22,13 +22,13 @@
#include <math.h> #include <math.h>
#include "embed.h" #include "embed.h"
#include "gfx.h" #include "gfx.h"
#include "machxo2_available.h"
#include "nextpnr.h" #include "nextpnr.h"
#include "placer1.h" #include "placer1.h"
#include "placer_heap.h" #include "placer_heap.h"
#include "router1.h" #include "router1.h"
#include "router2.h" #include "router2.h"
#include "util.h" #include "util.h"
#include "machxo2_available.h"
NEXTPNR_NAMESPACE_BEGIN NEXTPNR_NAMESPACE_BEGIN
@ -45,7 +45,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 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::stringstream ss(available_devices);
std::string name; std::string name;
@ -58,7 +59,8 @@ static void get_chip_info(std::string device, const ChipInfoPOD **chip_info, con
for (auto &pkg : chip.packages) { for (auto &pkg : chip.packages) {
for (auto &speedgrade : chip.speed_grades) { for (auto &speedgrade : chip.speed_grades) {
for (auto &rating : chip.suffixes) { 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) { if (device == devname) {
*chip_info = db_ptr->get(); *chip_info = db_ptr->get();
*package_info = nullptr; *package_info = nullptr;
@ -127,7 +129,8 @@ void Arch::list_devices()
for (auto &pkg : chip.packages) { for (auto &pkg : chip.packages) {
for (auto &speedgrade : chip.speed_grades) { for (auto &speedgrade : chip.speed_grades) {
for (auto &rating : chip.suffixes) { 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<GraphicElement> Arch::getDecalGraphics(DecalId decal) const
GfxTileWireId src_id = GfxTileWireId(tile_info(src_wire)->wire_data[src_wire.index].tile_wire); 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); 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; 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, gfxTilePip(ret, x, chip_info->height - y - 1, chip_info->width, chip_info->height, src_wire,
getWireType(dst_wire), dst_id, style); getWireType(src_wire), src_id, dst_wire, getWireType(dst_wire), dst_id, style);
} else if (decal.type == DecalId::TYPE_BEL) { } else if (decal.type == DecalId::TYPE_BEL) {
BelId bel; BelId bel;
bel.index = decal.z; bel.index = decal.z;

View File

@ -129,13 +129,9 @@ NPNR_PACKED_STRUCT(struct PackageSupportedPOD {
RelPtr<char> short_name; RelPtr<char> short_name;
}); });
NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD { NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD { RelPtr<char> suffix; });
RelPtr<char> suffix;
});
NPNR_PACKED_STRUCT(struct SpeedSupportedPOD { NPNR_PACKED_STRUCT(struct SpeedSupportedPOD { int32_t speed; });
int32_t speed;
});
NPNR_PACKED_STRUCT(struct VariantInfoPOD { NPNR_PACKED_STRUCT(struct VariantInfoPOD {
RelPtr<char> name; RelPtr<char> name;

View File

@ -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_y1 = 0.05;
const float io_cell_h_y2 = 0.24; const float io_cell_h_y2 = 0.24;
void gfxTileBel(std::vector<GraphicElement> &g, int x, int y, int z, int w, int h, IdString bel_type, void gfxTileBel(std::vector<GraphicElement> &g, int x, int y, int z, int w, int h, IdString bel_type,
GraphicElement::style_t style) GraphicElement::style_t style)
{ {
@ -88,7 +87,6 @@ void gfxTileWire(std::vector<GraphicElement> &g, int x, int y, int w, int h, IdS
{ {
} }
void gfxTilePip(std::vector<GraphicElement> &g, int x, int y, int w, int h, WireId src, IdString src_type, void gfxTilePip(std::vector<GraphicElement> &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, GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id,
GraphicElement::style_t style) GraphicElement::style_t style)