aboutsummaryrefslogtreecommitdiffstats
path: root/machxo2/arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'machxo2/arch.h')
-rw-r--r--machxo2/arch.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/machxo2/arch.h b/machxo2/arch.h
index f06739e4..6cca9798 100644
--- a/machxo2/arch.h
+++ b/machxo2/arch.h
@@ -501,6 +501,8 @@ struct Arch : BaseCtx
static bool isAvailable(ArchArgs::ArchArgsTypes chip);
std::string getChipName() const;
+ // Extra helper
+ std::string getFullChipName() const;
IdString archId() const { return id("machxo2"); }
ArchArgs archArgs() const { return args; }
@@ -882,6 +884,19 @@ struct Arch : BaseCtx
return range;
}
+ // Extra Pip helpers.
+ int8_t getPipClass(PipId pip) const { return tileInfo(pip)->pips_data[pip.index].pip_type; }
+
+ std::string getPipTilename(PipId pip) const
+ {
+ auto &tileloc = chip_info->tile_info[pip.location.y * chip_info->width + pip.location.x];
+ for (int i = 0; i < tileloc.num_tiles; i++) {
+ if (tileloc.tile_names[i].type_idx == tileInfo(pip)->pips_data[pip.index].tile_type)
+ return tileloc.tile_names[i].name.get();
+ }
+ NPNR_ASSERT_FALSE("failed to find Pip tile");
+ }
+
// Group
GroupId getGroupByName(IdString name) const;
IdString getGroupName(GroupId group) const;