KiCad PCB EDA Suite
test Namespace Reference

Classes

class  DRC_CONSTRAINT
 
class  DRC_ENGINE
 Design Rule Checker object that performs all the DRC tests. More...
 
class  DRC_ITEM
 
class  DRC_REGISTER_TEST_PROVIDER
 
class  DRC_RULE
 
class  DRC_RULE_CONDITION
 
class  DRC_RULES_PARSER
 
class  DRC_TEST_PROVIDER
 DRC_TEST_PROVIDER is a base class that represents a DRC "provider" which runs some DRC functions over a BOARD and spits out #PCB_MARKERs as needed. More...
 
class  DRC_TEST_PROVIDER_CLEARANCE_BASE
 
class  DRC_TEST_PROVIDER_COPPER_CLEARANCE
 
class  DRC_TEST_PROVIDER_EDGE_CLEARANCE
 
class  DRC_TEST_PROVIDER_HOLE_CLEARANCE
 
class  DRC_TEST_PROVIDER_HOLE_SIZE
 
class  DRC_TEST_PROVIDER_REGISTRY
 
class  MINOPTMAX
 

Enumerations

enum  PCB_DRC_CODE {
  DRCE_FIRST = 1, DRCE_UNCONNECTED_ITEMS = DRCE_FIRST, DRCE_SHORTING_ITEMS, DRCE_ALLOWED_ITEMS,
  DRCE_CLEARANCE, DRCE_TRACKS_CROSSING, DRCE_COPPER_EDGE_CLEARANCE, DRCE_ZONES_INTERSECT,
  DRCE_ZONE_HAS_EMPTY_NET, DRCE_DANGLING_VIA, DRCE_DANGLING_TRACK, DRCE_HOLE_CLEARANCE,
  DRCE_TRACK_WIDTH, DRCE_TOO_SMALL_VIA, DRCE_VIA_ANNULUS, DRCE_TOO_SMALL_DRILL,
  DRCE_VIA_HOLE_BIGGER, DRCE_PADSTACK, DRCE_TOO_SMALL_MICROVIA, DRCE_TOO_SMALL_MICROVIA_DRILL,
  DRCE_KEEPOUT, DRCE_OVERLAPPING_FOOTPRINTS, DRCE_MISSING_COURTYARD, DRCE_MALFORMED_COURTYARD,
  DRCE_PTH_IN_COURTYARD, DRCE_NPTH_IN_COURTYARD, DRCE_DISABLED_LAYER_ITEM, DRCE_INVALID_OUTLINE,
  DRCE_MISSING_FOOTPRINT, DRCE_DUPLICATE_FOOTPRINT, DRCE_EXTRA_FOOTPRINT, DRCE_UNRESOLVED_VARIABLE,
  DRCE_LAST = DRCE_UNRESOLVED_VARIABLE
}
 DRC error codes: More...
 
enum  DRC_RULE_ID_T { DRC_RULE_ID_T::DRC_RULE_ID_CLEARANCE = 0, DRC_RULE_ID_T::DRC_RULE_ID_HOLE_CLEARANCE, DRC_RULE_ID_T::DRC_RULE_ID_EDGE_CLEARANCE, DRC_RULE_ID_T::DRC_RULE_ID_HOLE_SIZE }
 
enum  DRC_RULE_SEVERITY_T { DRC_RULE_SEVERITY_T::DRC_SEVERITY_IGNORE = 0, DRC_RULE_SEVERITY_T::DRC_SEVERITY_WARNING, DRC_RULE_SEVERITY_T::DRC_SEVERITY_ERROR }
 

Functions

void drc_dbg (int level, const char *fmt,...)
 

Enumeration Type Documentation

◆ DRC_RULE_ID_T

◆ DRC_RULE_SEVERITY_T

◆ PCB_DRC_CODE

DRC error codes:

Enumerator
DRCE_FIRST 
DRCE_UNCONNECTED_ITEMS 

items are unconnected

DRCE_SHORTING_ITEMS 

items shorting two nets but not a net-tie

DRCE_ALLOWED_ITEMS 

a disallowed item has been used

DRCE_CLEARANCE 

items are too close together

DRCE_TRACKS_CROSSING 

tracks are crossing

DRCE_COPPER_EDGE_CLEARANCE 

a copper item is too close to the board edge

DRCE_ZONES_INTERSECT 

copper area outlines intersect

DRCE_ZONE_HAS_EMPTY_NET 

copper area has a net but no pads in nets, which is suspicious

DRCE_DANGLING_VIA 

via which isn't connected to anything

DRCE_DANGLING_TRACK 

track with at least one end not connected to anything

