TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
diff_pair.hpp File Reference

Differential pairs (design doc 05 §9 phase 3, §15): the geometry rule a pair is routed at, and a measurement of how a routed pair came out (coupled share, gap, intra-pair skew). More...

#include <algorithm>
#include <optional>
#include <string>
#include <vector>
#include "drc/rule_engine.hpp"
#include "geom/point.hpp"
#include "model/board.hpp"
#include "model/rules.hpp"

Go to the source code of this file.

Classes

struct  tmk::route::PairRule
 What a pair is routed at. More...
struct  tmk::route::Dir2
 Octilinear unit direction d (0..7, E, NE, N, NW, W, SW, S, SE with y down) and its left normal, as doubles. More...
struct  tmk::route::PairStats
 A routed pair, measured on its tracks: a sample of one half counts as coupled where a parallel track of the other half on the same layer lies within coupled_gap edge to edge. More...

Namespaces

namespace  tmk
namespace  tmk::route

Functions

PairRule tmk::route::pair_rule (const model::Board &b, const model::DesignRules &rules, const drc::RuleEngine &re, model::NetId a, model::NetId c, Coord via_mask=0)
 via_mask: solder-mask expansion of untented vias (route::Obstacles::via_mask()); two vias then need their mask openings apart as well.
Dir2 tmk::route::unit_dir (int d)
Dir2 tmk::route::left_normal (int d)
geom::Point tmk::route::offset_point (geom::Point p, Dir2 v, double s)
 p + s * v, rounded half away from zero (KiCad's KiROUND), so offsets are symmetric about the centreline.
geom::Point tmk::route::miter_point (geom::Point c, int d1, int d2, double s)
 Miter corner of a polyline offset by s (signed: + left) where the centreline turns from direction d1 to d2.
Coord tmk::route::coupled_threshold (const PairRule &r)
 Edge gap up to which a sample counts as coupled: the pair's gap plus a quarter of it (at least 50 um), so lattice rounding and the miter at bends do not count as uncoupled while a single track wandering off does.
PairStats tmk::route::measure_pair (const std::vector< model::Track > &tracks, const std::vector< model::Via > &vias, model::NetId a, model::NetId c, Coord coupled_gap)
std::vector< std::pair< model::NetId, model::NetId > > tmk::route::named_pairs (const model::Board &b, const drc::RuleEngine &re)
 Net pairs KiCad treats as differential pairs (names ending in P/N or +/-), in net order.

Detailed Description

Differential pairs (design doc 05 §9 phase 3, §15): the geometry rule a pair is routed at, and a measurement of how a routed pair came out (coupled share, gap, intra-pair skew).

The coupled search itself lives in the router (route/router.cpp, route_pair), which owns the lattice and the transaction state.

Definition in file diff_pair.hpp.