@@ -59,6 +59,7 @@ struct ClockDomainKey
5959};
6060
6161// TODO: perhaps move these elsewhere
62+
6263struct FalsePath
6364{
6465};
@@ -93,14 +94,18 @@ struct MultiCycle
9394 size_t cycles;
9495};
9596
96- struct TimingException
97+ using TimingException = std::variant<FalsePath, MinMaxDelay, MultiCycle>;
98+
99+ struct PathConstraint
97100{
98- std::variant<FalsePath, MinMaxDelay, MultiCycle> type ;
101+ TimingException exception ;
99102
100103 pool<CellPortKey> startpoints;
101104 pool<CellPortKey> endpoints;
102105};
103106
107+ typedef int exception_id_t ;
108+
104109typedef int domain_id_t ;
105110
106111struct ClockDomainPairKey
@@ -114,8 +119,6 @@ struct ClockDomainPairKey
114119 unsigned int hash () const { return mkhash (launch, capture); }
115120};
116121
117- typedef int constraint_id_t ;
118-
119122struct TimingAnalyser
120123{
121124 public:
@@ -233,9 +236,15 @@ struct TimingAnalyser
233236 : type(type), other_port(other_port), value(value), edge(edge){};
234237 };
235238
236- enum HasConstraint
239+ // To track whether a path has a timing exception during a forwards/backwards pass.
240+ // During the forward pass the startpoints propagate out FORWARDONLY.
241+ // During the backwards pass all ports that contain a "FORWARDONLY" will
242+ // move to "CONSTRAINED". Once the forward and backward passes have been
243+ // done only the constraints on ports that are "CONSTRAINED" apply.
244+ enum class HasPathException
237245 {
238246 FORWARDONLY,
247+ BACKWARDONLY,
239248 CONSTRAINED
240249 };
241250
@@ -258,7 +267,7 @@ struct TimingAnalyser
258267 worst_hold_slack = std::numeric_limits<delay_t >::max();
259268 // Forall timing constraints the uint8_t indicates
260269 // - During forward walking
261- dict<constraint_id_t , uint8_t > per_constraint ;
270+ dict<exception_id_t , uint8_t > per_timing_exception ;
262271 };
263272
264273 struct PerDomain
@@ -284,9 +293,7 @@ struct TimingAnalyser
284293 domain_id_t domain_id (const NetInfo *net, ClockEdge edge);
285294 domain_id_t domain_pair_id (domain_id_t launch, domain_id_t capture);
286295
287- void copy_domains (const CellPortKey &from, const CellPortKey &to, bool backwards);
288-
289- void propagate_constraints (const CellPortKey &from, const CellPortKey &to, bool backwards);
296+ void propagate_domains_and_constraints (const CellPortKey &from, const CellPortKey &to, bool backwards);
290297
291298 [[maybe_unused]] static const std::string arcType_to_str (CellArc::ArcType typ);
292299
@@ -296,11 +303,12 @@ struct TimingAnalyser
296303 std::vector<PerDomain> domains;
297304 std::vector<PerDomainPair> domain_pairs;
298305 dict<std::pair<IdString, IdString>, delay_t > clock_delays;
306+ std::vector<PathConstraint> path_constraints;
299307
300308 std::vector<CellPortKey> topological_order;
301309
302310 domain_id_t async_clock_id;
303- constraint_id_t clock_constraint_id ;
311+ exception_id_t no_exception_id ;
304312
305313 Context *ctx;
306314
0 commit comments