DRCE_HOLE_CLEARANCE 

overlapping drilled holes break drill bits

DRCE_TRACK_WIDTH 

Track width is too small or too large.

DRCE_TOO_SMALL_VIA 

Too small via size.

DRCE_VIA_ANNULUS 

Via size and drill leave annulus too small or too large.

DRCE_TOO_SMALL_DRILL 

Too small via or pad drill.

DRCE_VIA_HOLE_BIGGER 

via's hole is bigger than its diameter

DRCE_PADSTACK 

something is wrong with a pad or via stackup

DRCE_TOO_SMALL_MICROVIA 

Too small micro via size.

DRCE_TOO_SMALL_MICROVIA_DRILL 

Too small micro via drill.

DRCE_KEEPOUT 

A disallowed object is inside a keepout.

DRCE_OVERLAPPING_FOOTPRINTS 

footprint courtyards overlap

DRCE_MISSING_COURTYARD 

footprint has no courtyard defined

DRCE_MALFORMED_COURTYARD 

footprint has a courtyard but malformed (not convertible to a closed polygon with holes)

DRCE_PTH_IN_COURTYARD 
DRCE_NPTH_IN_COURTYARD 
DRCE_DISABLED_LAYER_ITEM 

item on a disabled layer

DRCE_INVALID_OUTLINE 

invalid board outline

DRCE_MISSING_FOOTPRINT 

footprint not found for netlist item

DRCE_DUPLICATE_FOOTPRINT 

more than one footprints found for netlist item

DRCE_EXTRA_FOOTPRINT 

netlist item not found for footprint

DRCE_UNRESOLVED_VARIABLE 
DRCE_LAST 

Definition at line 66 of file drc_engine.h.

67 {
68  DRCE_FIRST = 1,
88  DRCE_KEEPOUT,
100 
102 
104 };
Via size and drill leave annulus too small or too large.
a disallowed item has been used
overlapping drilled holes break drill bits
Definition: drc_engine.h:79
items short two nets but are not a net tie
footprint not found for netlist item
Definition: drc_engine.h:97
something is wrong with a pad or via stackup
item on a disabled layer
Definition: drc_engine.h:95
a copper item is too close to the board edge
netlist item not found for footprint
Definition: drc_engine.h:99
Too small micro via drill.
Definition: drc_engine.h:87
items are unconnected
Definition: drc_engine.h:69
Too small via or pad drill.
track with at least one end not connected to anything
Definition: drc_engine.h:78
via's hole is bigger than its diameter
Definition: drc_engine.h:84
footprint has a courtyard but malformed (not convertible to a closed polygon with holes)
Definition: drc_engine.h:91
Too small micro via size.
Definition: drc_engine.h:86
invalid board outline
Definition: drc_engine.h:96
copper area has a net but no pads in nets, which is suspicious
Definition: drc_engine.h:76
footprint has no courtyard defined
Definition: drc_engine.h:90
Too small via size.
Definition: drc_engine.h:81
footprint courtyards overlap
Definition: drc_engine.h:89
more than one footprints found for netlist item
Definition: drc_engine.h:98
tracks are crossing
Definition: drc_engine.h:73
A disallowed object is inside a keepout.
Track width is too small or too large.
copper area outlines intersect
Definition: drc_engine.h:75
via which isn't connected to anything
Definition: drc_engine.h:77
items are too close together

Function Documentation

◆ drc_dbg()

void test::drc_dbg ( int  level,
const char *  fmt,
  ... 
)

Definition at line 116 of file drc_engine.cpp.

117 {
118 #ifdef DEBUG
119  long dlevel = drc_debug_level;
120  wxString dlevelstr;
121  if( wxGetEnv( "DRC_DEBUG_LEVEL", &dlevelstr ) )
122  {
123  dlevelstr.ToLong( &dlevel );
124  }
125 
126 
127  if(level < dlevel) // fixme: tom's debugging.
128  {
129  va_list ap;
130  va_start( ap, fmt );
131  fprintf( stderr, "drc: " );
132  vfprintf( stderr, fmt, ap );
133  va_end( ap );
134  }
135 #endif
136 }
static const int drc_debug_level
Definition: drc_engine.cpp:114

References drc_debug_level.

Referenced by test::DRC_ENGINE::CompileRules(), test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::doPadToPadHoleDrc(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::doPadToPadsDrc(), test::DRC_ENGINE::EvalRulesForItems(), test::DRC_RULES_PARSER::Parse(), test::DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::Run(), test::DRC_ENGINE::RunTests(), and test::DRC_TEST_PROVIDER_HOLE_CLEARANCE::testPads2Holes().