CADSTAR
Introduction
CADSTAR is a PCB design suite from Zuken. KiCad imports CADSTAR Schematic Archive, PCB Archive, and Parts Library files. Schematic and PCB files are imported separately; there is no project-level import.
Supported file types:
-
.csa— CADSTAR Schematic Archive -
.cpa— CADSTAR PCB Archive (also serves as a footprint library source) -
.lib— CADSTAR Parts Library
Both archive formats use an S-expression-like structure parsed into an XNODE tree. The Parts Library uses a separate text-based format parsed with a PEGTL PEG grammar.
Archive File Structure
CADSTAR archive files (.csa and .cpa) use a parenthesized token format similar to
S-expressions, encoded as Windows-1252 text. DSNLEXER parses them into an XNODE tree.
Each node name is the first token after an opening parenthesis; subsequent tokens become
numbered XML-style attributes (attr0, attr1, etc.).
File Identification
The outermost node identifies the file type:
-
CADSTARSCM— Schematic Archive -
CADSTARPCB— PCB Archive (also used whenFORMATtype isLIBRARY)
(CADSTARPCB
(HEADER ...)
(ASSIGNMENTS ...)
(LIBRARY ...)
(DEFAULTS ...)
(PARTS ...)
(LAYOUT ...)
(DISPLAY ...)
)
(CADSTARSCM
(HEADER ...)
(ASSIGNMENTS ...)
(LIBRARY ...)
(DEFAULTS ...)
(PARTS ...)
(SHEETS ...)
(SCHEMATIC ...)
(DISPLAY ...)
)
HEADER
The HEADER node contains file metadata.
(HEADER
(FORMAT "LAYOUT" 0 21)
(JOBFILE "design.pcb")
(JOBTITLE "My Design")
(GENERATOR "CADSTAR 2020.0")
(RESOLUTION
(METRIC "HUNDREDTH" "MICRON")
)
(TIMESTAMP 2020 3 15 10 30 0)
)
| Child Node | Description |
|---|---|
|
|
|
Original design filename |
|
Design title string |
|
Application that created the archive |
|
Contains |
|
Six integer attributes: year, month, day, hour, minute, second |
Version Compatibility
The FORMAT node attr2 field contains the archive version number.
| Version | CADSTAR Release |
|---|---|
8 |
CADSTAR v6 |
9 |
CADSTAR v7+ |
19 |
CADSTAR 17.0 |
20 |
CADSTAR 18.0 |
21 |
CADSTAR 2018.0 / 2019.0 / 2020.0 |
| CADSTAR v6 (version 8) files store angles in 1/10 degree units. Version 9 and later files use 1/1000 degree units. |
Unit System
All coordinate and dimension values in the archive are stored in hundredths of a micron.
The RESOLUTION node always declares METRIC HUNDREDTH MICRON. The conversion to
KiCad internal units multiplies by PCB_IU_PER_MM / 1e5 (PCB) or SCH_IU_PER_MM / 1e5
(schematic).
Angles throughout the format are in 1/1000 of a degree unless the file version is 8 (CADSTAR v6), where angles are in 1/10 of a degree.
Common Geometry Types
Several primitive types appear throughout both archive formats:
| Node | Structure |
|---|---|
|
Point with |
|
Engineering value with |
|
Clockwise arc; two child |
|
Anticlockwise arc; two child |
|
Clockwise semicircle; one child |
|
Anticlockwise semicircle; one child |
Shapes are built from sequences of these vertex nodes and appear in one of four container types:
| Shape Node | Description |
|---|---|
|
Open polyline, no fill, no cutouts |
|
Closed unfilled polygon |
|
Closed polygon with solid fill |
|
Closed polygon with hatch fill; |
Each shape contains an ordered sequence of vertex child nodes. A CUTOUT child within
a closed shape defines an interior hole as another vertex sequence.
CODEDEFS (Common)
The CODEDEFS node appears within ASSIGNMENTS and defines style codes shared between
schematic and PCB archives.
| Child Node | Description |
|---|---|
|
Line style: |
|
Hatch pattern: |
|
Text style: |
|
Route width: |
|
Attribute definition: |
|
Net class: |
|
Spacing class: |
Schematic Archive (.csa)
A .csa file has the root node CADSTARSCM and the following top-level structure:
CADSTARSCM
+-- HEADER
+-- ASSIGNMENTS
| +-- CODEDEFS (common codes + TERMINALCODE)
| +-- GRIDS
| +-- SETTINGS (design origin, area, units)
+-- LIBRARY
| +-- SYMDEF ... (symbol definitions)
+-- DEFAULTS
+-- PARTS
| +-- PART ... (part definitions with pin mappings)
+-- SHEETS
| +-- SHEET ... (sheet names and ordering)
+-- SCHEMATIC
| +-- GROUP ...
| +-- REUSEBLOCK ...
| +-- FIGURE ...
| +-- SYMBOL ...
| +-- BUS ...
| +-- BLOCK ...
| +-- NET ...
| +-- TEXT ...
| +-- DOCSYMBOL ...
| +-- VHIERARCHY
+-- DISPLAY
+-- ATTRCOLORS
+-- SCMITEMCOLORS
Terminal Codes
Schematic archives extend CODEDEFS with TERMINALCODE entries that define the shape
of connection points on symbols.
(TERMINALCODE "TC1" "Standard Pin"
(ANNULUS 5000 ...)
)
| Field | Description |
|---|---|
|
TERMINALCODE_ID |
|
Name |
Child shape node |
One of the terminal shape types (see table below) |
|
Optional flag indicating the terminal shape is filled |
Terminal Shape Types
| Keyword | Shape |
|---|---|
|
Ring |
|
Rectangular box |
|
Bullet |
|
Circle |
|
Cross |
|
Diamond |
|
Elongated finger |
|
Octagon |
|
Plus sign |
|
Pointer / arrow |
|
Rectangle |
|
Rounded rectangle |
|
Square |
|
Star |
|
Triangle |
Shape parameters follow the shape keyword as attributes: attr0=size,
attr1=left length (optional), attr2=right length (optional),
attr3=internal feature (optional). An ORIENT child specifies angle.
Symbol Definitions (SYMDEF)
Symbol definitions live in the LIBRARY node. Each SYMDEF defines a reusable
schematic symbol.
(SYMDEF "SD1" "RESISTOR" "A"
(PT 0 0) ;; Origin
(TERMINAL 1 "TC1"
(PT 0 -50000)
(ORIENT 0)
)
(TERMINAL 2 "TC1"
(PT 0 50000)
(ORIENT 1800000)
)
(FIGURE ...)
(TEXT ...)
(TEXTLOC ...)
(ATTR ...)
)
| Field | Description |
|---|---|
|
SYMDEF_ID |
|
Reference name (library identifier) |
|
Alternate name (variant within the same base symbol) |
|
Component origin point |
|
Sequential integer for library/design discrepancy detection |
|
Present if the archive was exported without the component library |
|
Pin connection point: |
|
Graphical shape elements |
|
Text elements |
|
Attribute display locations including designator position |
|
Pin number label location for a terminal |
|
Pin name label location for a terminal |
Symbols (Instances)
Symbol instances in the SCHEMATIC node reference a SYMDEF and add placement data.
(SYMBOL "S1" "SD1" "LAY1"
(PT 100000 200000)
(ORIENT 0)
(COMP "R1")
(PARTREF "P1")
(GATE "A")
...
)
Key fields:
| Field | Description |
|---|---|
|
SYMBOL_ID |
|
SYMDEF_ID reference |
|
LAYER_ID (sheet) |
|
Placement origin |
|
Orientation angle (1/1000 degree) |
|
Present if mirrored |
|
Component reference designator |
|
Part library reference ID |
|
Gate identifier within the part |
|
Signal reference type: |
|
Cross-reference sheet annotation for signal references |
|
Arbitrary symbol scaling as numerator/denominator ratio |
Nets (Schematic)
Schematic nets contain several element types, each with an ID prefix convention:
| Node | ID Prefix | Description |
|---|---|---|
|
|
Symbol terminal connection |
|
|
Junction point with optional net label |
|
|
Bus terminal connection (point on bus + wire start point) |
|
|
Block terminal connection (hierarchical) |
|
|
Dangling wire end |
|
— |
Connection (wire) between two net elements |
Net properties: SIGNAME (net name), SIGNUM (signal number for unnamed nets),
NETCODE (route code reference), NETCLASSREF, SPACINGCLASS.
Connections contain a LayerID (sheet), a sequence of PT nodes defining the wire
path, and a LINECODEREF for the wire line style.
Buses
(BUS "B1" "LC1" "LAY1"
(OPENSHAPE
(PT 100000 200000)
(PT 100000 300000)
)
(BUSNAME "DATA[0:7]")
(SIGLOC ...)
)
Blocks
Blocks define hierarchical sheet structure:
| Type | Description |
|---|---|
|
References the sheet the block is on |
|
Parent sheet reference |
|
Child sheet reference |
Each block has an AssocLayerID linking to the associated parent or child sheet,
and may contain TERMINAL and FIGURE children for block port connections.
Sheets
The SHEETS node maps LAYER_IDs to sheet names and defines display order:
(SHEETS
(SHEET "LAY1" "Sheet 1")
(SHEET "LAY2" "Sheet 2")
...
)
PCB Archive (.cpa)
A .cpa file has the root node CADSTARPCB and the following top-level structure:
CADSTARPCB
+-- HEADER
+-- ASSIGNMENTS
| +-- LAYERDEFS
| | +-- LAYERSTACK
| | +-- MATERIAL ...
| | +-- LAYER ...
| | +-- SWAPPAIR ...
| +-- CODEDEFS (common codes + PADCODE, VIACODE, COPPERCODE, SPACINGCODE, etc.)
| +-- TECHNOLOGY (design rules, grid settings)
| +-- GRIDS
+-- LIBRARY
| +-- SYMDEF ... (component/footprint definitions)
+-- DEFAULTS
+-- PARTS
| +-- PART ... (part definitions with pin mappings)
+-- LAYOUT
| +-- GROUP ...
| +-- REUSEBLOCK ...
| +-- BOARD ...
| +-- FIGURE ...
| +-- AREA ...
| +-- COMPONENT ...
| +-- DOCSYMBOL ...
| +-- TRUNK ...
| +-- NET ... (tracks, vias, connections)
| +-- TEMPLATE ... (copper pour zones)
| +-- COPPER ... (poured copper shapes)
| +-- TEXT ...
| +-- DIMENSION ...
| +-- DRILLTABLE ...
| +-- VHIERARCHY
+-- DISPLAY
Layer Definitions
The LAYERDEFS node within ASSIGNMENTS defines the PCB stackup.
(LAYERDEFS
(LAYERSTACK "LAY1" "LAY2" "LAY3" ...)
(MATERIAL "MAT1" "FR4" "NONELEC"
(RELPERMIT (E 42 -1))
(LOSSTANGENT (E 2 -2))
(RESISTIVITY (E 17 1))
)
(LAYER "LAY1" "Top Copper"
(ELEC 1
(MAKE "MAT1" 35000)
)
)
(SWAPPAIR "LAY1" "LAY3")
)
Layer Types
| Keyword | Description |
|---|---|
|
Built-in: all layers |
|
Built-in: all electrical layers |
|
Built-in: all documentation layers |
|
Built-in: no layer |
|
Built-in: associated component copper |
|
Built-in: jumper layer |
|
Electrical copper layer; |
|
Power plane layer; |
|
Non-electrical layer with subtypes |
|
Construction layer |
|
Documentation layer |
Layer Subtypes (NONELEC)
| Keyword | Subtype |
|---|---|
|
Silkscreen |
|
Placement |
|
Assembly |
|
Solder resist |
|
Solder paste |
|
Clearance |
|
Board routing/outline |
Layer Properties
Each LAYER node can contain:
| Child Node | Description |
|---|---|
|
|
|
|
|
Routing bias: |
|
Present if this layer is a reference plane |
|
Present if this is a variant layer |
Material Properties
| Child Node | Description |
|---|---|
|
Relative permittivity (dielectric constant), contains |
|
Dielectric loss tangent, contains |
|
Resistivity in units of 10^-8 ohm-metre, contains |
Material types: CONSTRUCTION, ELECTRICAL, NONELEC.
PCB Code Definitions
The PCB CODEDEFS node extends the common codes with additional PCB-specific entries:
| Child Node | Description |
|---|---|
|
Copper fill width: |
|
Spacing design rule: |
|
Pad definition (see below) |
|
Via definition (see below) |
|
Default via between layer pair: |
|
Area-specific design rule set: |
|
Spacing class pair rule: two SPACING_CLASS_IDs, LAYER_ID, spacing value |
Pad Codes
(PADCODE "PC1" "SMD_1206"
(RECTANGLE 120000 30000 30000)
(RELIEFWIDTH 25000)
(RELIEFCLEARANCE 20000)
(DRILL 0)
)
| Field | Description |
|---|---|
|
PADCODE_ID |
|
Name |
Shape node |
Pad shape (see pad shape table below) |
|
Thermal relief clearance |
|
Thermal relief spoke width |
|
Drill diameter; |
|
Drill oversize |
|
Slot length for oblong drills |
|
Slot orientation angle |
|
X offset of drill from pad center |
|
Y offset of drill from pad center |
|
Present if through-hole pad is plated (default true) |
|
Per-layer shape override: LAYER_ID + shape node |
Pad Shape Types
| Keyword | Enum Value | Shape Parameters |
|---|---|---|
|
ANNULUS |
|
|
BULLET |
|
|
CIRCLE |
|
|
DIAMOND |
|
|
FINGER |
|
|
OCTAGON |
|
|
RECTANGLE |
|
|
ROUNDED_RECT |
|
|
SQUARE |
|
All pad shapes may have an ORIENT child node specifying rotation in 1/1000 degree.
Via Codes
(VIACODE "VC1" "Standard Via"
(ROUND 60000)
(DRILL 30000)
(RELIEFCLEARANCE 20000)
(RELIEFWIDTH 25000)
)
Via codes have the same structure as pad codes but without slot-related fields.
Per-layer overrides use VIAREASSIGN nodes.
Spacing Code Rules
The spacing code ID encodes the rule type. Known spacing rule identifiers:
| ID | Rule |
|---|---|
|
Component placement to component placement |
|
Copper to board outline |
|
Copper to copper |
|
Hole to hole |
|
Pad to board |
|
Pad to copper |
|
Pad to pad |
|
Pad to SMD pad (optional) |
|
Pad to via |
|
Route to board outline |
|
Route to copper |
|
Route to pad |
|
Route to route |
|
Route to SMD pad (optional) |
|
Route to via |
|
Via to board |
|
Via to copper |
|
Via to SMD pad (optional) |
|
Via to via |
|
SMD pad to board (optional) |
|
SMD pad to copper (optional) |
|
SMD pad to SMD pad (optional) |
|
Test land to board |
|
Test land to component |
|
Test land to test land |
|
Optimal route to pad (optional) |
|
Optimal route to route (optional) |
|
Optimal route to via (optional) |
Additional design rules in the TECHNOLOGY node: MAXMITER, MINMITER,
MINUNNECKED, MINNECKED, MINROUTEWIDTH.
TECHNOLOGY Section
The TECHNOLOGY node extends SETTINGS with PCB manufacturing rules:
| Field | Description |
|---|---|
|
Minimum (thin) route width |
|
Minimum thinner track length |
|
Minimum thicker track length |
|
Minimum mitre (not enforced by CADSTAR) |
|
Maximum mitre (not enforced by CADSTAR) |
|
Maximum physical layer number (must be >= number of copper layers) |
|
Track routing grid (equal X and Y) |
|
Via placement grid (equal X and Y) |
|
Back off at junctions flag |
|
Back off at width changes flag |
Component Definitions (SYMDEF for PCB)
PCB symbol definitions extend the common SYMDEF with component-specific structures:
(SYMDEF "SD1" "RESISTOR_0805" ""
(PT 0 0) ;; Origin
(SYMHEIGHT 100000) ;; 3D component height
(PAD 1 (PT -45000 0) "PC1" "MINIMUM"
(EXITS ...)
(PINIDENTIFIER "1")
(FIRSTPAD)
)
(PAD 2 (PT 45000 0) "PC1" "MINIMUM"
(EXITS ...)
(PINIDENTIFIER "2")
)
(COMPCOPPER ...)
(COMPAREA ...)
(FIGURE ...)
)
| Field | Description |
|---|---|
|
3D component height in z direction |
|
Component pad: |
|
Copper shape in the component footprint, may be associated with pad IDs |
|
Component area (placement, keepout, no-tracks, no-vias constraints) |
|
Dimension annotations within the component |
Pad Side
| Keyword | Description |
|---|---|
|
Physical layer 1 (front/top), used for SMD |
|
Highest physical layer (back/bottom), used for SMD |
|
All physical layers, through-hole |
Component Types
The SYMDEF type is inferred from the reference name:
| Type | Recognition Rule |
|---|---|
|
Standard component (default) |
|
Reference name starts with |
|
Reference name starts with |
|
Reference name equals |
Components (Instances)
(COMPONENT "C1" "R1" "P1" "SD1"
(PT 500000 300000)
(ORIENT 900000)
(MIRROR)
(TEXTLOC ...)
(ATTR ...)
(PINLABEL ...)
(PINATTR ...)
(PADEXCEPTION ...)
)
| Field | Description |
|---|---|
|
COMPONENT_ID |
|
Designator (e.g. "R1") |
|
PART_ID |
|
SYMDEF_ID |
|
Placement origin |
|
Orientation angle (1/1000 degree) |
|
Present if component is mirrored |
|
Present if component is a testpoint |
|
Attribute display locations |
|
Per-pin label overrides (may differ from parts library) |
|
Per-pin attributes and testland side |
|
Per-instance pad code, exit, side, or orientation overrides |
Nets (PCB)
PCB nets contain richer routing data than schematic nets:
| Node | ID Prefix | Description |
|---|---|---|
|
|
Pad in a PCB component: COMPONENT_ID + PAD_ID |
|
|
Junction point with optional TRUNKREF |
|
|
Via instance: VIACODE_ID + LAYERPAIR_ID + location |
|
|
Copper terminal: COPPER_ID + terminal number |
|
— |
Connection between two net elements, containing a ROUTE or UNROUTE |
Routes
(CONN "P1" "P2" "RC1"
(ROUTE "LAY1"
(PT 100000 200000)
(ROUTEWIDTH 25000)
(PT 100000 300000)
(ROUTEWIDTH 15000)
(CWARC
(PT 110000 310000)
(PT 120000 300000)
)
)
)
A ROUTE contains an initial layer, a start point, and a sequence of route vertices.
Each vertex is preceded by a ROUTEWIDTH node that sets the track width for that
segment. Width can change along a single route.
Route vertices may include TDSTART / TDEND (teardrop at start/end) and FIXED
flags.
An UNROUTE token (instead of ROUTE) with a layer ID indicates a connection via a
power plane layer rather than an explicit track.
Templates (Copper Pour Zones)
Templates define the rules for copper pour and are linked to poured copper shapes:
(TEMPLATE "T1" "LC1" "GND_POUR" "N1" "LAY1"
(POURING "CC1" "CC2"
(CLEARANCE 20000)
(SLIVERWIDTH 10000)
(ADDITIONALISO 5000)
(RELIEFPADSANG 450000)
(RELIEFVIASANG 450000)
(FILLED)
(REGENERATE)
)
(OUTLINE ...)
)
| Pouring Parameter | Description |
|---|---|
|
Copper code for outline/fill |
|
Relief copper code for thermal reliefs |
|
Thermal relief clearance around pads |
|
Minimum copper sliver width |
|
Additional isolation beyond spacing rules |
|
Thermal relief orientation for pads |
|
Thermal relief orientation for vias |
|
Minimum isolated copper island size |
|
Minimum disjoint copper island size |
|
Disable thermal relief on pads |
|
Disable thermal relief on vias |
|
Allow copper in no-routing areas |
|
Box isolated pins |
|
Automatic repour on changes |
|
Target for auto-router |
|
Fill type (hatched requires HATCHCODE_ID) |
|
Relief generation method |
Copper Objects
COPPER nodes represent the actual poured copper shapes, linked back to templates:
(COPPER "COP1" "CC1" "LAY1"
(NETREF "N1"
(COPPERTERM 1 (PT 100000 200000))
(COPPERTERM 2 (PT 300000 200000))
)
(SOLID ...)
(POUREDTEMPLATEREF "T1")
)
Board Outlines
(BOARD "B1" "LC1"
(OUTLINE
(PT 0 0)
(PT 1000000 0)
(PT 1000000 500000)
(PT 0 500000)
(PT 0 0)
)
)
Areas
Areas define placement, routing, and keepout regions:
(AREA "A1" "LC1" "Placement Area" "LAY1"
(OUTLINE ...)
(PLACEMENT)
(ROUTING)
(KEEPOUT)
(NOTRACKS)
(NOVIAS)
(AREAHEIGHT 500000)
(RULESETREF "RS1")
)
Dimensions
Three dimension types are supported: LINEARDIM, LEADERDIM, and ANGLEDIM. Each
contains an arrow definition, text format, extension lines, and a measurement line.
Subtypes include: DIMENSION_ORTHOGONAL, DIMENSION_DIRECT, DIMENSION_ANGLED,
DIMENSION_DIAMETER, DIMENSION_RADIUS, DIMENSION_ANGULAR.
Parts
The PARTS node is common to both schematic and PCB archives and maps part definitions
to symbol/footprint references with pin-level detail.
(PART "P1" "RES_100K" 1
(PARTDEFINITION "RES_100K"
(GATEDEFINITION "A" "RESISTOR" "" 2)
(PARTDEFINITIONPIN 1
(PINIDENTIFIER "1")
(PINNAME "1")
(PINLABEL "~")
(PINTERM "A" 1)
(PINTYPE "UNCOMMITTED")
(PINPOSITION 0)
)
(PARTDEFINITIONPIN 2
(PINIDENTIFIER "2")
(PINNAME "2")
(PINLABEL "~")
(PINTERM "A" 2)
)
(PINEQUIVALENCE 1 2)
(SWAPGROUP ...)
(HIDEPINNAMES)
)
(PARTPIN 1 ...)
(PARTPIN 2 ...)
)
Part Definition
| Field | Description |
|---|---|
|
Gate: |
|
Pin: |
|
List of swappable pin IDs |
|
Gate swap group with swap gates |
|
Do not display pin names on the schematic symbol |
|
Maximum electrical pin count |
Pin Types
| Keyword | Description |
|---|---|
|
Default, uncommitted |
|
Input pin |
|
Output, OR-tieable |
|
Output, not OR-tieable |
|
Output, not normally OR-tieable |
|
Power pin |
|
Ground pin |
|
Tristate bidirectional |
|
Tristate input |
|
Tristate output |
Pin Name Position
| Value | Quadrant |
|---|---|
|
Top right (default) |
|
Top left |
|
Bottom left |
|
Bottom right |
Parts Library Format (.lib)
The .lib file uses a line-oriented text format distinct from the archive
S-expression format. It is parsed using a
PEGTL (Parsing Expression Grammar Template Library)
grammar defined in cadstar_parts_lib_grammar.h.
File Structure
# FORMAT 32
+N0 'root' 'part1' 'part2'
+N1 N0 'subnode1' 'part3'
.RESISTOR_100K (1234):1 ;100K 1% Resistor
RES_0805 (RES_ALT)
*VALUE 100K
*DFN RES_100K
*STM R
*PNM 1=A1 2=A2
*PLB 1=~ 2=~
*EQU 1=2
$Param1(Value1)
%PCBattr(AttrVal)
@SharedAttr(BothVal)
~LibAttr(SearchVal)
RESISTOR
1.0 2.0
/VCC 3.0
.END
FORMAT Header
The first line may contain # FORMAT 32 specifying the file format version. Some
older files omit this and begin directly with part definitions.
Hierarchy Nodes
Lines beginning with + define a tree-structured hierarchy for organizing parts:
+N<index> [N<parent_index>] '<node_name>' ['<part_name>' ...]
The & character at end of line indicates line continuation.
Part Entry Structure
Each part begins with a header line starting with .:
.<Part Name>[ (<Part Number>)][:<Part Version>][;<Description>]
The grammar for a complete part entry:
| Line Prefix | Description |
|---|---|
|
Part header with name, optional number/version/description |
(no prefix) |
PCB component reference name, optional alternate in parentheses |
|
Part value string |
|
Part definition name |
|
No gate swapping allowed |
|
Pins not visible |
|
Component name stem (reference designator prefix) |
|
Maximum pin count |
|
SPICE model reference |
|
Part acceptance text |
|
Pin names: |
|
Pin labels: |
|
Pin equivalences: |
|
Swap group element name |
|
Internal swap gate: list of pin IDs |
|
External swap gate: list of pin IDs |
|
User-defined attribute (ignored by CADSTAR, used by third-party tools) |
|
Schematic attribute: |
|
PCB attribute: |
|
Schematic+PCB attribute: |
|
Parts library attribute: |
After the attribute lines, symbol entries list the schematic symbol references and their pin assignments:
<Symbol Refname>[ (<Alternate>)]
<PinID>.<Position>[!<PinType>][:<Loading>] [...]
Hidden pins (power/ground connections) follow the symbol entries:
/<SignalName> <PinID>.<Position>[!<PinType>][:<Loading>] [...]
Pin Entry Fields
Each pin entry in the symbol section has the format <ID>.<Position>[!<Type>][:<Load>]:
| Field | Description |
|---|---|
ID |
Pin identifier (integer) |
Position |
Quadrant 0-3 for pin name placement |
Type |
Optional pin electrical type (alpha characters) |
Load |
Optional electrical loading value (integer) |
PEGTL Grammar Overview
The parser uses PEGTL grammar rules. Key non-terminals:
| Rule | Purpose |
|---|---|
|
Top-level: optional FORMAT, hierarchy nodes, part entries, optional |
|
Complete part: header, PCB component, attributes, symbols, hidden pins |
|
|
|
Symbol reference name + pin list |
|
|
|
|
|
File validation: FORMAT line or part header within first 5 lines |
Line continuation with & at end of line is supported throughout. The ? character
in *VALUE fields represents a newline within the value string.
Common Data Types
Text Fields
CADSTAR text objects support embedded field tokens in the format
<@[FIELD_NAME][FIELD_VALUE]@>. Known field names:
| CADSTAR Field | KiCad Variable |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mapped to |
|
Stored but not rendered (KiCad lacks hyperlink support) |
Text Alignment
| Value | Description |
|---|---|
|
Legacy default; behaves as bottom-left of first line in most cases |
|
Top left of text block |
|
Top center |
|
Top right |
|
Center left |
|
Center center |
|
Center right |
|
Bottom left of entire text block |
|
Bottom center |
|
Bottom right |
Justification
Multiline text justification (no effect on single-line text):
-
LEFT -
CENTER -
RIGHT
Readability
Text readability direction for vertical text:
-
BOTTOM_TO_TOP— rotated 90 degrees anticlockwise (default) -
TOP_TO_BOTTOM— rotated 90 degrees clockwise
Line Styles
| Keyword | Style |
|---|---|
|
Solid line |
|
Dashed |
|
Dash-dot |
|
Dash-dot-dot (maps to DASHDOT on import) |
|
Dotted |
Swap Rules
The swap rule controls visibility based on component mirror state:
| Value | Description |
|---|---|
|
Display when unmirrored |
|
Display when mirrored |
|
Always display (default) |
Internal Attribute Names
Attribute names enclosed in parentheses are internal CADSTAR attributes. Known
internal names include (PartDescription) and (PartDefinitionNameStem). A complete
list has not been documented.
Attributes can be prefixed with `Link ` (including the trailing space) to convert a Part Definition Attribute into a hyperlink.
Font System
CADSTAR fonts are rendered on a 24x24 integer matrix. Character widths range from 12
to 24 units; height is fixed at 24. The default font uses y=5 as the baseline offset
for capital letters, leaving space for descenders. The text height ratio used for
conversion is (24 - 5) / 24 = 0.7917.
Font weight constants: 400 = normal, 700 = bold.
Variant Hierarchy
Both archive types contain a VHIERARCHY node within the design section that defines
variant relationships. The master variant uses the VMASTER node; derived variants
use VARIANT with a parent reference:
(VHIERARCHY
(VMASTER "V0" "Master" "Base design")
(VARIANT "V1" "V0" "Test Variant" "For testing")
)
Schematic Import
Imported Elements
-
Multi-sheet schematics with hierarchical structure (parent/child sheets and blocks)
-
Symbol definitions with terminals, pin labels, and pin numbers
-
Component instances with reference designators, part references, and attributes
-
Nets with wires, junctions, buses, bus terminals, and block terminals
-
Figures (graphical shapes with solid, dashed, and dotted line styles)
-
Text elements with text code formatting
-
Documentation symbols, signal references, and symbol variants
-
Symbol scaling with arbitrary numerator/denominator
-
Text variables and design fields
-
Imported symbols saved to a KiCad project library
Limitations
-
Pin and gate swap data is not loaded.
-
Multi-line fields are not supported; a workaround annotation is added.
-
DASHDOTDOTline style maps toDASHDOT. -
Independent text justification is not supported.
-
The importer is read-only.
PCB Import
Imported Elements
-
Board stackup with layer mapping through an interactive dialog
-
Material properties (permittivity, loss tangent)
-
Component library footprints with pads, copper, areas, and figures
-
Component placement with orientation and mirroring
-
Pad shapes (annulus, bullet, circle, diamond, finger, octagon, rectangle, rounded rectangle, square) with drill, slot, and layer side properties
-
Via definitions with drill and shape, layer pairs
-
Net routing with tracks and route vertices, including width changes along routes
-
Copper pour zones from templates with thermal relief, hatching, and fill settings
-
Board outlines
-
Rule areas (placement, routing, keepout, no-tracks, no-vias)
-
Design rules (spacing codes with per-layer reassignments)
-
Dimensions (linear, leader)
-
Text elements with font settings
-
Net classes and spacing classes
-
Drill tables and text variables
Limitations
-
CADSTAR
COPPERobjects load as graphical polygons without net association. -
Teardrops are parsed but not imported.
-
Per-layer pad shape overrides and custom padstacks are not fully handled.
-
Radius and diameter dimensions load as leader dimensions; angular dimensions are not imported.
-
Placement areas, board attributes, reuse blocks, and swap rules are not processed.
-
Only a subset of CADSTAR design rules is imported.
-
Material resistivity is not loaded.
Undocumented Areas
Several parts of the CADSTAR format remain incompletely understood:
-
TRUNK structure — The
TRUNKnode in the PCB layout is parsed but its internal structure beyond the ID and a definition string is not fully decoded. Trunks appear to define bus-like routing constructs. Junctions and vias reference them throughTRUNKREF. -
SYMBOLVARIANT types — The schematic
SYMBOLVARIANTnode supportsGLOBALSIGNAL,SIGNALREF, andTESTPOINTtypes. Additional variant types may exist. -
Internal attribute names — Attributes with names in parentheses (e.g.
(PartDescription)) are internal CADSTAR attributes. The full set of internal attribute names is unknown. -
Resolution variants — Only
METRIC HUNDREDTH MICRONresolution has been observed. Other base units (e.g., imperial) may exist but have not been encountered. -
DEFAULTS and DISPLAY sections — These contain CADSTAR configuration data (default shapes, text settings, layer colors, element visibility) that is not currently parsed for import. Future work could extract useful defaults from these sections.
-
Reuse blocks — The
REUSEBLOCKstructure stores references to external.pcbfiles for design reuse. The importer records these but does not resolve or load the referenced files.