KiCad PCB EDA Suite
Loading...
Searching...
No Matches
allegro_pcb_structs.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright Quilter
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/gpl-3.0.html
20 * or you may search the http://www.gnu.org website for the version 3 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#pragma once
26
27#include "string_any_map.h"
28
29
30#include <array>
31#include <concepts>
32#include <cstdint>
33#include <optional>
34#include <memory>
35#include <stdexcept>
36#include <string>
37#include <unordered_map>
38#include <variant>
39#include <vector>
40
41
42namespace ALLEGRO
43{
44
55{
56public:
57 BLOCK_BASE( uint8_t aBlockType, size_t aOffset ) :
58 m_blockType( aBlockType ),
59 m_offset( aOffset ),
60 m_Key( 0 ), // Key and next are set later, during parse
61 m_Next( 0 )
62 {
63 }
64
65 virtual ~BLOCK_BASE() = default;
66
72 uint8_t GetBlockType() const { return m_blockType; }
73 size_t GetOffset() const { return m_offset; }
74
75 // Unique object identifier for this block, or 0 if it has none.
76 uint32_t GetKey() const { return m_Key; }
77 // Object key of the next block in this block's primary linked-list, or 0.
78 uint32_t GetNext() const { return m_Next; }
79
80 void SetKey( uint32_t aKey ) { m_Key = aKey; }
81 void SetNext( uint32_t aNext ) { m_Next = aNext; }
82
83private:
84 uint8_t m_blockType;
85 size_t m_offset;
86 uint32_t m_Key;
87 uint32_t m_Next;
88};
89
90
94template <typename T>
95concept HAS_BLOCK_TYPE_CODE = requires
96{
97 T::BLOCK_TYPE_CODE;
98};
99
100
101template <typename T>
102class BLOCK : public BLOCK_BASE
103{
104public:
106 explicit BLOCK( size_t aOffset ) requires HAS_BLOCK_TYPE_CODE<T>
107 : BLOCK_BASE( T::BLOCK_TYPE_CODE, aOffset )
108 {
109 }
110
112 BLOCK( uint8_t aBlockType, size_t aOffset ) :
113 BLOCK_BASE( aBlockType, aOffset )
114 {
115 }
116
117 const T& GetData() const { return m_data; }
118 T& GetData() { return m_data; }
119
120private:
122};
123
124
135enum class FMT_VER
136{
138 V_PRE_V16, // Allegro versions before 16.0 (unsupported binary format)
139 V_160, // Allegro 16.0, 0x00130000
140 V_162, // Allegro 16.2 0x00130400
141 V_164, // Allegro 16.4, 0x00130C00
142 V_165, // Allegro 16.5, 0x00131000
143 V_166, // Allegro 16.6, 0x00131500
144 V_172, // Allegro 17.2, 0x00140400
145 V_174, // Allegro 17.4, 0x00140900
146 V_175, // Allegro 17.5, 0x00141500
147 V_180, // Allegro 18.0, 0x00150000
148};
149
150constexpr bool operator>=( FMT_VER lhs, FMT_VER rhs )
151{
152 return static_cast<uint32_t>( lhs ) >= static_cast<uint32_t>( rhs );
153}
154
155
159template <typename P>
160concept FMT_VER_PREDICATE = requires( P p, FMT_VER v )
161{
162 { p( v ) }->std::convertible_to<bool>;
163};
164
165
170template <FMT_VER_PREDICATE auto Pred, typename T>
172{
173 using value_type = T;
174
175 static constexpr bool exists( FMT_VER aVer ) { return Pred( aVer ); }
176
177 // Access to the value (use std::optional-like semantics)
178 T& value() { return *m_Value; }
179 const T& value() const { return *m_Value; }
180 bool has_value() const { return m_Value.has_value(); }
181
182 const T& value_or( const T& aDefault ) const { return has_value() ? value() : aDefault; }
183
184 T& operator*() { return *m_Value; }
185 const T& operator*() const { return *m_Value; }
186
187 T* operator->() { return &m_Value.value(); }
188 const T* operator->() const { return &*m_Value; }
189
190 // Assignment operator
191 COND_FIELD& operator=( const T& aValue )
192 {
193 m_Value = aValue;
194 return *this;
195 }
196
197 COND_FIELD& operator=( T&& aValue )
198 {
199 m_Value = std::move( aValue );
200 return *this;
201 }
202
203private:
204 std::optional<T> m_Value;
205};
206
207
208// Predicate functors
209
210template <FMT_VER Min>
211struct VER_GE
212{
213 constexpr bool operator()( FMT_VER v ) const { return v >= Min; }
214};
215
216template <FMT_VER Max>
217struct VER_LT
218{
219 constexpr bool operator()( FMT_VER v ) const { return v < Max; }
220};
221
222template <FMT_VER Min, FMT_VER Max>
224{
225 constexpr bool operator()( FMT_VER v ) const { return v >= Min && v < Max; }
226};
227
228
229// Useful aliases for common cases
230
232template <FMT_VER Min, typename T>
234
236template <FMT_VER Max, typename T>
238
240template <FMT_VER Min, FMT_VER Max, typename T>
242
246template <typename T>
247concept VERSIONED_COND_FIELD = requires( FMT_VER v )
248{
249 { T::exists( v ) }->std::convertible_to<bool>;
250 typename T::value_type;
251};
252
253
255{
256 MILS = 0x01,
257 INCHES = 0x02,
261};
262
263
272{
274 {
275 uint32_t m_A;
277 };
278
285 {
286 uint32_t m_Tail;
287 uint32_t m_Head;
288 };
289
290 uint32_t m_Magic;
291
292 uint32_t m_Unknown1a; // 0x03
293 uint32_t m_FileRole; // 0x01 (.brd) or 0x02 (.dra) (?)
294 uint32_t m_Unknown1b; // 0x03
295 uint32_t m_WriterProgram; // 0x09 (Allegro) or 0x130000 (DB Doctor) (?)
296
298
299 uint32_t m_UnknownMagic; // This is always 0x000a0d0a?
300 uint32_t m_UnknownFlags; // This looks like flags: 0x01000000, 0x0400000, 0x06000000
301
302 // In this block of 7 uint32s, it seems they have very different meanings pre and post v18
303
304 // Pre v18, these are all unknown
305 // - 3 and 4 are the same.
306 // - 5 and 6 arer of a similar size
308
309 // V18
310 COND_GE<FMT_VER::V_180, uint32_t> m_Unknown2a_V18; // Looks like an 'end pointer' like 0x27_end
317
318 // V180 has 6 additional linked lists in the header
319 // 5 of them are at the start
325
326 // Linked lists grouping top-level elements by type
327 LINKED_LIST m_LL_0x04; // Net assignments
328 LINKED_LIST m_LL_0x06; // Component definitions
329 LINKED_LIST m_LL_0x0C; // Pin definitions
330 LINKED_LIST m_LL_Shapes; // Shape segments (0x0E) and shapes (0x28)
333 LINKED_LIST m_LL_0x1C; // Padstacks
334 LINKED_LIST m_LL_0x24_0x28; // Rects and shapes
336 LINKED_LIST m_LL_0x2B; // Footprint definitions
337 LINKED_LIST m_LL_0x03_0x30; // Fields (0x03) and string wrappers (0x30)
338 LINKED_LIST m_LL_0x0A; // DRC elements
339 LINKED_LIST m_LL_0x1D_0x1E_0x1F; // Constraint sets, SI models, padstack dims
343 LINKED_LIST m_LL_0x0C_2; // Secondary pin definitions
345
346 // For some reason the 0x35 extents are recorded in the header
349
353
356
358
360
363
364 // Fixed length string field
365 std::array<char, 60> m_AllegroVersion;
366
367 uint32_t m_Unknown4;
368
369 uint32_t m_MaxKey;
370
373
375 // 3 empty bytes here?
376
377 uint32_t m_Unknown6;
379
380 // The end of the 0x27 object(?)
381 // In V18, this is relocated to m_0x27_End_V18
383
384 uint32_t m_Unknown8;
385
387
388 std::array<uint32_t, 50> m_Unknown9;
389
390 uint32_t m_Unknown10a; // Often 0x000500FF
391 uint32_t m_Unknown10b; // Similar to 0xFFA60000
392 uint32_t m_Unknown10c; // Usually 0x01
393
394 // E.g. 1000 for mils
396
403 std::array<LAYER_MAP_ENTRY, 25> m_LayerMap;
404
405 uint32_t GetStringsCount() const
406 {
407 if( m_StringCount_V18.has_value() )
408 return m_StringCount_V18.value();
409
410 return m_StringCount_preV18.value();
411 }
412
413 uint32_t Get_0x27_End() const
414 {
415 if( m_0x27_End_V18.has_value() )
416 return m_0x27_End_V18.value();
417
418 return m_0x27_End_preV18.value();
419 }
420
422 {
423 if( m_LL_Unknown5_V18.has_value() )
424 return m_LL_Unknown5_V18.value();
425
426 return m_LL_Unknown5_preV18.value();
427 }
428};
429
430
432{
458
465 {
466 // BOARD_GEOMETRY
467 // BGEOM_PASTEMASK_BOTTOM = 0x??
468 // BGEOM_PASTEMASK_TOP = 0x??
489
490 // COMPONENT_VALUE / DEVICE_TYPE / USER_PART_NUMBER
491 // REF_DES / TOLERANCE
498
499 // ANALYSIS
506
507 // DRAWING_FORMAT
513
514 // PACKAGE_GEOMETRY
532
533 // MANUFACTURING
548
549 // CONSTRAINTS_REGION
550 CREG_ALL = 0xFD,
551
552 // PACKAGE_KEEPIN / ROUTE_KEEPIN
554
555 // PACKAGE_KEEPOUT / ROUTE_KEEPOUT / VIA_KEEPOUT
559 };
560
561 uint8_t m_Class;
562 uint8_t m_Subclass;
563
564 bool operator==( const LAYER_INFO& ) const = default;
565};
566
567
574{
575 static constexpr uint8_t BLOCK_TYPE_CODE = 0x01;
576
578 uint8_t m_SubType;
579 uint32_t m_Key;
580 uint32_t m_Next;
581 uint32_t m_Parent;
582 uint32_t m_Unknown1;
583
585
586 uint32_t m_Width;
587
588 int32_t m_StartX;
589 int32_t m_StartY;
590 int32_t m_EndX;
591 int32_t m_EndY;
592
593 double m_CenterX; // Center
594 double m_CenterY;
595 double m_Radius;
596
597 std::array<int32_t, 4> m_BoundingBoxCoords;
598};
599
600
606{
607 static constexpr uint8_t BLOCK_TYPE_CODE = 0x03;
608
609 struct SUB_0x6C
610 {
611 uint32_t m_NumEntries;
612 std::vector<uint32_t> m_Entries;
613 };
614
616 {
617 uint16_t m_X0;
618 uint16_t m_X1;
619 std::vector<uint32_t> m_Entries;
620 };
621
622 struct SUB_0xF6
623 {
624 std::array<uint32_t, 20> m_Entries;
625 };
626
627 uint16_t m_Hdr1;
628
629 uint32_t m_Key;
630 uint32_t m_Next;
631
632
634
635 uint8_t m_SubType;
636 uint8_t m_Hdr2;
637 uint16_t m_Size;
638
640
641 std::variant<uint32_t, std::array<uint32_t, 2>, std::string, SUB_0x6C, SUB_0x70_0x74, SUB_0xF6> m_Substruct;
642};
643
657
658
665{
666 static constexpr uint8_t BLOCK_TYPE_CODE = 0x04;
667
668 uint8_t m_Type;
669 uint16_t m_R;
670 uint32_t m_Key;
671 uint32_t m_Next;
672 uint32_t m_Net;
673 uint32_t m_ConnItem;
674
676};
677
678
709
710
716{
717 static constexpr uint8_t BLOCK_TYPE_CODE = 0x06;
718
719 uint32_t m_Key;
720
721 // Pointer to the next BLK_0x06_COMPONENT
722 uint32_t m_Next;
723 // Pointer to COMP_DEVICE_TYPE string
725 // Pointer to SYM_NAME string
726 uint32_t m_SymbolName;
727 // Points to 0x07, first instance
729 // Points to 0x0F, function slot
731 // Points to 0x08, pin number
733
734 // Points to 0x03, first 'field'
735 uint32_t m_Fields;
736
738};
739
740
768
769
776{
777 static constexpr uint8_t BLOCK_TYPE_CODE = 0x08;
778
779 uint8_t m_Type;
780 uint16_t m_R;
781 uint32_t m_Key;
782
785
786 uint32_t m_Next;
787
789
791 uint32_t m_PinNamePtr;
792
794
795 uint32_t m_Ptr4;
796
797 uint32_t GetStrPtr() const
798 {
799 return m_StrPtr.value_or( m_StrPtr16x.value_or( 0 ) );
800 }
801};
802
803
809{
810 static constexpr uint8_t BLOCK_TYPE_CODE = 0x09;
811
812 uint32_t m_Key;
813
814 std::array<uint32_t, 4> m_UnknownArray;
815
817
820 uint32_t m_Unknown2;
823
825};
826
827
832{
833 static constexpr uint8_t BLOCK_TYPE_CODE = 0x0A;
834
835 uint8_t m_T;
837 uint32_t m_Key;
838 uint32_t m_Next;
839 uint32_t m_Unknown1;
840
842
843 std::array<int32_t, 4> m_Coords;
844 std::array<uint32_t, 4> m_Unknown4;
845 std::array<uint32_t, 5> m_Unknown5;
846
848};
849
850
856{
857 static constexpr uint8_t BLOCK_TYPE_CODE = 0x0C;
858
860 {
861 // These are in the same order as the pad shapes, at least for the 'simple' shapes
862 CIRCLE = 0x02,
863 OCTAGON = 0x03,
864 CROSS = 0x04,
865 SQUARE = 0x05,
866 RECTANGLE = 0x06,
867 DIAMOND = 0x07,
868 PENTAGON = 0x0a,
869 OBLONG_X = 0x0b,
870 OBLONG_Y = 0x0c,
871 HEXAGON_X = 0x0f,
872 HEXAGON_Y = 0x10,
873 TRIANGLE = 0x12,
874 };
875
876 uint8_t m_T;
878 uint32_t m_Key;
879 uint32_t m_Next;
880
881 uint32_t m_Unknown1;
882 uint32_t m_Unknown2;
883
887
891
892 uint32_t m_Unknown4;
893
895
896 std::array<int32_t, 2> m_Coords;
897 std::array<int32_t, 2> m_Size;
898
899 uint32_t m_GroupPtr;
900 uint32_t m_Unknown6;
901 uint32_t m_Unknown7;
902
904
905 uint32_t GetShape() const
906 {
907 return m_Shape16x.value_or( m_Shape.value_or( 0 ) );
908 }
909};
910
911
918{
919 static constexpr uint8_t BLOCK_TYPE_CODE = 0x0D;
920
921 uint32_t m_Key;
922 uint32_t m_NameStrId;
923 uint32_t m_Next;
924
926
927 int32_t m_CoordsX;
928 int32_t m_CoordsY;
929
930 uint32_t m_PadStack;
931 uint32_t m_Unknown2;
932
934
935 uint32_t m_Flags;
936 uint32_t m_Rotation;
937};
938
939
944{
945 static constexpr uint8_t BLOCK_TYPE_CODE = 0x0E;
946
947 uint8_t m_T;
949 uint32_t m_Key;
950 uint32_t m_Next;
951 uint32_t m_FpPtr;
952
953 uint32_t m_Unknown1;
954 uint32_t m_Unknown2;
955 uint32_t m_Unknown3;
956
959
960 std::array<int32_t, 4> m_Coords;
961
962 std::array<uint32_t, 3> m_UnknownArr;
964 uint32_t m_Rotation;
965};
966
967
974{
975 static constexpr uint8_t BLOCK_TYPE_CODE = 0x0F;
976
977 uint32_t m_Key;
978
979 uint32_t m_SlotName;
980
982
983 std::array<char, 32> m_CompDeviceType;
984
986
987 uint32_t m_Ptr0x06;
988 uint32_t m_Ptr0x11;
989
990 uint32_t m_Unknown2;
991
992 std::string GetCompDeviceTypeStr() const
993 {
994 // The string is stored as a fixed-length array, but is null-terminated
995 return std::string( m_CompDeviceType.data(), strnlen( m_CompDeviceType.data(), m_CompDeviceType.size() ) );
996 }
997};
998
999
1006{
1007 static constexpr uint8_t BLOCK_TYPE_CODE = 0x10;
1008
1009 uint32_t m_Key;
1010
1012
1014
1016
1017 uint32_t m_PtrX12;
1018 uint32_t m_Unknown3;
1020 uint32_t m_Slots; // 0x0F?
1021 uint32_t m_Fields; // Presumably a pointer to a string
1022};
1023
1024
1030{
1031 static constexpr uint8_t BLOCK_TYPE_CODE = 0x11;
1032
1033 uint8_t m_Type;
1034 uint16_t m_R;
1035 uint32_t m_Key;
1039 uint32_t m_Next;
1042 uint32_t m_Unknown1;
1043
1045};
1046
1047
1053{
1054 static constexpr uint8_t BLOCK_TYPE_CODE = 0x12;
1055
1056 uint8_t m_Type;
1057 uint16_t m_R;
1058 uint32_t m_Key;
1059 uint32_t m_Ptr1;
1060 uint32_t m_Ptr2;
1061 uint32_t m_Ptr3;
1062 uint32_t m_Unknown1;
1063
1066};
1067
1068
1075{
1076 static constexpr uint8_t BLOCK_TYPE_CODE = 0x14;
1077
1078 uint8_t m_Type;
1080 uint32_t m_Key;
1081 uint32_t m_Next;
1082 uint32_t m_Parent;
1083 uint32_t m_Flags;
1084
1086
1088 uint32_t m_Ptr0x03;
1089 uint32_t m_Ptr0x26;
1090};
1091
1092
1101{
1102 // Segments can be one of 3 codes, so we don't have a BLOCK_TYPE_CODE constant
1103 // for this struct.
1104
1105 uint32_t m_Key;
1106 uint32_t m_Next;
1107 uint32_t m_Parent;
1108 uint32_t m_Flags;
1109
1111
1112 uint32_t m_Width;
1113
1114 int32_t m_StartX;
1115 int32_t m_StartY;
1116 int32_t m_EndX;
1117 int32_t m_EndY;
1118};
1119
1126{
1127 static constexpr uint8_t BLOCK_TYPE_CODE = 0x1B;
1128
1129 uint32_t m_Key;
1130 uint32_t m_Next;
1131 uint32_t m_NetName;
1132
1133 uint32_t m_Unknown1;
1134
1136
1137 uint32_t m_Type;
1138
1140 uint32_t m_Ratline;
1142 uint32_t m_FieldsPtr;
1144 uint32_t m_ModelPtr;
1148};
1149
1150
1164
1165
1171{
1195
1196 uint8_t m_Type;
1200
1202
1203 // Pad size
1204 int32_t m_W;
1205 int32_t m_H;
1206
1207 // In rounded rectangles, this is the corner radius.
1208 // In chamfered rectangles, this is the chamfer size.
1210
1211 // This is the pad component offset
1212 int32_t m_X3;
1213 int32_t m_X4;
1214
1221 uint32_t m_StrPtr;
1222
1223 // In versions < 17.2, seems to be not present in the last entry.
1224 std::optional<uint32_t> m_Z2;
1225};
1226
1227
1236{
1237 static constexpr uint8_t BLOCK_TYPE_CODE = 0x1C;
1238
1240 {
1245 {
1247 // NPTHs seem to have this instead of 0x01
1248 // SMDs seems to have this or 0x01, no clear pattern identified
1250 };
1251
1252 uint32_t m_DrillSize;
1256 // Not sure these are in the right place but they're in here somewhere (usually zero)
1259
1260 // Drill char presumably somewhere in here - can cross-match with 0x0C PIN_DEF to find
1262 // Mask or enum of pad flags, including plating
1263 uint8_t m_Flags;
1264 // An ASCII char, or 0x00
1266 uint8_t m_D;
1267
1268 // Probably some kind of type:
1269 // 0x0000 for through-hole
1270 // 0x0002 for SMD
1271 // 0x0400 for slots
1272 uint16_t m_Unknown_1;
1273
1274 uint16_t m_ArrayNX;
1275 uint16_t m_ArrayNY;
1276
1278 // Also unsure if these are in the right place (all usually 0?)
1281
1284 uint32_t m_Unknown_2;
1285 uint32_t m_SlotX;
1286 uint32_t m_SlotY;
1287 uint32_t m_Unknown_3;
1288
1290 };
1291
1293 {
1298 {
1299 // Some through-holes have this, some don't
1302 };
1303
1304 // Presumably the same as the one in the v16x header
1306 uint32_t m_Unknown1; // 0?
1307 uint32_t m_Unknown2; // 0?
1308
1310
1311 // Not sure if this is really a substruct
1312 uint8_t m_A; // Only lower 4 bits (top 4 are type)
1313 uint8_t m_B;
1315 uint8_t m_Flags;
1316 uint8_t m_D;
1317
1318 uint32_t m_unknown3; // 1?
1319 uint32_t m_Unknown4; // 0?
1320
1321 uint16_t m_ArrayNX;
1322 uint16_t m_ArrayNY;
1324 uint16_t m_Unknown5; // 0?
1325
1326 // Again, these are tentatively placed, they're always zero so far,
1327 // so it's hard to say where they go.
1328 // Assuming they follow the v16x layout and come after the layer count
1331 uint32_t m_Unknown6a;
1332 uint32_t m_Unknown6b;
1333
1334 uint32_t m_DrillSize;
1337 uint32_t m_SlotX;
1338 uint32_t m_SlotY;
1339 uint32_t m_ToleranceTravelPos; // "TOLERANCE_TRAVEL" in BeagleBone_Black drill table
1341
1345 uint32_t m_DrillChars; // Presumably 4 drill chars
1346
1347 // Probably holds secondary drill parameters and other new V17.2 features
1348 std::array<uint32_t, 21> m_UnknownArr3;
1349
1350 // To check - this could be another component?
1352 };
1353
1355
1359 uint8_t m_N;
1361 uint32_t m_Key;
1362 uint32_t m_Next;
1363
1364 // The name of the padstack
1365 uint32_t m_PadStr;
1366
1367 // The header fields are very different between v16x and v17.x+
1368 using HEADER = std::variant<HEADER_v16x, HEADER_v17x>;
1370
1396 {
1397 // V<172 verified slots
1401
1402 // V>=172 verified slots
1404 };
1405
1411 {
1412 // First slot: Antipad
1414 // Thermal relief shape
1416 // Pad shape
1417 PAD = 2,
1418 // Unsure what this layer component slot is
1419 // But I suspect it's keepout, as that was added in V172.
1421 };
1422
1435 std::vector<PADSTACK_COMPONENT> m_Components;
1436
1442
1449 std::vector<uint32_t> m_UnknownArrN;
1450
1451
1452 // Dispatch common properties to the header variant.
1453 // Each method uses a local Visitor struct so that adding a new HEADER alternative
1454 // produces a compile error rather than a silent runtime fallback.
1455 uint32_t GetDrillSize() const
1456 {
1457 struct Visitor
1458 {
1459 uint32_t operator()( const HEADER_v16x& h ) const { return h.m_DrillSize; }
1460 uint32_t operator()( const HEADER_v17x& h ) const { return h.m_DrillSize; }
1461 };
1462 return std::visit( Visitor{}, m_Header );
1463 }
1464
1465 uint32_t GetLayerCount() const
1466 {
1467 struct Visitor
1468 {
1469 uint32_t operator()( const HEADER_v16x& h ) const { return h.m_LayerCount; }
1470 uint32_t operator()( const HEADER_v17x& h ) const { return h.m_LayerCount; }
1471 };
1472 return std::visit( Visitor{}, m_Header );
1473 }
1474
1475 bool IsPlated() const
1476 {
1477 struct Visitor
1478 {
1479 bool operator()( const HEADER_v16x& h ) const
1480 {
1481 return ( h.m_Flags & HEADER_v16x::PAD_FLAGS::FLAG_PLATED ) != 0;
1482 }
1483 bool operator()( const HEADER_v17x& h ) const
1484 {
1485 return ( h.m_Flags & HEADER_v17x::PAD_FLAGS::FLAG_PLATED ) != 0;
1486 }
1487 };
1488 return std::visit( Visitor{}, m_Header );
1489 }
1490};
1491
1492
1497{
1498 static constexpr uint8_t BLOCK_TYPE_CODE = 0x1D;
1499
1500 uint32_t m_Key;
1501 uint32_t m_Next;
1502 uint32_t m_NameStrKey;
1503 uint32_t m_FieldPtr;
1504 uint16_t m_SizeA;
1505 uint16_t m_SizeB;
1506
1512 std::vector<std::array<uint8_t, 56>> m_DataB;
1517 std::vector<std::array<uint8_t, 256>> m_DataA;
1518
1520};
1521
1522
1528{
1529 static constexpr uint8_t BLOCK_TYPE_CODE = 0x1E;
1530
1531 uint8_t m_Type;
1532 uint16_t m_T2;
1533 uint32_t m_Key;
1534 uint32_t m_Next;
1535
1536 // Versioning seems unsure here
1537 // At least it is in Kinoma (V_164)
1540
1541 uint32_t m_StrPtr;
1542 uint32_t m_Size;
1543
1544 std::string m_String;
1545
1547};
1548
1549
1554{
1555 static constexpr uint8_t BLOCK_TYPE_CODE = 0x1F;
1556
1557 uint32_t m_Key;
1558 uint32_t m_Next;
1559 uint32_t m_Unknown2;
1560 uint32_t m_Unknown3;
1561 uint32_t m_Unknown4;
1562 uint16_t m_Unknown5;
1563 uint16_t m_Size;
1564
1568 std::vector<uint8_t> m_Substruct;
1569};
1570
1571
1583{
1584 static constexpr uint8_t BLOCK_TYPE_CODE = 0x20;
1585
1586 uint8_t m_Type;
1587 uint16_t m_R;
1588 uint32_t m_Key;
1589 uint32_t m_Next;
1590 std::array<uint32_t, 7> m_UnknownArray1;
1591
1593};
1594
1601{
1602 static constexpr uint8_t BLOCK_TYPE_CODE = 0x21;
1603
1604 uint8_t m_Type;
1605 uint16_t m_R;
1606 uint32_t m_Size;
1607 uint32_t m_Key;
1608
1614 std::vector<uint8_t> m_Data;
1615};
1616
1617
1622{
1623 static constexpr uint8_t BLOCK_TYPE_CODE = 0x22;
1624
1625 uint8_t m_Type;
1626 uint16_t m_T2;
1627 uint32_t m_Key;
1628
1630
1631 std::array<uint32_t, 8> m_UnknownArray;
1632};
1633
1634
1639{
1640 static constexpr uint8_t BLOCK_TYPE_CODE = 0x23;
1641
1642 uint8_t m_Type;
1644 uint32_t m_Key;
1645 uint32_t m_Next;
1646
1647 std::array<uint32_t, 2> m_Flags;
1648
1649 uint32_t m_Ptr1;
1650 uint32_t m_Ptr2;
1651 uint32_t m_Ptr3;
1652
1653 std::array<int32_t, 5> m_Coords;
1654
1655 std::array<uint32_t, 4> m_Unknown1;
1656
1658
1660};
1661
1662
1670{
1671 static constexpr uint8_t BLOCK_TYPE_CODE = 0x24;
1672
1673 uint8_t m_Type;
1675 uint32_t m_Key;
1676 uint32_t m_Next;
1677 uint32_t m_Parent;
1678 uint32_t m_Unknown1;
1679
1681
1682 std::array<int32_t, 4> m_Coords;
1683
1684 uint32_t m_Ptr2;
1685
1686 uint32_t m_Unknown3;
1687 uint32_t m_Unknown4;
1689 uint32_t m_Rotation;
1690};
1691
1692
1698{
1699 static constexpr uint8_t BLOCK_TYPE_CODE = 0x26;
1700
1701 uint8_t m_Type;
1702 uint16_t m_R;
1703 uint32_t m_Key;
1704 uint32_t m_MemberPtr;
1705
1707
1708 uint32_t m_GroupPtr;
1709 uint32_t m_ConstPtr;
1710
1712};
1713
1714
1724{
1725 static constexpr uint8_t BLOCK_TYPE_CODE = 0x27;
1726
1727 std::vector<uint32_t> m_Refs;
1728};
1729
1730
1741{
1742 static constexpr uint8_t BLOCK_TYPE_CODE = 0x28;
1743
1744 uint8_t m_Type;
1746 uint32_t m_Key;
1747 uint32_t m_Next;
1748 uint32_t m_Ptr1;
1749 uint32_t m_Unknown1;
1750
1753
1754 uint32_t m_Ptr2;
1755 uint32_t m_Ptr3;
1758 uint32_t m_Unknown4;
1759 uint32_t m_Unknown5;
1760
1762
1763 uint32_t m_Ptr6;
1764
1766
1767 std::array<int32_t, 4> m_Coords;
1768
1769 uint32_t GetTablePtr() const
1770 {
1771 return m_TablePtr.value_or( m_TablePtr_16x.value_or( 0 ) );
1772 }
1773};
1774
1775
1782{
1783 static constexpr uint8_t BLOCK_TYPE_CODE = 0x29;
1784
1785 uint8_t m_Type;
1786 uint16_t m_T;
1787 uint32_t m_Key;
1788
1789 // Points to something in the header
1790 uint32_t m_Ptr1;
1791 uint32_t m_Ptr2;
1792
1793 uint32_t m_Null; // Null value
1794
1795 uint32_t m_Ptr3;
1796
1797 int32_t m_Coord1;
1798 int32_t m_Coord2;
1799
1801
1802 uint32_t m_Unknown1;
1803
1804 // Pointer to a string, e.g., "2" in R0603
1805 uint32_t m_PtrX30;
1806
1807 uint32_t m_Unknown2;
1808 uint32_t m_Unknown3;
1809 uint32_t m_Unknown4;
1810};
1811
1812
1841
1842
1849{
1850 static constexpr uint8_t BLOCK_TYPE_CODE = 0x2B;
1851
1852 uint32_t m_Key;
1853
1854 uint32_t m_FpStrRef;
1855 uint32_t m_Unknown1;
1856
1857 // Could these be signed?
1858 std::array<uint32_t, 4> m_Coords;
1859
1860 uint32_t m_Next;
1869
1872};
1873
1874
1932
1933
1942{
1943 static constexpr uint8_t BLOCK_TYPE_CODE = 0x2D;
1944
1946 uint8_t m_Layer; // 0 = top (F_Cu), 1 = bottom (B_Cu)
1948
1949 uint32_t m_Key;
1950
1951 uint32_t m_Next;
1952
1954
1955 // Unsure what 16x means
1957
1958 uint16_t m_Unknown2;
1959 uint16_t m_Unknown3;
1960
1962
1963 uint32_t m_Flags;
1964
1965 uint32_t m_Rotation;
1966 int32_t m_CoordX;
1967 int32_t m_CoordY;
1968
1969 // Presumably equivalent to m_InstRef16x
1971
1974 uint32_t m_TextPtr; // Points to 0x30
1975
1977 uint32_t m_AreasPtr;
1980
1981 uint32_t GetInstRef() const
1982 {
1983 return m_InstRef.value_or( m_InstRef16x.value_or( 0 ) );
1984 }
1985};
1986
1987
1993{
1994 static constexpr uint8_t BLOCK_TYPE_CODE = 0x2E;
1995
1996 uint8_t m_Type;
1997 uint16_t m_T2;
1998 uint32_t m_Key;
1999 uint32_t m_Next;
2001 uint32_t m_Unknown1;
2002 int32_t m_CoordX;
2003 int32_t m_CoordY;
2005 uint32_t m_Unknown2;
2006
2008};
2009
2010
2015{
2016 static constexpr uint8_t BLOCK_TYPE_CODE = 0x2F;
2017
2018 uint8_t m_Type;
2019 uint16_t m_T2;
2020 uint32_t m_Key;
2021
2022 std::array<uint32_t, 6> m_UnknownArray;
2023};
2024
2025
2092
2093
2099{
2100 static constexpr uint8_t BLOCK_TYPE_CODE = 0x31;
2101
2113
2114 uint8_t m_T;
2116 uint32_t m_Key;
2118
2119 int32_t m_CoordsX;
2120 int32_t m_CoordsY;
2121
2122 uint16_t m_Unknown;
2123 uint16_t m_Len;
2124
2126
2127 std::string m_Value;
2128};
2129
2130
2137{
2138 static constexpr uint8_t BLOCK_TYPE_CODE = 0x32;
2139
2140 uint8_t m_Type;
2142 uint32_t m_Key;
2143 uint32_t m_Next;
2144 uint32_t m_NetPtr;
2145 uint32_t m_Flags;
2146
2148
2149 uint32_t m_NextInFp;
2150 uint32_t m_ParentFp;
2151 uint32_t m_Track;
2152 uint32_t m_PadPtr;
2153 uint32_t m_Ptr6;
2154 uint32_t m_Ratline;
2157
2159
2160 uint32_t m_NameText;
2161 uint32_t m_Ptr11;
2162
2163 std::array<int32_t, 4> m_Coords;
2164};
2165
2166
2173{
2174 static constexpr uint8_t BLOCK_TYPE_CODE = 0x33;
2175
2177 uint32_t m_Key;
2178 uint32_t m_Next;
2179 uint32_t m_NetPtr;
2180 uint32_t m_Unknown2;
2181
2183
2185
2187
2188 int32_t m_CoordsX;
2189 int32_t m_CoordsY;
2190
2192 uint32_t m_Padstack;
2195
2196 uint32_t m_Unknown4;
2197 uint32_t m_Unknown5;
2198
2199 std::array<int32_t, 4> m_BoundingBoxCoords;
2200};
2201
2202
2207{
2208 static constexpr uint8_t BLOCK_TYPE_CODE = 0x34;
2209
2210 uint8_t m_T;
2212 uint32_t m_Key;
2213 uint32_t m_Next;
2214 uint32_t m_Ptr1;
2215
2217
2218 uint32_t m_Flags;
2220 uint32_t m_Ptr3;
2221 uint32_t m_Unknown2;
2222};
2223
2224
2230{
2231 static constexpr uint8_t BLOCK_TYPE_CODE = 0x35;
2232
2233 uint8_t m_T2;
2234 uint16_t m_T3;
2235
2236 std::array<uint8_t, 120> m_Content;
2237};
2238
2239
2246{
2247 static constexpr uint8_t BLOCK_TYPE_CODE = 0x36;
2248
2249 uint16_t m_Code;
2250 uint32_t m_Key;
2251 uint32_t m_Next;
2252
2254
2255 uint32_t m_NumItems;
2256 uint32_t m_Count;
2257 uint32_t m_LastIdx;
2258 uint32_t m_Unknown2;
2259
2261
2270
2277
2278 struct X05
2279 {
2280 std::array<uint8_t, 28> m_Unknown;
2281
2282 // This is in Nvidia Jetson (17.4), not in EVK BaseBoard (17.2)
2284 };
2285
2286 struct X06
2287 {
2288 uint16_t m_N;
2289 uint8_t m_R;
2290 uint8_t m_S;
2291 uint32_t m_Unknown1;
2292
2294 };
2295
2297 {
2298 uint32_t m_A;
2299 uint32_t m_B;
2301 uint32_t m_CharWidth;
2302
2304
2306 uint32_t m_LineSpace;
2307 uint32_t m_Unknown3; // Always 0?
2308 uint32_t m_StrokeWidth; // Aka "photo width"
2309
2311 };
2312
2313 struct X0B
2314 {
2315 std::array<uint8_t, 1016> m_Unknown;
2316 };
2317
2318 struct X0C
2319 {
2320 std::array<uint8_t, 232> m_Unknown;
2321 };
2322
2323 struct X0D
2324 {
2325 std::array<uint8_t, 200> m_Unknown;
2326 };
2327
2328 struct X0F
2329 {
2330 uint32_t m_Key;
2331 std::array<uint32_t, 3> m_Ptrs;
2332 uint32_t m_Ptr2;
2333 };
2334
2335 struct X10
2336 {
2337 std::array<uint8_t, 108> m_Unknown;
2338
2339 // V18 has an extra uint32 "somewhere" in this block
2341 };
2342
2343 // So far only seen in a V175 file (Jetson)
2344 struct X12
2345 {
2346 // No point reading this before we can use it
2347 // std::array<uint8_t, 1052> m_Unknown;
2348 };
2349
2350 using SubstructVariant = std::variant<X02, X03, X05, X06, FontDef_X08, X0B, X0C, X0D, X0F, X10, X12>;
2351
2352 std::vector<SubstructVariant> m_Items;
2353};
2354
2355
2362{
2363 static constexpr uint8_t BLOCK_TYPE_CODE = 0x37;
2364
2365 uint8_t m_T;
2366 uint16_t m_T2;
2367 uint32_t m_Key;
2368 uint32_t m_GroupPtr;
2369 uint32_t m_Next;
2370 uint32_t m_Capacity;
2371 uint32_t m_Count;
2372 uint32_t m_Unknown2;
2373
2375
2376 std::array<uint32_t, 100> m_Ptrs;
2377};
2378
2379
2400
2401
2406{
2407 static constexpr uint8_t BLOCK_TYPE_CODE = 0x39;
2408
2409 uint32_t m_Key;
2410 uint32_t m_Parent;
2411 uint32_t m_Head;
2412
2413 // Array of 22 uint16_t values
2414 std::array<uint16_t, 22> m_X;
2415};
2416
2417
2422{
2423 static constexpr uint8_t BLOCK_TYPE_CODE = 0x3A;
2424
2426 uint32_t m_Key;
2427 uint32_t m_Next;
2428 uint32_t m_Unknown;
2429
2431};
2432
2433
2439{
2440 static constexpr uint8_t BLOCK_TYPE_CODE = 0x3B;
2441
2442 uint8_t m_T;
2443 uint16_t m_SubType;
2444 uint32_t m_Len;
2445
2446 std::string m_Name;
2447 std::string m_Type;
2448
2449 uint32_t m_Unknown1;
2450 uint32_t m_Unknown2;
2451
2453
2454 std::string m_Value;
2455};
2456
2457
2463{
2464 static constexpr uint8_t BLOCK_TYPE_CODE = 0x3C;
2465
2466 uint8_t m_T;
2467 uint16_t m_T2;
2468 uint32_t m_Key;
2469
2471
2473 std::vector<uint32_t> m_Entries;
2474};
2475
2476
2483template <typename T>
2484concept ALLEGRO_BLOCK_DATA = requires
2485{
2486 { T::BLOCK_TYPE_CODE }->std::convertible_to<uint8_t>;
2487}
2488|| std::is_same_v<T, BLK_0x15_16_17_SEGMENT>;
2489
2490
2491} // namespace ALLEGRO
void SetNext(uint32_t aNext)
uint32_t GetKey() const
virtual ~BLOCK_BASE()=default
uint8_t GetBlockType() const
This is the actual type code as read from the file.
uint32_t GetNext() const
BLOCK_BASE(uint8_t aBlockType, size_t aOffset)
void SetKey(uint32_t aKey)
BLOCK(uint8_t aBlockType, size_t aOffset)
Explicit type code for multi-code types (e.g. segments 0x15/0x16/0x17)
BLOCK(size_t aOffset)
Deduce the type code from T::BLOCK_TYPE_CODE (single-code types only)
const T & GetData() const
Satisfied by any Allegro block data structs that can be used with BLOCK_REF.
A constexpr predicate that decides whether a field exists for a given FMT_VER.
Concept that is statisfied by any struct that has a block tpye code.
Satisfied by any COND_FIELD instantiation (COND_GE, COND_LT, COND_GE_LT, ...)
COND_FIELD< VER_GE< Min >{}, T > COND_GE
Exists for all versions greater than or equal to Min.
COND_FIELD< VER_LT< Max >{}, T > COND_LT
Exists for all versions less than (and not equal to) Max.
FIELD_KEYS
Hdr1 keys for field roles.
@ PHYS_CONSTRAINT_SET
Physical Constraint Set assignment.
@ NET_SCHEDULE
Net class/schedule assignment.
PAD_TYPE
The type of the padstack.
constexpr bool operator>=(FMT_VER lhs, FMT_VER rhs)
FMT_VER
The format of an Allegro file.
COND_FIELD< VER_GE_LT< Min, Max >{}, T > COND_GE_LT
Exists for all versions greater than or equal to Min and less than Max.
Arc segment used in tracks, zone outlines, and shape boundaries.
std::array< int32_t, 4 > m_BoundingBoxCoords
uint8_t m_SubType
Bit 6 (0x40) = clockwise direction.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown6
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 20 > m_Entries
Field/property references with variable-typed substructs.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
std::variant< uint32_t, std::array< uint32_t, 2 >, std::string, SUB_0x6C, SUB_0x70_0x74, SUB_0xF6 > m_Substruct
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
Net assignment linking a net (0x1B) to its member objects.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
Track segment container.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5b
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5a
static constexpr uint8_t BLOCK_TYPE_CODE
Component/symbol definitions.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
Component instance reference data.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_UnknownPtr1
Pin number within a component.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Previous
COND_LT< FMT_VER::V_172, uint32_t > m_StrPtr16x
COND_GE< FMT_VER::V_172, uint32_t > m_StrPtr
Pointer to 0x11 PIN_NAME object.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
0x0A objects represent DRC (Design Rule Check) elements.
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 4 > m_Unknown4
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown6
std::array< uint32_t, 5 > m_Unknown5
Pin definition with shape type, drill character, coordinates, and size.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown_16x
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown5
COND_LT< FMT_VER::V_172, uint8_t > m_DrillChar
COND_GE_LT< FMT_VER::V_174, FMT_VER::V_180, uint32_t > m_Unknown8
COND_LT< FMT_VER::V_172, uint8_t > m_Shape
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 2 > m_Size
COND_GE< FMT_VER::V_172, uint32_t > m_DrillChars
COND_GE< FMT_VER::V_172, uint32_t > m_Shape16x
std::array< int32_t, 2 > m_Coords
COND_LT< FMT_VER::V_172, uint16_t > m_UnknownPadding
Pad geometry and placement in board-absolute coordinates.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_Rotation
Board-absolute millidegrees. Subtract footprint rotation for FP-local orientation.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
int32_t m_CoordsX
Board coordinates. Use SetFPRelativePosition() for KiCad FP-local space.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
int32_t m_CoordsY
Board coordinates. Use SetFPRelativePosition() for KiCad FP-local space.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown5
std::array< uint32_t, 3 > m_UnknownArr
uint32_t m_Rotation
Rotation in millidegrees.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
Function slot in a multi-slot component (e.g.
COND_GE< FMT_VER::V_172, uint32_t > m_Next
std::array< char, 32 > m_CompDeviceType
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
Function instance linking a component instance (0x07) to its schematic function, pin cross-references...
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
Pin name within a component, linked from function slots (0x0F).
uint32_t m_Key
Pointer to pin name string.
uint32_t m_PinNameStrPtr
Pointer to next 0x11 PIN_NAME object or 0x0F SLOT.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
uint32_t m_Next
Pointer to 0x08 PIN_NUMBER object.
static constexpr uint8_t BLOCK_TYPE_CODE
Cross-reference between objects.
COND_GE< FMT_VER::V_165, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
Graphics container holding a chain of line segments and arcs.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
0x15 , 0x16, 0x17 are segments:
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
0x1B objects are nets.
uint32_t m_Ratline
Pointer to first 0x03 FIELD object or null.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_MatchGroupPtr
Diff pair / match group pointer (0x26 or 0x2C)
PAD_FLAGS
Pad flags are founds in a byte of the pad info.
COND_GE< FMT_VER::V_165, uint32_t > m_Unknown_4
COND_GE< FMT_VER::V_180, std::array< uint32_t, 8 > > m_UnknownArr_v180
uint8_t m_Flags
Mask of PAD_FLAGS values.
PAD_FLAGS
Pad flags are founds in a byte of the pad info.
Padstack definition containing drill dimensions and a table of per-layer pad/antipad/thermal componen...
std::variant< HEADER_v16x, HEADER_v17x > HEADER
LAYER_COMP_SLOT
Component table layer offsets In the component table's layer section, each layer has 3 or 4 slots,...
static constexpr uint8_t BLOCK_TYPE_CODE
std::vector< uint32_t > m_UnknownArrN
Some structure of m_N * 8 or 10:
size_t m_NumFixedCompEntries
How many of the entries are fixed roles (after this is n*layers)
uint8_t m_N
The number of something.
std::vector< PADSTACK_COMPONENT > m_Components
Collection of components that make up the padstack.
SLOTS
Fixed slot indices in the component table.
Physical constraint sets containing trace width, clearance, and routing rules.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_FieldPtr
Pointer to 0x03 FIELD with CS name (fallback when m_NameStrKey fails)
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
uint32_t m_NameStrKey
String table key for constraint set name.
std::vector< std::array< uint8_t, 256 > > m_DataA
Records contain ASCII padstack/via name strings (null-terminated at offset 4) and file path reference...
std::vector< std::array< uint8_t, 56 > > m_DataB
Per-copper-layer dimension values, 14 x int32 per record.
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
Signal integrity and simulation model data (IBIS netlists).
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_164, uint16_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
COND_GE< FMT_VER::V_164, uint16_t > m_Unknown2
Per-padstack dimension records with name and value.
std::vector< uint8_t > m_Substruct
Version-dependent substruct holding padstack dimension name and value.
static constexpr uint8_t BLOCK_TYPE_CODE
uint32_t m_Next
Linked list next pointer (used by LL_WALKER)
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, std::array< uint32_t, 10 > > m_UnknownArray2
std::array< uint32_t, 7 > m_UnknownArray1
Headered data blob containing structured board data such as layer stackup definitions,...
static constexpr uint8_t BLOCK_TYPE_CODE
std::vector< uint8_t > m_Data
An array of bytes that seems to be a variable length.
Purpose not determined.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 8 > m_UnknownArray
0x23 objects represent ratlines.
COND_GE< FMT_VER::V_164, std::array< uint32_t, 4 > > m_Unknown2
std::array< uint32_t, 4 > m_Unknown1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 2 > m_Flags
std::array< int32_t, 5 > m_Coords
Rectangle defined by four coordinates.
uint32_t m_Rotation
Rotation in millidegrees.
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
Match group indirection for differential pairs and match groups.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
uint32_t m_ConstPtr
Points to timing/delay constraints (field type 0x63), not physical constraints.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
Serialized Constraint Manager database containing secondary name table (V172+), material stackup,...
static constexpr uint8_t BLOCK_TYPE_CODE
Polygon shape defined by a linked list of segments starting at m_FirstSegmentPtr (0x15/0x16/0x17 line...
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
std::array< int32_t, 4 > m_Coords
COND_LT< FMT_VER::V_172, uint32_t > m_TablePtr_16x
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_TablePtr
0x29 objects may represent pins in .dra files.
static constexpr uint8_t BLOCK_TYPE_CODE
std::string m_Name
uint32_t m_Properties
uint32_t m_Unknown
uint32_t mLayerNameId
Represents a list of layers.
COND_GE< FMT_VER::V_165, std::vector< REF_ENTRY > > m_RefEntries
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
COND_LT< FMT_VER::V_165, std::vector< NONREF_ENTRY > > m_NonRefEntries
Footprint definition (template) shared by multiple placed instances.
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_164, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
std::array< uint32_t, 4 > m_Coords
Lookup table used for named associations.
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
SUBTYPE
The subtype of a table.
@ SUBTYPE_0x102
Some kind of net match group.
@ SUBTYPE_GRAPHICAL_GROUP
Used for drill charts and x-section charts.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
Placed footprint instance on the board.
uint32_t m_Rotation
Millidegrees (divide by 1000 for degrees)
COND_LT< FMT_VER::V_172, uint32_t > m_InstRef16x
COND_GE< FMT_VER::V_172, uint32_t > m_InstRef
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown4
Connection point at a track junction or pad-to-track transition.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
Purpose not determined.
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint32_t, 6 > m_UnknownArray
Text object with position, rotation, layer, font properties, and alignment.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, TEXT_PROPERTIES > m_Font
COND_LT< FMT_VER::V_172, uint32_t > m_PtrGroup_16x
COND_GE< FMT_VER::V_172, uint32_t > m_PtrGroup_17x
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
COND_GE< FMT_VER::V_172, uint32_t > m_Ptr2
COND_LT< FMT_VER::V_172, uint32_t > m_Unknown4
COND_GE< FMT_VER::V_172, uint32_t > m_Ptr1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_LT< FMT_VER::V_172, TEXT_PROPERTIES > m_Font16x
static constexpr uint8_t BLOCK_TYPE_CODE
String graphic content holding the actual text value and its display layer category.
COND_GE< FMT_VER::V_174, uint32_t > m_Un2
static constexpr uint8_t BLOCK_TYPE_CODE
Placed pad instance linking a pad definition (0x0D via m_PadPtr) to its parent footprint (m_ParentFp)...
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown2
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_Coords
COND_GE< FMT_VER::V_172, uint32_t > m_Prev
Via instance with board position, padstack reference (m_Padstack for drill/annular ring definitions),...
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_UnknownPtr2
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< int32_t, 4 > m_BoundingBoxCoords
0x34 objects represent keepouts.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
static constexpr uint8_t BLOCK_TYPE_CODE
File path references to Allegro log and report files (terminator.log, eclrpt.txt).
static constexpr uint8_t BLOCK_TYPE_CODE
std::array< uint8_t, 120 > m_Content
COND_GE< FMT_VER::V_172, std::array< uint32_t, 8 > > m_Ys
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
COND_GE< FMT_VER::V_172, std::array< uint32_t, 2 > > m_Zs
COND_GE< FMT_VER::V_164, std::array< uint32_t, 3 > > m_Ys
COND_GE< FMT_VER::V_172, std::string > m_Str
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
COND_LT< FMT_VER::V_172, std::string > m_Str16x
std::array< uint8_t, 28 > m_Unknown
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown2
COND_LT< FMT_VER::V_172, std::array< uint32_t, 50 > > m_Unknown2
std::array< uint8_t, 1016 > m_Unknown
std::array< uint8_t, 232 > m_Unknown
std::array< uint8_t, 200 > m_Unknown
std::array< uint8_t, 108 > m_Unknown
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2
Heterogeneous definition table containing font metrics (FontDef_X08), layer name definitions (X03),...
std::variant< X02, X03, X05, X06, FontDef_X08, X0B, X0C, X0D, X0F, X10, X12 > SubstructVariant
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
std::vector< SubstructVariant > m_Items
static constexpr uint8_t BLOCK_TYPE_CODE
Fixed-capacity pointer array (100 entries).
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
std::array< uint32_t, 100 > m_Ptrs
0x38 objects represent films.
COND_GE< FMT_VER::V_166, uint32_t > m_Unknown2
std::array< uint32_t, 7 > m_UnknownArray1
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown3
COND_GE< FMT_VER::V_166, uint32_t > m_LayerNameStr
static constexpr uint8_t BLOCK_TYPE_CODE
COND_LT< FMT_VER::V_166, std::string > m_FilmName
0x39 objects represent a film layer list.
static constexpr uint8_t BLOCK_TYPE_CODE
0x3A objects represent a list of films
static constexpr uint8_t BLOCK_TYPE_CODE
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown1
Named property with type and value strings.
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown3
static constexpr uint8_t BLOCK_TYPE_CODE
Ordered list of block keys.
COND_GE< FMT_VER::V_174, uint32_t > m_Unknown
std::vector< uint32_t > m_Entries
static constexpr uint8_t BLOCK_TYPE_CODE
Version-conditional field.
static constexpr bool exists(FMT_VER aVer)
COND_FIELD & operator=(const T &aValue)
const T & value() const
const T & operator*() const
const T & value_or(const T &aDefault) const
COND_FIELD & operator=(T &&aValue)
const T * operator->() const
uint32_t m_LayerList0x2A
uint32_t m_A
This is apparently some kind of linked list that chains though subsets objects in the file.
Allegro files start with this header.
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_4
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2g_V18
COND_LT< FMT_VER::V_180, std::array< uint32_t, 7 > > m_Unknown2_preV18
COND_LT< FMT_VER::V_180, uint32_t > m_0x35_Start_preV18
COND_GE< FMT_VER::V_180, std::array< uint32_t, 9 > > m_Unknown5_V18
std::array< char, 60 > m_AllegroVersion
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_5
COND_GE< FMT_VER::V_180, uint32_t > m_0x35_Start_V18
COND_LT< FMT_VER::V_180, LINKED_LIST > m_LL_Unknown5_preV18
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_3
COND_LT< FMT_VER::V_180, uint32_t > m_Unknown7
std::array< LAYER_MAP_ENTRY, 25 > m_LayerMap
The layer maps is a list of groups of two numbers.
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2e_V18
std::array< uint32_t, 50 > m_Unknown9
COND_LT< FMT_VER::V_180, uint32_t > m_0x27_End_preV18
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_Unknown5_V18
COND_GE< FMT_VER::V_180, uint32_t > m_0x27_End_V18
COND_GE< FMT_VER::V_180, uint32_t > m_0x35_End_V18
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_6
uint32_t Get_0x27_End() const
const LINKED_LIST & GetUnknown5() const
COND_LT< FMT_VER::V_180, std::array< uint32_t, 17 > > m_Unknown5_preV18
COND_LT< FMT_VER::V_180, uint32_t > m_Unknown3
COND_LT< FMT_VER::V_180, uint32_t > m_0x35_End_preV18
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_1
COND_LT< FMT_VER::V_180, uint32_t > m_StringCount_preV18
COND_GE< FMT_VER::V_180, uint32_t > m_StringCount_V18
uint32_t GetStringsCount() const
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2b_V18
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2d_V18
COND_GE< FMT_VER::V_180, LINKED_LIST > m_LL_V18_2
COND_GE< FMT_VER::V_180, uint32_t > m_Unknown2a_V18
SUBCLASS
The second byte in a CLASS:SUBCLASS pair.
bool operator==(const LAYER_INFO &) const =default
Substruct in a padstack object.
uint32_t m_StrPtr
Seems to point to various things:
COND_GE< FMT_VER::V_172, uint32_t > m_Unknown1
COND_GE< FMT_VER::V_172, int32_t > m_Z1
std::optional< uint32_t > m_Z2
constexpr bool operator()(FMT_VER v) const
constexpr bool operator()(FMT_VER v) const
constexpr bool operator()(FMT_VER v) const