Posts Tagged ‘read pld chip encrypt eeprom’
Read PLD Binary Source Code: Three Words That Contradict Each Other
The phrase in the URL contains three words that each name a different layer of a programmable logic design, and using them together produces a request that cannot be answered without interpretation. Binary is a physical representation. Source is a human-authored description. Code is an ambiguous term that could mean either.
On a simple programmable logic device the layers are unusually distinct, because these parts are small enough that the whole stack fits in one person’s head. A GAL16V8 has 2048 fuse locations, a set of macrocells with configurable output logic, and an architecture that has been documented for forty years. Sorting out which layer a customer wants is therefore quick, provided the question is asked.
The four layers
| Layer | What it is | On a GAL16V8 |
|---|---|---|
| Design intent | What the device should do | Text, in a notebook, usually lost |
| Source | Equations or HDL | Product terms in a file |
| Configuration | Fuse states | 2048 bits |
| Physical | Charge in cells | Floating gates |
The first row is the one that has genuinely disappeared. A design description in a notebook was never in the device. The second row exists in the device only in the sense that the fuse states imply equations, and recovering those equations is the interpretation step.
So a request to read binary source code is a request for two different artefacts, and the honest response is to ask which of the middle two layers is wanted. Both are producible. They are produced by different processes and they support different tasks.
What the fuse array actually holds
A GAL-type device is an array of programmable AND gates feeding fixed OR gates, with configurable output cells. The fuse pattern specifies which inputs connect to which product terms, and the configuration bits in each macrocell specify how its output is formed.
| Region of the array | Configures |
|---|---|
| AND array | Which inputs participate in each product term |
| Product term allocation | How many terms feed each OR gate |
| Output polarity | Whether the sum is inverted |
| Register bypass | Combinational or registered output |
| Feedback selection | Whether the output or the register feeds back |
| Signature row | A user-defined identifier |
The fifth row is where a naive reading goes wrong. A macrocell with feedback taken from the register behaves as a state element; the same macrocell with feedback from the pin behaves as a combinational output with an unusual path. Both look identical in the AND array, and only the configuration bits distinguish them.
The signature row
Most of these devices include a row of user-programmable bits that is not part of the logic array. Designers used it for version strings, board codes, or their initials.
| Signature content | Value to a recovery project |
|---|---|
| Version and date | Establishes which build this is |
| Board or product identifier | Confirms the device belongs to the expected design |
| Designer initials | Occasionally identifies who to ask |
| A checksum | A verification target for a reconstruction |
| Empty | Common, and tells you nothing |
The checksum entry is the one to look for. A designer who stored a hash of their own source gives a free acceptance test, and that turns an open-ended reconstruction into a checkable one.
What the array cannot tell you
A fuse map is complete about configuration and silent about everything else, and the silence has practical consequences.
| Question | Answerable from the array |
|---|---|
| What logic does this device implement | Yes |
| Which tool produced it | Only by inference from unused terms |
| When it was programmed | No |
| What the board does with its outputs | No |
| Whether it was ever modified in the field | No, unless a signature row records it |
| Whether it is the original or a copy | No |
The last row matters when a device is suspected of having been replaced during a repair. Two devices with identical arrays are indistinguishable from the array alone, and establishing which one was factory-fitted requires the date code, the solder condition, or production records.
Why these parts are still worth reading
Devices of this class are long out of production, which makes them a recurring problem rather than an obsolete one. Equipment built in the 1990s is still in service in industrial control, and when a board fails the replacement part is unavailable. Reading the device is often the only way to keep the equipment running.
| Situation | Approach |
|---|---|
| Device works, need a copy | Read, program a compatible blank |
| Device failed, need the design | Read, reconstruct, reimplement |
| Device unreadable, need behaviour | Measure the board, infer the function |
| No device available at all | Reconstruct from board behaviour and documentation |
The third row is where a reading project becomes a measurement project, and it is more common than expected on boards where the device has already failed.
Reading and interpreting are separate
Reading produces the fuse states, and that is a solved problem with these devices because the arrays are large and the protocols are documented. Interpreting produces equations, and that requires the architecture.
| Step | Output | Depends on |
|---|---|---|
| Read the array | Fuse states | Programming protocol |
| Apply the macrocell map | Per-cell configuration | Device architecture |
| Group terms by OR gate | Sum-of-products form | Product term allocation |
| Resolve feedback | Combinational or sequential behaviour | Configuration bits |
| Simplify | Readable equations | Boolean algebra |
The fourth step is the one that changes the meaning of everything, and it is treated in detail in reading PLD binary into equations. The container that carries the fuse states is covered in reading the JED format, and the larger devices with similar architecture are in reading Lattice CPLD embedded firmware.
For a design rather than an array, the broader question of recovering a programmable logic design from a finished part is collected under PLD chip reverse engineering.
Services at this boundary
Work covers array readout, macrocell configuration decoding, signature row extraction, equation reconstruction with feedback resolution, and simplification to a documented form. It does not cover recovering the original text file, and it does not cover recovering a design description that was never in the device.
The clarifying question is worth asking in the first message: does the customer want the bits, the equations, or an explanation of the behaviour. The three are all available and none of them is source code.