aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2
diff options
context:
space:
mode:
authorWilliam D. Jones <thor0505@comcast.net>2020-12-07 18:56:27 -0500
committergatecat <gatecat@ds0.me>2021-02-12 10:36:59 +0000
commit0e63178fe196dc042f2dc873ab40a929678dc53a (patch)
treea78b7258704b2e5259015bc801eded2bb656a941 /machxo2
parent91ad06424931a80c092d89b0fbc524f706deaa61 (diff)
downloadnextpnr-0e63178fe196dc042f2dc873ab40a929678dc53a.tar.gz
nextpnr-0e63178fe196dc042f2dc873ab40a929678dc53a.tar.bz2
nextpnr-0e63178fe196dc042f2dc873ab40a929678dc53a.zip
machxo2: clang format.
Diffstat (limited to 'machxo2')
-rw-r--r--machxo2/arch.cc84
-rw-r--r--machxo2/arch.h9
-rw-r--r--machxo2/archdefs.h2
-rw-r--r--machxo2/cells.cc5
-rw-r--r--machxo2/pack.cc6
5 files changed, 32 insertions, 74 deletions
diff --git a/machxo2/arch.cc b/machxo2/arch.cc
index ee334ed4..20c68065 100644
--- a/machxo2/arch.cc
+++ b/machxo2/arch.cc
@@ -19,8 +19,8 @@
#include <iostream>
#include <math.h>
-#include "nextpnr.h"
#include "embed.h"
+#include "nextpnr.h"
#include "placer1.h"
#include "placer_heap.h"
#include "router1.h"
@@ -40,15 +40,15 @@ static std::tuple<int, int, std::string> split_identifier_name(const std::string
name.substr(second_slash + 1));
};
-
// -----------------------------------------------------------------------
-void IdString::initialize_arch(const BaseCtx *ctx) {
- #define X(t) initialize_add(ctx, #t, ID_##t);
+void IdString::initialize_arch(const BaseCtx *ctx)
+{
+#define X(t) initialize_add(ctx, #t, ID_##t);
- #include "constids.inc"
+#include "constids.inc"
- #undef X
+#undef X
}
// ---------------------------------------------------------------
@@ -171,16 +171,15 @@ BelId Arch::getBelByLocation(Loc loc) const
{
BelId ret;
- if(loc.x >= chip_info->width || loc.y >= chip_info->height)
+ if (loc.x >= chip_info->width || loc.y >= chip_info->height)
return BelId();
ret.location.x = loc.x;
ret.location.y = loc.y;
const TileTypePOD *tilei = tileInfo(ret);
- for(int i = 0; i < tilei->num_bels; i++) {
- if(tilei->bel_data[i].z == loc.z)
- {
+ for (int i = 0; i < tilei->num_bels; i++) {
+ if (tilei->bel_data[i].z == loc.z) {
ret.index = i;
return ret;
}
@@ -217,8 +216,8 @@ WireId Arch::getBelPinWire(BelId bel, IdString pin) const
int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires;
const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires;
- for(int i = 0; i < num_bel_wires; i++)
- if(bel_wires[i].port == pin.index) {
+ for (int i = 0; i < num_bel_wires; i++)
+ if (bel_wires[i].port == pin.index) {
WireId ret;
ret.location.x = bel_wires[i].rel_wire_loc.x;
@@ -238,8 +237,8 @@ PortType Arch::getBelPinType(BelId bel, IdString pin) const
int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires;
const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires;
- for(int i = 0; i < num_bel_wires; i++)
- if(bel_wires[i].port == pin.index)
+ for (int i = 0; i < num_bel_wires; i++)
+ if (bel_wires[i].port == pin.index)
return PortType(bel_wires[i].dir);
return PORT_INOUT;
@@ -253,7 +252,7 @@ std::vector<IdString> Arch::getBelPins(BelId bel) const
int num_bel_wires = tileInfo(bel)->bel_data[bel.index].num_bel_wires;
const BelWirePOD *bel_wires = &*tileInfo(bel)->bel_data[bel.index].bel_wires;
- for(int i = 0; i < num_bel_wires; i++) {
+ for (int i = 0; i < num_bel_wires; i++) {
IdString id(bel_wires[i].port);
ret.push_back(id);
}
@@ -263,10 +262,7 @@ std::vector<IdString> Arch::getBelPins(BelId bel) const
// ---------------------------------------------------------------
-WireId Arch::getWireByName(IdString name) const
-{
- return WireId();
-}
+WireId Arch::getWireByName(IdString name) const { return WireId(); }
IdString Arch::getWireName(WireId wire) const { return IdString(); }
@@ -280,15 +276,9 @@ uint32_t Arch::getWireChecksum(WireId wire) const
return 0;
}
-void Arch::bindWire(WireId wire, NetInfo *net, PlaceStrength strength)
-{
-
-}
-
-void Arch::unbindWire(WireId wire)
-{
+void Arch::bindWire(WireId wire, NetInfo *net, PlaceStrength strength) {}
-}
+void Arch::unbindWire(WireId wire) {}
bool Arch::checkWireAvail(WireId wire) const { return false; }
@@ -302,10 +292,7 @@ const std::vector<WireId> &Arch::getWires() const { return wire_id_dummy; }
// ---------------------------------------------------------------
-PipId Arch::getPipByName(IdString name) const
-{
- return PipId();
-}
+PipId Arch::getPipByName(IdString name) const { return PipId(); }
IdString Arch::getPipName(PipId pip) const { return IdString(); }
@@ -319,15 +306,9 @@ uint32_t Arch::getPipChecksum(PipId wire) const
return 0;
}
-void Arch::bindPip(PipId pip, NetInfo *net, PlaceStrength strength)
-{
-
-}
-
-void Arch::unbindPip(PipId pip)
-{
+void Arch::bindPip(PipId pip, NetInfo *net, PlaceStrength strength) {}
-}
+void Arch::unbindPip(PipId pip) {}
bool Arch::checkPipAvail(PipId pip) const { return false; }
@@ -375,15 +356,9 @@ const std::vector<GroupId> &Arch::getGroupGroups(GroupId group) const { return g
// ---------------------------------------------------------------
-delay_t Arch::estimateDelay(WireId src, WireId dst) const
-{
- return 0;
-}
+delay_t Arch::estimateDelay(WireId src, WireId dst) const { return 0; }
-delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const
-{
- return 0;
-}
+delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const { return 0; }
bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const { return false; }
@@ -428,10 +403,7 @@ bool Arch::route()
// ---------------------------------------------------------------
-const std::vector<GraphicElement> &Arch::getDecalGraphics(DecalId decal) const
-{
- return graphic_element_dummy;
-}
+const std::vector<GraphicElement> &Arch::getDecalGraphics(DecalId decal) const { return graphic_element_dummy; }
DecalXY Arch::getBelDecal(BelId bel) const { return DecalXY(); }
@@ -489,14 +461,8 @@ const std::vector<std::string> Arch::availablePlacers = {"sa",
const std::string Arch::defaultRouter = "router1";
const std::vector<std::string> Arch::availableRouters = {"router1", "router2"};
-void Arch::assignArchInfo()
-{
+void Arch::assignArchInfo() {}
-}
-
-bool Arch::cellsCompatible(const CellInfo **cells, int count) const
-{
- return false;
-}
+bool Arch::cellsCompatible(const CellInfo **cells, int count) const { return false; }
NEXTPNR_NAMESPACE_END
diff --git a/machxo2/arch.h b/machxo2/arch.h
index 553c8d3d..bcac5390 100644
--- a/machxo2/arch.h
+++ b/machxo2/arch.h
@@ -159,8 +159,7 @@ struct BelIterator
BelIterator operator++()
{
cursor_index++;
- while (cursor_tile < chip->num_tiles &&
- cursor_index >= chip->tiles[cursor_tile].num_bels) {
+ while (cursor_tile < chip->num_tiles && cursor_index >= chip->tiles[cursor_tile].num_bels) {
cursor_index = 0;
cursor_tile++;
}
@@ -235,8 +234,7 @@ struct WireIterator
WireIterator operator++()
{
cursor_index++;
- while (cursor_tile < chip->num_tiles &&
- cursor_index >= chip->tiles[cursor_tile].num_wires) {
+ while (cursor_tile < chip->num_tiles && cursor_index >= chip->tiles[cursor_tile].num_wires) {
cursor_index = 0;
cursor_tile++;
}
@@ -286,8 +284,7 @@ struct AllPipIterator
AllPipIterator operator++()
{
cursor_index++;
- while (cursor_tile < chip->num_tiles &&
- cursor_index >= chip->tiles[cursor_tile].num_pips) {
+ while (cursor_tile < chip->num_tiles && cursor_index >= chip->tiles[cursor_tile].num_pips) {
cursor_index = 0;
cursor_tile++;
}
diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h
index 5852d24b..f8fee5d7 100644
--- a/machxo2/archdefs.h
+++ b/machxo2/archdefs.h
@@ -179,4 +179,4 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId>
}
};
-}
+} // namespace std
diff --git a/machxo2/cells.cc b/machxo2/cells.cc
index 9a522b1a..ba4afad0 100644
--- a/machxo2/cells.cc
+++ b/machxo2/cells.cc
@@ -171,9 +171,6 @@ void dff_to_lc(const Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_l
replace_port(dff, ctx->id("Q"), lc, ctx->id("Q0"));
}
-void nxio_to_iob(Context *ctx, CellInfo *nxio, CellInfo *iob, std::unordered_set<IdString> &todelete_cells)
-{
-
-}
+void nxio_to_iob(Context *ctx, CellInfo *nxio, CellInfo *iob, std::unordered_set<IdString> &todelete_cells) {}
NEXTPNR_NAMESPACE_END
diff --git a/machxo2/pack.cc b/machxo2/pack.cc
index 695d8e95..5984b740 100644
--- a/machxo2/pack.cc
+++ b/machxo2/pack.cc
@@ -39,8 +39,7 @@ static void pack_lut_lutffs(Context *ctx)
if (ctx->verbose)
log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx), ci->type.c_str(ctx));
if (is_lut(ctx, ci)) {
- std::unique_ptr<CellInfo> packed =
- create_machxo2_cell(ctx, id_FACADE_SLICE, ci->name.str(ctx) + "_LC");
+ std::unique_ptr<CellInfo> packed = create_machxo2_cell(ctx, id_FACADE_SLICE, ci->name.str(ctx) + "_LC");
std::copy(ci->attrs.begin(), ci->attrs.end(), std::inserter(packed->attrs, packed->attrs.begin()));
packed_cells.insert(ci->name);
@@ -89,7 +88,7 @@ static void pack_lut_lutffs(Context *ctx)
// Merge a net into a constant net
static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constnet, bool constval)
{
- (void) constval;
+ (void)constval;
orig->driver.cell = nullptr;
for (auto user : orig->users) {
@@ -105,7 +104,6 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constne
orig->users.clear();
}
-
// Pack constants (based on simple implementation in generic).
// VCC/GND cells provided by nextpnr automatically.
static void pack_constants(Context *ctx)