KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO Namespace Reference

Classes

struct  BLK_0x01_ARC
 Arc segment used in tracks, zone outlines, and shape boundaries. More...
 
struct  BLK_0x03_FIELD
 Field/property references with variable-typed substructs. More...
 
struct  BLK_0x04_NET_ASSIGNMENT
 Net assignment linking a net (0x1B) to its member objects. More...
 
struct  BLK_0x05_TRACK
 Track segment container. More...
 
struct  BLK_0x06_COMPONENT
 Component/symbol definitions. More...
 
struct  BLK_0x07_COMPONENT_INST
 Component instance reference data. More...
 
struct  BLK_0x08_PIN_NUMBER
 Pin number within a component. More...
 
struct  BLK_0x09_FILL_LINK
 Intermediate link between copper fills and their parent shapes. More...
 
struct  BLK_0x0A_DRC
 0x0A objects represent DRC (Design Rule Check) elements. More...
 
struct  BLK_0x0C_PIN_DEF
 Pin definition with shape type, drill character, coordinates, and size. More...
 
struct  BLK_0x0D_PAD
 Pad geometry and placement in board-absolute coordinates. More...
 
struct  BLK_0x0E_RECT
 Rectangular shape. More...
 
struct  BLK_0x0F_FUNCTION_SLOT
 Function slot in a multi-slot component (e.g. More...
 
struct  BLK_0x10_FUNCTION_INST
 Function instance linking a component instance (0x07) to its schematic function, pin cross-references (0x12), and function slots (0x0F). More...
 
struct  BLK_0x11_PIN_NAME
 Pin name within a component, linked from function slots (0x0F). More...
 
struct  BLK_0x12_XREF
 Cross-reference between objects. More...
 
struct  BLK_0x14_GRAPHIC
 Graphics container holding a chain of line segments and arcs. More...
 
struct  BLK_0x15_16_17_SEGMENT
 0x15 , 0x16, 0x17 are segments: More...
 
struct  BLK_0x1B_NET
 0x1B objects are nets. More...
 
struct  BLK_0x1C_PADSTACK
 Padstack definition containing drill dimensions and a table of per-layer pad/antipad/thermal components. More...
 
struct  BLK_0x1D_CONSTRAINT_SET
 Physical constraint sets containing trace width, clearance, and routing rules. More...
 
struct  BLK_0x1E_SI_MODEL
 Signal integrity and simulation model data (IBIS netlists). More...
 
struct  BLK_0x1F_PADSTACK_DIM
 Per-padstack dimension records with name and value. More...
 
struct  BLK_0x20_UNKNOWN
 Unknown purpose. More...
 
struct  BLK_0x21_BLOB
 Headered data blob containing structured board data such as layer stackup definitions, material properties, and design rule tables. More...
 
struct  BLK_0x22_UNKNOWN
 Purpose not determined. More...
 
struct  BLK_0x23_RATLINE
 0x23 objects represent ratlines. More...
 
struct  BLK_0x24_RECT
 Rectangle defined by four coordinates. More...
 
struct  BLK_0x26_MATCH_GROUP
 Match group indirection for differential pairs and match groups. More...
 
struct  BLK_0x27_CSTRMGR_XREF
 Serialized Constraint Manager database containing secondary name table (V172+), material stackup, color palette, and constraint manager state. More...
 
struct  BLK_0x28_SHAPE
 Polygon shape defined by a linked list of segments starting at m_FirstSegmentPtr (0x15/0x16/0x17 lines and 0x01 arcs). More...
 
struct  BLK_0x29_PIN
 0x29 objects may represent pins in .dra files. More...
 
struct  BLK_0x2A_LAYER_LIST
 Represents a list of layers. More...
 
struct  BLK_0x2B_FOOTPRINT_DEF
 Footprint definition (template) shared by multiple placed instances. More...
 
struct  BLK_0x2C_TABLE
 Lookup table used for named associations. More...
 
struct  BLK_0x2D_FOOTPRINT_INST
 Placed footprint instance on the board. More...
 
struct  BLK_0x2E_CONNECTION
 Connection point at a track junction or pad-to-track transition. More...
 
struct  BLK_0x2F_UNKNOWN
 Purpose not determined. More...
 
struct  BLK_0x30_STR_WRAPPER
 Text object with position, rotation, layer, font properties, and alignment. More...
 
struct  BLK_0x31_SGRAPHIC
 String graphic content holding the actual text value and its display layer category. More...
 
struct  BLK_0x32_PLACED_PAD
 Placed pad instance linking a pad definition (0x0D via m_PadPtr) to its parent footprint (m_ParentFp) and net (m_NetPtr). More...
 
struct  BLK_0x33_VIA
 Via instance with board position, padstack reference (m_Padstack for drill/annular ring definitions), and net assignment (m_NetPtr). More...
 
struct  BLK_0x34_KEEPOUT
 0x34 objects represent keepouts. More...
 
struct  BLK_0x35_FILE_REF
 File path references to Allegro log and report files (terminator.log, eclrpt.txt). More...
 
struct  BLK_0x36_DEF_TABLE
 Heterogeneous definition table containing font metrics (FontDef_X08), layer name definitions (X03), film definitions (X02), and other board-level configuration data. More...
 
struct  BLK_0x37_PTR_ARRAY
 Fixed-capacity pointer array (100 entries). More...
 
struct  BLK_0x38_FILM
 0x38 objects represent films. More...
 
struct  BLK_0x39_FILM_LAYER_LIST
 0x39 objects represent a film layer list. More...
 
struct  BLK_0x3A_FILM_LIST_NODE
 0x3A objects represent a list of films More...
 
struct  BLK_0x3B_PROPERTY
 Named property with type and value strings. More...
 
struct  BLK_0x3C_KEY_LIST
 Ordered list of block keys. More...
 
class  BLOCK
 
class  BLOCK_BASE
 The base class for all blocks in the main body of an Allegro file. More...
 
class  BLOCK_PARSER
 The block parser is responsible for parsing individual blocks of data from the file stream. More...
 
class  BLOCK_REF
 Non-owning, typed reference to a BLOCK in the database. More...
 
class  BOARD_BUILDER
 Class that builds a KiCad board from a BRD_DB (= FILE_HEADER + STRINGS + OBJECTS + bookkeeping) More...
 
class  BRD_DB
 An Allegro board database representing the contents of a .brd (and presumably .dra) file. More...
 
struct  COND_FIELD
 Version-conditional field. More...
 
struct  FILE_HEADER
 Allegro files start with this header. More...
 
class  FILE_STREAM
 Stream that reads primitive types from a memory buffer containing Allegro .brd (or .dra) file data. More...
 
class  HEADER_PARSER
 Parses a .brd header, taking care of any version-specific differences. More...
 
struct  LAYER_INFO
 
class  LAYER_MAPPER
 Class to handle the mapping for Allegro CLASS/SUBCLASS idiom to KiCad layers. More...
 
class  LL_WALKER
 Range-for-compatible walker over a linked list of BLOCK_BASE objects in a BRD_DB. More...
 
struct  PADSTACK_COMPONENT
 Substruct in a padstack object. More...
 
class  PARSER
 Class that parses a single FILE_STREAM into a BRD_DB, and handles any state involved in that parsing. More...
 
class  TYPED_LL_WALKER
 Range-for-compatible walker that yields only typed data from a linked list. More...
 
struct  VER_GE
 
struct  VER_GE_LT
 
struct  VER_LT
 

Typedefs

using MISMATCH_REPORTER = std::function<void( uint8_t aGotType, const BLOCK_BASE& aBlock )>
 Callback signature for MISMATCH_POLICY::REPORT.
 
using FIELD_VALUE = std::variant<wxString, uint32_t>
 Some value stored in an 0x03 FIELD block.
 
template<FMT_VER Min, typename T>
using COND_GE = COND_FIELD<VER_GE<Min>{}, T>
 Exists for all versions greater than or equal to Min.
 
template<FMT_VER Max, typename T>
using COND_LT = COND_FIELD<VER_LT<Max>{}, T>
 Exists for all versions less than (and not equal to) Max.
 
template<FMT_VER Min, FMT_VER Max, typename T>
using COND_GE_LT = COND_FIELD<VER_GE_LT<Min, Max>{}, T>
 Exists for all versions greater than or equal to Min and less than Max.
 

Enumerations

enum class  MISMATCH_POLICY { SKIP , LOG_TRACE , THROW , REPORT }
 Policy for TYPED_LL_WALKER when a block with an unexpected type code is encountered. More...
 
enum class  FMT_VER {
  V_UNKNOWN , V_PRE_V16 , V_160 , V_162 ,
  V_164 , V_165 , V_166 , V_172 ,
  V_174 , V_175 , V_180
}
 The format of an Allegro file. More...
 
enum  BOARD_UNITS {
  MILS = 0x01 , INCHES = 0x02 , MILLIMETERS = 0x03 , CENTIMETERS = 0x04 ,
  MICROMETERS = 0x05
}
 
enum  FIELD_KEYS {
  LOGICAL_PATH = 0x37 , MIN_LINE_WIDTH = 0x55 , NET_SCHEDULE = 0x77 , MAX_LINE_WIDTH = 0x173 ,
  MIN_NECK_WIDTH = 0x5c , MAX_NECK_LENGTH = 0x1fb , PHYS_CONSTRAINT_SET = 0x1a0
}
 Hdr1 keys for field roles. More...
 
enum class  PAD_TYPE {
  THROUGH_VIA , VIA , SMD_PIN , SLOT ,
  NPTH
}
 The type of the padstack. More...
 

Functions

template<ALLEGRO_BLOCK_DATA BLK_T>
constexpr bool BlockTypeMatches (uint8_t aType)
 Check whether a runtime block type code matches the expected type for T.
 
template<ALLEGRO_BLOCK_DATA BLK_T>
const BLK_T & BlockDataAs (const BLOCK_BASE &aBlock)
 Cast a BLOCK_BASE to a typed BLOCK<T> and return the data.
 
uint32_t GetPrimaryNext (const BLOCK_BASE &aBlock)
 Get the next block key in the linked list for a given block.
 
std::optional< FIELD_VALUEGetFirstFieldOfType (const BRD_DB &aDb, uint32_t aFieldsPtr, uint32_t aEndKey, uint16_t aFieldCode)
 Look up the first 0x03 FIELD value of a given type in a linked field chain.
 
std::optional< int > GetFirstFieldOfTypeInt (const BRD_DB &aDb, uint32_t aFieldsPtr, uint32_t aEndKey, uint16_t aFieldCode)
 Convenience wrapper around GetFirstFieldOfType() for integer-valued fields.
 
constexpr bool operator>= (FMT_VER lhs, FMT_VER rhs)
 
std::ostream & boost_test_print_type (std::ostream &os, FMT_VER const &aFmtVer)
 

Variables

const wxChar *const traceAllegroUtils = wxT( "KICAD_ALLEGRO_BUILDER" )
 

Typedef Documentation

◆ COND_GE

template<FMT_VER Min, typename T>
using ALLEGRO::COND_GE = COND_FIELD<VER_GE<Min>{}, T>

Exists for all versions greater than or equal to Min.

Definition at line 233 of file allegro_pcb_structs.h.

◆ COND_GE_LT

template<FMT_VER Min, FMT_VER Max, typename T>
using ALLEGRO::COND_GE_LT = COND_FIELD<VER_GE_LT<Min, Max>{}, T>

Exists for all versions greater than or equal to Min and less than Max.

Definition at line 241 of file allegro_pcb_structs.h.

◆ COND_LT

template<FMT_VER Max, typename T>
using ALLEGRO::COND_LT = COND_FIELD<VER_LT<Max>{}, T>

Exists for all versions less than (and not equal to) Max.

Definition at line 237 of file allegro_pcb_structs.h.

◆ FIELD_VALUE

using ALLEGRO::FIELD_VALUE = std::variant<wxString, uint32_t>

Some value stored in an 0x03 FIELD block.

Definition at line 422 of file allegro_db_utils.h.

◆ MISMATCH_REPORTER

using ALLEGRO::MISMATCH_REPORTER = std::function<void( uint8_t aGotType, const BLOCK_BASE& aBlock )>

Callback signature for MISMATCH_POLICY::REPORT.

Parameters
aGotTypethe block type code that was found
aBlockthe raw block that did not match

Definition at line 294 of file allegro_db_utils.h.

Enumeration Type Documentation

◆ BOARD_UNITS

Enumerator
MILS 
INCHES 
MILLIMETERS 
CENTIMETERS 
MICROMETERS 

Definition at line 254 of file allegro_pcb_structs.h.

◆ FIELD_KEYS

Hdr1 keys for field roles.

Enumerator
LOGICAL_PATH 
MIN_LINE_WIDTH 
NET_SCHEDULE 

Net class/schedule assignment.

MAX_LINE_WIDTH 
MIN_NECK_WIDTH 
MAX_NECK_LENGTH 
PHYS_CONSTRAINT_SET 

Physical Constraint Set assignment.

Definition at line 647 of file allegro_pcb_structs.h.

◆ FMT_VER

enum class ALLEGRO::FMT_VER
strong

The format of an Allegro file.

Allegro formats seem to be versioned per the magic, with the lowest byte masked out (or at least there no known case of the lower magic byte changing the format.

But the version does not seem to be directly related to the Allegro version (e.g. 17.2) itself.

Enumerator
V_UNKNOWN 
V_PRE_V16 
V_160 
V_162 
V_164 
V_165 
V_166 
V_172 
V_174 
V_175 
V_180 

Definition at line 135 of file allegro_pcb_structs.h.

◆ MISMATCH_POLICY

enum class ALLEGRO::MISMATCH_POLICY
strong

Policy for TYPED_LL_WALKER when a block with an unexpected type code is encountered.

Enumerator
SKIP 

silently skip blocks with the wrong type

LOG_TRACE 

wxLogTrace the mismatch and skip

THROW 

THROW_IO_ERROR on mismatch.

REPORT 

invoke a user-supplied callback, then skip

Definition at line 279 of file allegro_db_utils.h.

◆ PAD_TYPE

enum class ALLEGRO::PAD_TYPE
strong

The type of the padstack.

This seems a little uncertain in places (there seems to be 2 codes for SMD for example)

Enumerator
THROUGH_VIA 
VIA 
SMD_PIN 
SLOT 
NPTH 

Definition at line 1156 of file allegro_pcb_structs.h.

Function Documentation

◆ BlockDataAs()

◆ BlockTypeMatches()

template<ALLEGRO_BLOCK_DATA BLK_T>
bool ALLEGRO::BlockTypeMatches ( uint8_t aType)
constexpr

Check whether a runtime block type code matches the expected type for T.

Definition at line 59 of file allegro_db_utils.h.

Referenced by BlockDataAs(), and ALLEGRO::TYPED_LL_WALKER< T >::ITERATOR::skipMismatches().

◆ boost_test_print_type()

std::ostream & ALLEGRO::boost_test_print_type ( std::ostream & os,
FMT_VER const & aFmtVer )

Definition at line 32 of file allegro_test_utils.cpp.

◆ GetFirstFieldOfType()

std::optional< FIELD_VALUE > ALLEGRO::GetFirstFieldOfType ( const BRD_DB & aDb,
uint32_t aFieldsPtr,
uint32_t aEndKey,
uint16_t aFieldCode )

Look up the first 0x03 FIELD value of a given type in a linked field chain.

Parameters
aDbthe database to look in
aFieldsPtrpointer to the head of the field chain
aEndKeykey of the end-of-chain sentinel node
aFieldCodethe field code to look for (e.g. 0x68)
Returns
the field value as a string or integer, or nullopt if not found

Definition at line 36 of file allegro_db_utils.cpp.

References BlockDataAs().

Referenced by ALLEGRO::BOARD_BUILDER::applyConstraintSets(), and GetFirstFieldOfTypeInt().

◆ GetFirstFieldOfTypeInt()

std::optional< int > ALLEGRO::GetFirstFieldOfTypeInt ( const BRD_DB & aDb,
uint32_t aFieldsPtr,
uint32_t aEndKey,
uint16_t aFieldCode )

Convenience wrapper around GetFirstFieldOfType() for integer-valued fields.

Definition at line 78 of file allegro_db_utils.cpp.

References GetFirstFieldOfType(), and result.

Referenced by ALLEGRO::BOARD_BUILDER::applyNetConstraints().

◆ GetPrimaryNext()

uint32_t ALLEGRO::GetPrimaryNext ( const BLOCK_BASE & aBlock)

Get the next block key in the linked list for a given block.

Each block type stores its linked-list pointer in a different member. This function dispatches on block type to return the appropriate m_Next value.

Returns
the next block key, or 0 if there is none

Definition at line 30 of file allegro_db_utils.cpp.

References ALLEGRO::BLOCK_BASE::GetNext().

Referenced by ALLEGRO::LL_WALKER::LL_WALKER(), ALLEGRO::LL_WALKER::LL_WALKER(), ALLEGRO::TYPED_LL_WALKER< T >::TYPED_LL_WALKER(), and ALLEGRO::TYPED_LL_WALKER< T >::TYPED_LL_WALKER().

◆ operator>=()

bool ALLEGRO::operator>= ( FMT_VER lhs,
FMT_VER rhs )
constexpr

Definition at line 150 of file allegro_pcb_structs.h.

Variable Documentation

◆ traceAllegroUtils

const wxChar* const ALLEGRO::traceAllegroUtils = wxT( "KICAD_ALLEGRO_BUILDER" )
inline