werni2a / openallegroparser Goto Github PK
View Code? Open in Web Editor NEWOpenAllegroParser - FOSS Parser for Cadence Allegro designs.
License: MIT License
OpenAllegroParser - FOSS Parser for Cadence Allegro designs.
License: MIT License
In OrCAD we can export the design into a XML which directly shows us which information is stored in the binary file and probably also how it is stored. Maybe Extracta can do the same for layouts. A short introduction how to use the tool is provided in [1]. Further, [1] states that there is a Linux version of the tool. Can this one be downloaded somewhere or why would Cadence distribute a Linux tool on an Windows machine?
[1] BoardSurfers: Translating Allegro Database to Readable Format Using 'Extracta'
I used the board linked in the following issue to decode some board informations: OpenBoardView/OpenBoardView#126
In my case, I started with the lowest level of information (e.g. known tracks), thus I hardcoded "known" positions in the file to extract records as I think they might fit. I think for such binary-blobs that's the better approach, as it allows you to expand your knowlege step-wise. If you know how a record look like you can find the first one, and then the index to that record,..
This is just a dump of information I decoded some months ago, hope it helps 😃
4 byte little endian integers
in thousands of degrees (e.g. 180°
= 180000
)4 byte little endian integers
, first comes x and then y. Sorry, I forgot in which unit they were (but you should find this out using the kaitai file and a board-viewer)meta:
id: allegro
title: Allegro board file
file-extension: brd
endian: le
encoding: UTF-8
# Findings (27.04.2021)
# Degree:
# le 4 byte 180° = 180000
# Position x|y
# le 4 byte | le 4 byte
# How found out: search for 180, 1800, 18000 until a high number of matches is found
# those numbers are the same on all allegro files I saw so far:
seq:
- size: 3
- id: magic
contents: [0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00]
- size: 44
- id: zeroes1
contents: [0x00, 0x00, 0x00, 0x00]
- size: 60
- id: zeroes2
contents: [0x00, 0x00, 0x00, 0x00]
- size: 36
- id: zeroes3
contents: [0x00, 0x00, 0x00, 0x00]
- size: 28
- id: zeroes4
contents: [0x00, 0x00, 0x00, 0x00]
- size: 28
- id: zeroes5
contents: [0x00, 0x00, 0x00, 0x00]
- size: 12
- id: string1
type: str
size: 60
- size: 24
- id: zeroes6
contents: [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
instances:
# file: 77G.MMW.automotive.radar-PCBF-V01-20180115-1520.brd
# downloaded from https://github.com/OpenBoardView/OpenBoardView/issues/126
# track_segment1: x=-18100 y=219000
# pos: 0x25f284
tracks_unknown:
io: _root._io
pos: 0x25f130 # hardcoded for now, only valid for this board
type: tracks
vias_unknown:
io: _root._io
pos: 0x2ea550 # hardcoded for now, only valid for this board
type: vias
# pad: 0x0032A990 - -233337 | 149000 | Pin2 | CAN_L
types:
tracks:
seq:
- id: tracks
type: track_seg
repeat-expr: 20 # just show some vias to validate record
repeat: expr
vias:
seq:
- id: vias
type: via_seg
repeat-expr: 20 # just show some vias to validate record
repeat: expr
test:
seq:
- id: type_question_or_layer
type: u4
- id: data
size: 32+4
# TODO: offsets are wrong at some point
track_seg: # track_seg?
seq:
- id: type_question_or_layer # no idea what this is, perhaps we can extract the record type -> size from it?
type: u4
- size: 4*4
- id: width # TODO: sometimes zero?
type: s4
- id: start
type: point
- id: end
type: point
# TODO: offsets are wrong at some point
via_seg:
seq:
- id: position
type: point
- size: 4*5
- id: rotation
type: s4
- size: 4*9
point:
seq:
- id: x
type: s4
- id: y
type: s4
main.cpp
in one run.I am trying to follow the instructions in README.md
. Under the Build header, it asks me to run:
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake
but I don't see the file vcpkg.cmake
in my repository. (And also the command seems to reference the parent folder above the repository.)
Tests that should be implemented into the CI.
Feel free to contribute some test files. A few points to note are listed in the following.
If you vary a parameter e.g. an enum try to keep the rest of the parameters the same as for other variations of the same parameter. This simplifies finding the offset, when comparing two files byte-by-byte.
Do not use 0.0
or other values that might occur elsewhere in the file for tests. Otherwise we might misinterpret some values and the test does not detect this.
Units
(enum)
Decimal places
(unsigned in range [0, 4])
Start
Padstack usage
(enum)Drill
Slot
Slot type
(enum)X size
(unsigned)Y size
(unsigned)
X tolerance
+
-
Y tolerance
+
-
Drill hole
Hole type
(enum)Finished diameter
(unsigned)+ Tolerance
(unsigned)- Tolerance
(unsigned)Drill tool size
(string)Non-standard drill
(enum)Hole plating
Hole/slot plating
(enum)Define the drill rows and columns
Number of drill rows
(unsigned)Number of drill columns
(unsigned)Clearance between columns
(unsigned)Clearance between rows
(unsigned)Drills are staggered
(bool)Secondary Drill
Backdrill
(bool)
Diameter
(unsigned)
Backdrill drill symbol
Type of drill figure
(enum)Characters
(string with <= 3 characters)Drill figure width
(unsigned)Drill figure height
(unsigned)Counter bore/sink
(bool)
Diameter
(unsigned)+ Tolerance
(unsigned)- Tolerance
(unsigned)Depth
(unsigned)Drill Symbol
Define a drill symbol
Type of drill figure
(enum)Characters
(string with <= 3 characters)Drill figure width
(unsigned)Drill figure height
(unsigned)Drill Offset
Offset from padstack origin to hole
Offset x
(int)Offset y
(int)Design Layers
Mask Layers
Options
Suppress unconnected internal pads; legacy artwork
(bool)Lock layer span
(bool)Poly via
(bool)A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.