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

Impedance and current rules on a real board (design doc 15 §5.3-5.4, P4): the board stackup gives, per routing layer, the line structure and the dielectric to the nearest reference layer; the closed forms of impedance.hpp turn a rule's target (z0_ohm / zdiff_ohm) into a width and gap. More...

#include <optional>
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "crules/catalogue.hpp"
#include "crules/impedance.hpp"
#include "model/board.hpp"
#include "model/rules.hpp"

Go to the source code of this file.

Classes

struct  tmk::crules::LayerGeometry
 One copper layer's line geometry from the stackup. More...
struct  tmk::crules::LineSolution
 The width (and gap) that meets one target on one layer. More...
struct  tmk::crules::ImpedancePlan
struct  tmk::crules::CurrentPlan
 Width for a rule that names a current (doc 15 §5.4, IPC-2221). More...
struct  tmk::crules::LayerDelay
 Propagation delay per copper layer used to turn ps skew budgets into mm (doc 15 §4): from the stackup (eps_eff of a 50 ohm line on outer layers, er on inner layers) or the catalogue's FR-4 defaults. More...

Namespaces

namespace  tmk
namespace  tmk::crules

Functions

std::vector< LayerGeometry > tmk::crules::stackup_geometry (const model::Board &b)
ImpedancePlan tmk::crules::plan_impedance (const model::Board &b, const model::DesignRules *rules, const RuleSpec &r)
 Board bounds used for solving: the narrowest width and the pair / coplanar gap (see impedance_rules.cpp).
std::string tmk::crules::impedance_text (const ImpedancePlan &p)
double tmk::crules::pair_impedance (const model::Board &b, int copper, Coord width, Coord gap)
 Differential impedance of an existing width/gap on a copper layer (to compare a board net class with the target); < 0 when the layer has no complete stackup geometry.
nlohmann::json tmk::crules::impedance_json (const ImpedancePlan &p)
CurrentPlan tmk::crules::plan_current (const model::Board &b, const RuleSpec &r)
std::string tmk::crules::current_text (const CurrentPlan &p)
nlohmann::json tmk::crules::current_json (const CurrentPlan &p)
std::vector< LayerDelay > tmk::crules::prop_delays (const model::Board &b, const Catalogue &cat)
std::string tmk::crules::stackup_summary (const model::Board &b, const Catalogue &cat)
 One line for the report header: the stackup summary and the delays, or why defaults are used.
nlohmann::json tmk::crules::stackup_json (const model::Board &b, const Catalogue &cat)

Detailed Description

Impedance and current rules on a real board (design doc 15 §5.3-5.4, P4): the board stackup gives, per routing layer, the line structure and the dielectric to the nearest reference layer; the closed forms of impedance.hpp turn a rule's target (z0_ohm / zdiff_ohm) into a width and gap.

Report-only: nothing here changes routing.

Assumption (dev/assumptions-m13.md, P4): the copper layer adjacent to a routing layer is its reference plane. Outer layers are microstrip over the next copper layer; inner layers are stripline between the copper layers above and below. A zone on the reference layer is reported as confirmation; without one the report says the plane is assumed. Boards without a stackup get nothing computed (doc 15 §3.6; CLAUDE.md rule 6).

Definition in file impedance_rules.hpp.