1
0
mirror of https://github.com/YosysHQ/nextpnr.git synced 2026-01-11 23:53:21 +00:00

clangformat

This commit is contained in:
Miodrag Milanovic 2025-10-15 15:38:35 +02:00
parent 36045543c7
commit f245185da8
2 changed files with 10 additions and 10 deletions

View File

@ -28,8 +28,8 @@
#include <streambuf> #include <streambuf>
#include "config.h" #include "config.h"
#include "log.h" #include "log.h"
#include "util.h"
#include "pio.h" #include "pio.h"
#include "util.h"
#define fmt_str(x) (static_cast<const std::ostringstream &>(std::ostringstream() << x).str()) #define fmt_str(x) (static_cast<const std::ostringstream &>(std::ostringstream() << x).str())
@ -426,28 +426,28 @@ struct MachXO2Bitgen
std::string pic_tile = get_pic_tile(bel); std::string pic_tile = get_pic_tile(bel);
cc.tiles[pic_tile].add_enum(pio + ".BASE_TYPE", dir + "_" + iotype); cc.tiles[pic_tile].add_enum(pio + ".BASE_TYPE", dir + "_" + iotype);
bool is_opendrain = false; bool is_opendrain = false;
if (ci->attrs.count(id_OPENDRAIN)) { if (ci->attrs.count(id_OPENDRAIN)) {
if (opendrain_capable(io_type, dir)) { if (opendrain_capable(io_type, dir)) {
cc.tiles[pic_tile].add_enum(pio + ".OPENDRAIN", str_or_default(ci->attrs, id_OPENDRAIN, "OFF")); cc.tiles[pic_tile].add_enum(pio + ".OPENDRAIN", str_or_default(ci->attrs, id_OPENDRAIN, "OFF"));
is_opendrain = true; is_opendrain = true;
} } else
else
log_error("IO of type %s and direction %s cannot be set to opendrain\n", iotype.c_str(), dir.c_str()); log_error("IO of type %s and direction %s cannot be set to opendrain\n", iotype.c_str(), dir.c_str());
} }
if (ci->attrs.count(id_SLEWRATE) && !is_differential(io_type) && dir != "INPUT") if (ci->attrs.count(id_SLEWRATE) && !is_differential(io_type) && dir != "INPUT")
cc.tiles[pic_tile].add_enum(pio + ".SLEWRATE", str_or_default(ci->attrs, id_SLEWRATE, "SLOW")); cc.tiles[pic_tile].add_enum(pio + ".SLEWRATE", str_or_default(ci->attrs, id_SLEWRATE, "SLOW"));
if (ci->attrs.count(id_DIFFRESISTOR)) if (ci->attrs.count(id_DIFFRESISTOR))
cc.tiles[pic_tile].add_enum(pio + ".DIFFRESISTOR", str_or_default(ci->attrs, id_DIFFRESISTOR, "OFF")); cc.tiles[pic_tile].add_enum(pio + ".DIFFRESISTOR", str_or_default(ci->attrs, id_DIFFRESISTOR, "OFF"));
if (!is_opendrain) { if (!is_opendrain) {
if (ci->attrs.count(id_CLAMP)) if (ci->attrs.count(id_CLAMP))
cc.tiles[pic_tile].add_enum(pio + ".CLAMP", str_or_default(ci->attrs, id_CLAMP, "OFF")); cc.tiles[pic_tile].add_enum(pio + ".CLAMP", str_or_default(ci->attrs, id_CLAMP, "OFF"));
if (ci->attrs.count(id_PULLMODE) || dir == "INPUT") if (ci->attrs.count(id_PULLMODE) || dir == "INPUT")
cc.tiles[pic_tile].add_enum(pio + ".PULLMODE", str_or_default(ci->attrs, id_PULLMODE, is_lvcmos(io_type) ? "DOWN" : "NONE")); cc.tiles[pic_tile].add_enum(pio + ".PULLMODE", str_or_default(ci->attrs, id_PULLMODE,
is_lvcmos(io_type) ? "DOWN" : "NONE"));
} }
if (ci->attrs.count(id_DRIVE) && !is_differential(io_type) && dir != "INPUT") { if (ci->attrs.count(id_DRIVE) && !is_differential(io_type) && dir != "INPUT") {
std::string drive = str_or_default(ci->attrs, id_DRIVE, "8"); std::string drive = str_or_default(ci->attrs, id_DRIVE, "8");
if (is_drive_ok(io_type, drive)) if (is_drive_ok(io_type, drive))
@ -455,7 +455,7 @@ struct MachXO2Bitgen
else else
log_error("DRIVE %s cannot be set for IO type %s\n", drive.c_str(), iotype.c_str()); log_error("DRIVE %s cannot be set for IO type %s\n", drive.c_str(), iotype.c_str());
} }
if ((dir == "INPUT" || dir == "BIDIR") && !is_differential(ioType_from_str(iotype)) && if ((dir == "INPUT" || dir == "BIDIR") && !is_differential(ioType_from_str(iotype)) &&
!is_referenced(ioType_from_str(iotype)) && ci->attrs.count(id_HYSTERESIS)) { !is_referenced(ioType_from_str(iotype)) && ci->attrs.count(id_HYSTERESIS)) {
cc.tiles[pic_tile].add_enum(pio + ".HYSTERESIS", str_or_default(ci->attrs, id_HYSTERESIS, "SMALL")); cc.tiles[pic_tile].add_enum(pio + ".HYSTERESIS", str_or_default(ci->attrs, id_HYSTERESIS, "SMALL"));

View File

@ -209,7 +209,7 @@ bool opendrain_capable(IOType type, std::string dir)
{ {
if (dir != "OUTPUT" && dir != "BIDIR") if (dir != "OUTPUT" && dir != "BIDIR")
return false; return false;
return is_lvcmos(type); return is_lvcmos(type);
} }