aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2
diff options
context:
space:
mode:
Diffstat (limited to 'machxo2')
-rw-r--r--machxo2/arch.cc19
-rw-r--r--machxo2/arch.h8
-rw-r--r--machxo2/bitstream.cc2
-rw-r--r--machxo2/gfx.cc16
4 files changed, 21 insertions, 24 deletions
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 <math.h>
#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<const RelPtr<ChipInfoPOD> *>(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<const RelPtr<ChipInfoPOD> *>(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<GraphicElement> 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<char> short_name;
});
-NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD {
- RelPtr<char> suffix;
-});
+NPNR_PACKED_STRUCT(struct SuffixeSupportedPOD { RelPtr<char> suffix; });
-NPNR_PACKED_STRUCT(struct SpeedSupportedPOD {
- int32_t speed;
-});
+NPNR_PACKED_STRUCT(struct SpeedSupportedPOD { int32_t speed; });
NPNR_PACKED_STRUCT(struct VariantInfoPOD {
RelPtr<char> 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<GraphicElement> &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<GraphicElement> &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<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,
GfxTileWireId src_id, WireId dst, IdString dst_type, GfxTileWireId dst_id,
GraphicElement::style_t style)