Small machines
A language model will talk about almost anything. A circuit will not. It meets timing, or the line stays quiet and you get to find out why.
Where the work sits
The notes I want to keep live on the seam between a model and a machine. The model is cheap to revise. The machine is a board, a clock, a power rail, and a datasheet that does not negotiate.
A model can sketch a state machine in a second. It cannot tell you that the level shifter runs hot, or that the ground you drew on a napkin shares a path with the ADC. Those facts show up with a probe.
Three speeds
I try to keep three speeds separate.
- The speed of an idea. Fast, and usually wrong in a useful way.
- The speed of a program. Fast enough to test the idea against something that runs.
- The speed of hardware. Slow, because parts, layout, and measurement do not compress the way text does.
The third speed is not a character flaw. It is the cost of leaving the screen.
What each loop costs
| Software | Hardware | |
|---|---|---|
| Revision | Another commit | Another board |
| Failure | A stack trace | A warm chip, or silence |
| Feedback | Seconds | Days, if the parts are in |
| What you trust | The test | The measurement |
The table is a reminder of which loop I am in, not a ranking of the two.1
Still on the bench
- Read the pinout twice
- Write the boring part of the firmware first
- Measure the rail under load, not just at idle
- Stop asking a model what the scope already knows
A fragment
The part worth keeping is usually shorter than the explanation around it. A clock, an enable, and a count that does not move unless the enable says so:
module tick (
input wire clk,
input wire en,
output reg [7:0] count
);
always @(posedge clk) begin
if (en)
count <= count + 8'd1;
end
endmodule
If en is stuck low, the rest of the discussion is decoration.
How a note turns into a board
A thought goes out to a model, then onto paper, then onto a bench. The step that edits the thought is the measurement, not the reply.
The arrow back to the note is the whole point. The model is one step. The probe is the editor.
Footnotes
-
A faster loop is not automatically a truer one. ↩