Posts Tagged ‘fpga program extract’
Program Has Two Meanings: Contents and Programming Specification
In this industry the word program is used for two things that share no method. One is the data that was burned into a device. The other is the procedure for burning it.
A customer who asks for the program to be extracted may want either, and the consequences of guessing are asymmetric: delivering a data image to someone who needed a programming specification leaves them unable to manufacture, and delivering a specification to someone who needed the image leaves them with nothing to manufacture.
The two objects
The contents are bytes. They have an address, a length and a meaning, and their extraction is the subject of most of this site.
The programming specification is a procedure: the sequence of commands that puts those bytes into a device, the voltages and timings required, and the algorithm the device’s controller executes internally to write a page.
| Object | What it is | Who needs it |
|---|---|---|
| Contents | The bytes burned in | Anyone reproducing a device |
| Specification | The procedure to burn them | Anyone manufacturing |
| Algorithm | The device’s internal write sequence | Anyone building a programmer |
| Timing | The constraints on the procedure | Anyone qualifying a process |
The third row is a layer below the second and is the one that makes a device programmable by equipment other than the original. It is what a contract manufacturer needs when the customer wants to move production away from a supplier who holds the programming setup, and the same equipment is the subject of the review in the programmer as an asset.
Why the specification is needed
Three situations produce a request for the specification rather than the contents.
A product is moving to a new contract manufacturer, and the original manufacturer holds the programming setup. The data is available — the customer owns it — but the procedure is not, and without it the new manufacturer cannot reliably produce parts.
| Situation | Object needed | Why |
|---|---|---|
| Changing manufacturer | Specification | The new line has different equipment |
| Building an in-house line | Specification plus algorithm | Generic programmers may not support the part |
| Second-sourcing a device | Specification | A different part needs a different sequence |
| Failure analysis | Contents and specification | To reproduce the failure |
The second row is the one where the algorithm matters. A generic programmer supports a device if the device’s vendor published a programming algorithm, and a device that is obscure, obsolete or custom may have none. In that case the algorithm has to be derived by observation.
How a specification is extracted
The method is to record the programming operation and decode it, and it requires a device that has not yet been programmed plus the equipment that normally programs it.
The recording is a bus capture, taken between the programmer and the device. For a serial protocol it is a few wires and a logic analyser. For a parallel protocol it is the address and data buses plus the control lines, which is more wires and the same principle.
| Step | Action | Output |
|---|---|---|
| One | Capture a complete programming session | A trace of every transaction |
| Two | Separate the phases | Erase, write, verify, configure |
| Three | Decode the command sequence | An ordered list of operations |
| Four | Measure the timing of each phase | Constraints |
| Five | Repeat on a second device | Confirmation that the sequence is stable |
The fifth step is what separates a specification from an anecdote. A sequence observed once may include retries, error recovery or a device-specific quirk. A sequence observed twice with identical structure is the protocol.
What the algorithm looks like
The device’s internal write algorithm is not visible on the bus, because it happens inside the device after a command is issued. What is visible is the command and the time it takes.
That time is the fingerprint. A page write that takes two milliseconds is doing something different from one that takes ten, and the difference corresponds to the algorithm: a simple program-and-verify loop, a ramp-and-verify sequence, or a two-pass write for a device with a fine-grained cell.
| Observation | Inference |
|---|---|
| Write takes a fixed time regardless of content | Program-and-verify with a bounded loop |
| Write time varies with content | The loop terminates when verify passes |
| A second command follows the write | An explicit verify step |
| A pause between write and verify | A settling time in the algorithm |
The second row is the important one, because it tells you that the algorithm is content-dependent and that a programmer must therefore wait for a status signal rather than a fixed delay.
The contents, by contrast
If the request turns out to be for the contents, the work is the extraction described elsewhere, and the deliverable is an image plus a description of what was read.
The two are not mutually exclusive, and a well-scoped engagement often delivers both: the image for the customer’s records, and the specification so that the customer can produce more devices with it.
| Deliverable | Format | Used by |
|---|---|---|
| Image | Binary or hex, with a base address | Engineering |
| Region map | Addresses and classification | Engineering |
| Programming specification | A procedure document | Manufacturing |
| Algorithm description | Timing and command sequence | Tooling |
How to tell which is wanted
One question settles it: what will be done with the result.
If the answer involves reading, analysing or comparing, the object is the contents. If it involves producing devices, the object is the specification, and probably the algorithm as well.
| Answer | Object | First step |
|---|---|---|
| “We need to see what it does” | Contents | Read the device |
| “We need to make more of these” | Specification | Capture a programming session |
| “Our programmer does not support it” | Algorithm | Capture plus timing analysis |
| “We are moving to another factory” | Both | Read plus capture |
The second answer is the one that is most often misheard, because it arrives as a request to “extract the program” and the word program is taken to mean the data.
Where this fits
For the contents, the route is the one in extracting MCU firmware, which also establishes the region map that a manufacturer needs in order to know what to burn where.
For the specification, the work depends on the protocol being observable, which is the case whenever the programming interface is a wire rather than a die-level probe. Where the device is programmed before installation and the interface is inaccessible, the specification cannot be observed and the route becomes the datasheet, if one exists.
The manufacturing consequences of a specification that is wrong in a subtle way — a timing that is marginal, a verify that is skipped — appear as yield loss, and the volume effects are the subject of copying an IC program.
What we do at this layer is ask the question before quoting. The two engagements share no equipment, and a quotation that assumes the wrong one is wrong by a factor rather than by a margin.