aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing.h
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-03-01 11:25:28 +0000
committergatecat <gatecat@ds0.me>2021-03-04 10:29:36 +0000
commit534e69fbff8d08b699cca0b610d4660dc58e5408 (patch)
treed55e46cd247301c0dcf2a9b662b94fbe48ae442d /common/timing.h
parent7a546b15541a9f3b5be77f13250f3755d4f66e91 (diff)
downloadnextpnr-534e69fbff8d08b699cca0b610d4660dc58e5408.tar.gz
nextpnr-534e69fbff8d08b699cca0b610d4660dc58e5408.tar.bz2
nextpnr-534e69fbff8d08b699cca0b610d4660dc58e5408.zip
timing: Add port-domain tracking
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/timing.h')
-rw-r--r--common/timing.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/common/timing.h b/common/timing.h
index e07dc105..9aa15e59 100644
--- a/common/timing.h
+++ b/common/timing.h
@@ -84,6 +84,7 @@ struct ClockDomainKey
{
IdString clock;
ClockEdge edge;
+ ClockDomainKey(IdString clock_net, ClockEdge edge) : clock(clock_net), edge(edge){};
// probably also need something here to deal with constraints
inline bool is_async() const { return clock == IdString(); }
@@ -109,6 +110,7 @@ struct TimingAnalyser
void init_ports();
void get_cell_delays();
void topo_sort();
+ void setup_port_domains();
// To avoid storing the domain tag structure (which could get large when considering more complex constrained tag
// cases), assign each domain an ID and use that instead
typedef int domain_id_t;
@@ -123,6 +125,7 @@ struct TimingAnalyser
// Data per port-domain tuple
struct PortDomainData
{
+ bool has_arrival = false, has_required = false;
ArrivReqTime arrival, required;
delay_t setup_slack = std::numeric_limits<delay_t>::max(), hold_slack = std::numeric_limits<delay_t>::max();
delay_t budget = std::numeric_limits<delay_t>::max();
@@ -167,12 +170,25 @@ struct TimingAnalyser
DelayPair route_delay;
};
+ struct PerDomain
+ {
+ PerDomain(ClockDomainKey key) : key(key){};
+ ClockDomainKey key;
+ // these are pairs (signal port; clock port)
+ std::vector<std::pair<CellPortKey, IdString>> startpoints, endpoints;
+ };
+
CellInfo *cell_info(const CellPortKey &key);
PortInfo &port_info(const CellPortKey &key);
+ domain_id_t domain_id(IdString cell, IdString clock_port, ClockEdge edge);
+ domain_id_t domain_id(const NetInfo *net, ClockEdge edge);
+
+ void copy_domains(const CellPortKey &from, const CellPortKey &to, bool backwards);
+
std::unordered_map<CellPortKey, PerPort, CellPortKey::Hash> ports;
std::unordered_map<ClockDomainKey, domain_id_t, ClockDomainKey::Hash> domain_to_id;
- std::vector<ClockDomainKey> id_to_domain;
+ std::vector<PerDomain> domains;
std::vector<CellPortKey> topological_order;