aboutsummaryrefslogtreecommitdiffstats
path: root/ecp5/arch.h
diff options
context:
space:
mode:
Diffstat (limited to 'ecp5/arch.h')
-rw-r--r--ecp5/arch.h52
1 files changed, 49 insertions, 3 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h
index a68673f4..3de06a42 100644
--- a/ecp5/arch.h
+++ b/ecp5/arch.h
@@ -103,7 +103,7 @@ NPNR_PACKED_STRUCT(struct PIOInfoPOD {
int32_t bel_index;
RelPtr<char> function_name;
int16_t bank;
- int16_t padding;
+ int16_t dqsgroup;
});
NPNR_PACKED_STRUCT(struct PackagePinPOD {
@@ -204,7 +204,7 @@ NPNR_PACKED_STRUCT(struct ChipInfoPOD {
RelPtr<SpeedGradePOD> speed_grades;
});
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(EXTERNAL_CHIPDB_ROOT)
extern const char *chipdb_blob_25k;
extern const char *chipdb_blob_45k;
extern const char *chipdb_blob_85k;
@@ -448,6 +448,30 @@ struct ArchArgs
} speed = SPEED_6;
};
+struct DelayKey
+{
+ IdString celltype, from, to;
+ inline bool operator==(const DelayKey &other) const
+ {
+ return celltype == other.celltype && from == other.from && to == other.to;
+ }
+};
+
+NEXTPNR_NAMESPACE_END
+namespace std {
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DelayKey>
+{
+ std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept
+ {
+ std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.celltype);
+ seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ return seed;
+ }
+};
+} // namespace std
+NEXTPNR_NAMESPACE_BEGIN
+
struct Arch : BaseCtx
{
const ChipInfoPOD *chip_info;
@@ -918,7 +942,7 @@ struct Arch : BaseCtx
delay_t estimateDelay(WireId src, WireId dst) const;
delay_t predictDelay(const NetInfo *net_info, const PortRef &sink) const;
delay_t getDelayEpsilon() const { return 20; }
- delay_t getRipupDelayPenalty() const { return 200; }
+ delay_t getRipupDelayPenalty() const { return 400; }
float getDelayNS(delay_t v) const { return v * 0.001; }
DelayInfo getDelayFromNS(float ns) const
{
@@ -971,6 +995,8 @@ struct Arch : BaseCtx
void assignArchInfo();
+ void permute_luts();
+
std::vector<std::pair<std::string, std::string>> getTilesAtLocation(int row, int col);
std::string getTileByTypeAndLocation(int row, int col, std::string type) const
{
@@ -993,8 +1019,23 @@ struct Arch : BaseCtx
NPNR_ASSERT_FALSE_STR("no tile at (" + std::to_string(col) + ", " + std::to_string(row) + ") with type in set");
}
+ std::string getTileByType(std::string type) const
+ {
+ for (int i = 0; i < chip_info->height * chip_info->width; i++) {
+ auto &tileloc = chip_info->tile_info[i];
+ for (int j = 0; j < tileloc.num_tiles; j++)
+ if (chip_info->tiletype_names[tileloc.tile_names[j].type_idx].get() == type)
+ return tileloc.tile_names[j].name.get();
+ }
+ NPNR_ASSERT_FALSE_STR("no with type " + type);
+ }
+
GlobalInfoPOD globalInfoAtLoc(Location loc);
+ bool getPIODQSGroup(BelId pio, bool &dqsright, int &dqsrow);
+ BelId getDQSBUF(bool dqsright, int dqsrow);
+ WireId getBankECLK(int bank, int eclk);
+
// Apply LPF constraints to the context
bool applyLPF(std::string filename, std::istream &in);
@@ -1002,6 +1043,11 @@ struct Arch : BaseCtx
IdString id_clk, id_lsr;
IdString id_clkmux, id_lsrmux;
IdString id_srmode, id_mode;
+
+ mutable std::unordered_map<DelayKey, std::pair<bool, DelayInfo>> celldelay_cache;
+
+ static const std::string defaultPlacer;
+ static const std::vector<std::string> availablePlacers;
};
NEXTPNR_NAMESPACE_END