aboutsummaryrefslogtreecommitdiffstats
path: root/generic/arch.h
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-04-04 16:30:47 +0100
committerDavid Shah <dave@ds0.me>2019-04-04 16:34:06 +0100
commitf0cd51e6bc58f3dfd1185fd53ad970ba634359f2 (patch)
treedd153f0b4cdd8ce2e62e22dbe0df1c37636956ee /generic/arch.h
parent3f98084021b64420c36c171cc1245248d6968f03 (diff)
downloadnextpnr-f0cd51e6bc58f3dfd1185fd53ad970ba634359f2.tar.gz
nextpnr-f0cd51e6bc58f3dfd1185fd53ad970ba634359f2.tar.bz2
nextpnr-f0cd51e6bc58f3dfd1185fd53ad970ba634359f2.zip
generic: Cell timing support
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'generic/arch.h')
-rw-r--r--generic/arch.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/generic/arch.h b/generic/arch.h
index 02017c8d..92a2c331 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -86,6 +86,33 @@ struct GroupInfo
DecalXY decalxy;
};
+struct CellDelayKey
+{
+ IdString from, to;
+ inline bool operator==(const CellDelayKey &other) const { return from == other.from && to == other.to; }
+};
+
+NEXTPNR_NAMESPACE_END
+namespace std {
+template <> struct hash<NEXTPNR_NAMESPACE_PREFIX CellDelayKey>
+{
+ std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX CellDelayKey &dk) const noexcept
+ {
+ std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from);
+ seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
+ return seed;
+ }
+};
+} // namespace std
+NEXTPNR_NAMESPACE_BEGIN
+
+struct CellTiming
+{
+ std::unordered_map<IdString, TimingPortClass> portClasses;
+ std::unordered_map<CellDelayKey, DelayInfo> combDelays;
+ std::unordered_map<IdString, std::vector<TimingClockingInfo>> clockingInfo;
+};
+
struct Arch : BaseCtx
{
std::string chipName;
@@ -106,6 +133,8 @@ struct Arch : BaseCtx
std::vector<std::vector<int>> tileBelDimZ;
std::vector<std::vector<int>> tilePipDimZ;
+ std::unordered_map<IdString, CellTiming> cellTiming;
+
void addWire(IdString name, IdString type, int x, int y);
void addPip(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay, Loc loc);
void addAlias(IdString name, IdString type, IdString srcWire, IdString dstWire, DelayInfo delay);
@@ -133,6 +162,11 @@ struct Arch : BaseCtx
void setLutK(int K);
void setDelayScaling(double scale, double offset);
+ void addCellTimingClock(IdString cell, IdString port);
+ void addCellTimingDelay(IdString cell, IdString fromPort, IdString toPort, DelayInfo delay);
+ void addCellTimingSetupHold(IdString cell, IdString port, IdString clock, DelayInfo setup, DelayInfo hold);
+ void addCellTimingClockToOut(IdString cell, IdString port, IdString clock, DelayInfo clktoq);
+
// ---------------------------------------------------------------
// Common Arch API. Every arch must provide the following methods.