Connectivity Proofs from connect.csv

Turn each row of the chip's wiring table into a property. A formal tool proves every one with the blocks left out. See what it can see, and what it cannot.

You Will Be Able To

  • Explain how one row of connect.csv becomes one property, and why every block is an empty box in the proof.
  • Say why a proof suits wiring and why a simulation test does not.
  • Read a proof's result: proved, an unconstrained wire, or a counterexample with its values.
  • Name what a connectivity proof cannot check.
Lesson
V8.1
Time
26 min
Runs on
Your browser
Check
5 questions

The night before a tape-out review, someone asks the question nobody likes. "Has every wire between the blocks been checked?" The UART test passes. The DMA test passes. But there are hundreds of wires, and a passing test touches only some of them.

This lesson is about the one tool that can answer yes for all of them at once.

One Row Becomes One PropertyA row of connect.csv is used twice. It generates the wire in the top level, and a property that checks the wire. The proof runs with every block an empty box.
  • Control / FSM
  • Test
  • Bus
  • Manager
  • Peripheral
  • Control
  • Data
One Row Becomes One PropertyA row of connect.csv is used twice. It generates the wire in the top level, and a property that checks the wire. The proof runs with every block an empty box. control connect.csv row u_uart.rx_ready,u_dma.rx_ready, 1,clk_sys, ... test top-gen.mjs the generator bus Generated toplevel blocks as empty boxes control Property u_dma.rx_ready ==u_uart.rx_ready manager SymbiYosys every value at once peripheral Proved, or acounterexample per row one line of datathe wirethe checkfree block outputsassertanswer
  1. control connect.csv rowu_uart.rx_ready, u_dma.rx_ready, 1, clk_sys, ...
    • one line of data → top-gen.mjs
  2. test top-gen.mjsthe generator
    • the wire → Generated top level
    • the check → Property
  3. bus Generated top levelblocks as empty boxes
    • free block outputs → SymbiYosys
  4. control Propertyu_dma.rx_ready == u_uart.rx_ready
    • assert → SymbiYosys
  5. manager SymbiYosysevery value at once
    • answer → Proved, or a counterexample
  6. peripheral Proved, or a counterexampleper row
  1. A row

    One line names a driver, a load, a width, the load's clock and power domain, and any crossing.

  2. Two products

    The generator writes the wire into the top level, and writes a property that says the two ends are equal.

  3. Empty boxes

    Every block is replaced by a box whose outputs can take any value. Only the wiring between them is real.

  4. One answer per row

    The solver tries every value of every free output at once. Each property is proved, or it fails with a trace of values.

Read the diagram as text
  • connect.csv row: u_uart.rx_ready, u_dma.rx_ready, 1, clk_sys, ...
  • top-gen.mjs: the generator
  • Generated top level: blocks as empty boxes
  • Property: u_dma.rx_ready == u_uart.rx_ready
  • SymbiYosys: every value at once
  • Proved, or a counterexample: per row
  • connect.csv row → top-gen.mjs: one line of data
  • top-gen.mjs → Generated top level: the wire
  • top-gen.mjs → Property: the check
  • Generated top level → SymbiYosys: free block outputs
  • Property → SymbiYosys: assert
  • SymbiYosys → Proved, or a counterexample: answer

tools/soc/ap_soc/top-gen.mjs writes gen/rtl/ap_soc.sv and gen/formal/ap_soc_connect_formal.sv from the same tables (facts §27.11).

Before You Start

Read The Specification Is Data and Where You May Look first. The Formal track's Connectivity lesson teaches the method; this page uses it on ap_soc.

Five questions this page answers
Question
1What does one row of connect.csv become in a proof?
2Why are the blocks empty boxes during the proof?
3Why is a proof the right tool for wiring, and a test the wrong one?
4What does a counterexample tell you, and what does "unconstrained" mean?
5What can a connectivity proof never see?

The Idea: Check the Wires Between Blocks

Every block of ap_soc arrives tested by its own bench. What no block bench can test is the wire that leaves it. Does the UART's "byte ready" really reach the DMA? Does the fourth pad really carry the SPI select? A block bench never sees where its output goes.

The wiring of ap_soc is written down as data, in connect.csv: one row for each wire. The top level is generated from that table. A connectivity proof checks the generated top against the same table, row by row. It needs no test program and no stimulus, because it does not run the blocks at all.

That is the trick. Leave the blocks out, keep only the wires, and ask a formal tool whether each wire joins what the table says. With nothing inside the blocks, the question is small, and the answer covers every value at once.

New Words

New words on this page
WordMeaning
Connectivity proofA formal check that each wire of a table joins the two ends it names, for every value, with no stimulus.
Empty boxA block replaced by nothing but its ports, whose outputs may take any value in the proof (a free output).
PropertyA statement the tool must prove always holds; here, "this load equals that driver".
CounterexampleValues of the free signals under which a property fails, shown as a short trace.
Unconstrained wireA load the table names but no submitted row describes; nothing checks it.
Conditional connectionA wire that exists only when a select has one value, such as a pad's function in PINMUX.

The Smallest Example: Four Rows by Hand

Take a toy top level with four free outputs and four loads. The table says the UART's rx_ready drives the DMA's rx_ready, and tx_room drives tx_room. Two interrupt wires go to inputs 1 and 2. In the toy, the first two wires are crossed.

Each row, checked over every value of the free outputs
Row (driver -> load)In the top levelIs there a value where they differ?Result
u_uart.rx_ready -> u_dma.rx_readydriven by tx_roomyes: rx_ready 0, tx_room 1counterexample
u_uart.tx_room -> u_dma.tx_roomdriven by rx_readyyes: the same valuescounterexample
u_uart.irq -> u_plic.irq[1]as writtennoholds
u_gpio.irq -> u_plic.irq[2]as writtennoholds

A toy. The runnable example below checks it on Icarus over all 16 values; the real tool reasons about every value symbolically.

Notice what a crossed pair does. Both rows fail, and each failure points at one load. A test that sent one byte might have passed: the DMA waits on both flags, and both rise at some point.

The Rules

  1. Rule 1: One row is one property.

    The property says the load equals the driver: destination == source. A slice row checks only those bits.

  2. Rule 2: Blocks are empty boxes.

    Their outputs are free, so the tool must prove each equality for every value they could take.

  3. Rule 3: A row that holds proves its wire.

    No stimulus can leave a value out, because the tool covers all of them.

  4. Rule 4: A missing row proves nothing.

    A load with no row is unconstrained: a wrong wire there passes. Completeness is the hard part.

  5. Rule 5: A pad function is a conditional row.

    It must hold only when PINMUX selects that function: "if IO3 select is 2, then the SPI input equals pad 3".

  6. Rule 6: The proof sees wires, nothing more.

    Block behaviour, timing, synchronizer delay and metastability are outside it.

Sources for These Rules

Connectivity checking with formal tools, from a table of connections turned into assertions: MEHTA-DV 10.9.

The chip's tables and generator: tools/soc/ap_soc/connect.csv, irq.csv, pins.csv, top-gen.mjs; the harness gen/formal/ap_soc_connect_formal.sv (facts §27.11, plan §3.10 E4).

The site's wiring parts and proof: tools/soc-conn-parts.mjs and tools/soc-conn.mjs (SymbiYosys with Boolector, depth 2; facts §27.21). Crossings are proved to and from the synchronizer only.

The Lab: Two Rows, Then a Pad

This site splits the chip's wiring into 62 parts and proves one part at a time. The smallest is the DMA's two request inputs. Here are its rows, exactly as a learner would submit them:

Part dma-requests: two rows of connect.csv.
from,to,width,clock,power,cross,note
u_uart.rx_ready,u_dma.rx_ready,1,clk_sys,PD_MAIN,,
u_uart.tx_room,u_dma.tx_room,1,clk_sys,PD_MAIN,,

On the good wiring both rows are proved. Rule 3 at work: no stimulus was written. The site then runs the same rows on two altered copies of the top, and all three runs take 0.90 s together. In each copy, one input of the DMA is driven by the inverse of its wire. Each fails:

The first step of each counterexample trace, as the proof returns it.
altered chip A: counterexample
  Step 0  u_uart.rx_ready=0  u_dma.rx_ready=1  u_uart.tx_room=0  u_dma.tx_room=0
altered chip B: counterexample
  Step 0  u_uart.rx_ready=0  u_dma.rx_ready=0  u_uart.tx_room=0  u_dma.tx_room=1

Read the first trace: u_uart.rx_ready = 0, yet u_dma.rx_ready = 1. The tool found a value where the load is not its driver, and named both ends. Leave the first row out, and the proof says so before anything else:

Part dma-requests with only the tx_room row. Rule 4 at work.
one row submitted: 1 unconstrained wire.

Pads are where rules 5 and 6 matter. Part pad-io3 has eight rows. Most are conditional: each holds only when PINMUX selects its function. One of them says the SPI data input equals pad 3 whenever IO3 select is 2.

Part pad-io3. The cross column holds the condition: IO3==2 means PINMUX bits 7:6 equal 2.
from,to,width,clock,power,cross,note
u_gpio.pad_oe[3],u_pads.io_oe[3],1,clk_sys,PD_MAIN,IO3==1,
u_gpio.pad_out[3],u_pads.io_out[3],1,clk_sys,PD_MAIN,IO3==1,
u_pads.io_in[3],u_gpio.pad_in[3],1,clk_sys,PD_MAIN,,
1'b0,u_pads.io_oe[3],1,clk_sys,PD_MAIN,IO3==0,
1'b0,u_pads.io_oe[3],1,clk_sys,PD_MAIN,IO3==2,
1'b0,u_pads.io_oe[3],1,clk_sys,PD_MAIN,IO3==3,
u_pads.io_in[3],u_spi.miso,1,clk_sys,PD_MAIN,IO3==2,
u_pads.io_in[3],u_sync_capture.d,1,clk_sys,PD_MAIN,IO3==3&IO1!=3,

The first altered chip of this part is the seeded fault Q064, met in the fundamentals module. Its serial input samples the clock pad. The proof fails at once. In its first step IO3==2 is 1, pad 3 is 1, and the SPI input is 0. No SPI frame was needed to find it.

The whole chip has the same treatment at stage E4. Its generated harness holds 437 properties. 329 cover the wires of connect.csv and irq.csv, 18 the sources of ap_plic, and 90 the pad functions. That is every wire with a load, in one run.

Why It Is Built This Way

Why not test the wiring in simulation? Because a test proves only the values it drove. A 32-bit bus has more than four billion values, and a crossed bit pair shows only when the two bits differ. A test touches a few values on a few wires. The proof touches all values on every described wire.

Why leave the blocks out? With real blocks inside, the tool would have to reason about a processor, a DMA and a bus fabric. With empty boxes, each property is a few gates deep, so every part proves in under a second. The block benches already checked the insides.

Why generate the top and the properties from one table? Because a hand-written top and a hand-written check can agree with each other and both be wrong. One table makes the intent single. The proof then checks that the generator, and every later hand edit, kept it.

Traps

The first trap is a proof of the wrong table. A team proves the top against connect.csv, but connect.csv itself copied a typo from the block's datasheet. Every property holds, and the chip is still miswired. The proof checks the top against the table, never the table against the intent. Review the table as hard as the RTL.

The second trap is the quiet hole. A designer adds a wire by hand in the top level and forgets the table. The proof still passes, because no row describes that load. That is why the site's proof counts unconstrained destinations, and why the E4 generator refuses a load with no driver.

The third trap is asking a wiring proof about time. A request crosses from the always-on clock through two flip-flops. The proof checks the wire into the synchronizer and the wire out of it. Whether the request arrives two edges later, and survives metastability, needs a sequential property or a crossing check.

At Scale

ap_soc~12 blocks
Phone-class SoChundreds of blocks

This section looks ahead. ap_soc has a few hundred wires; a large chip has far more.

  1. Tables from tools

    Large chips keep connectivity in spreadsheets or IP-XACT, written by integration tools, often with tens of thousands of rows.

  2. Generated properties

    Commercial connectivity apps read those tables and generate the properties, as top-gen.mjs does here.

  3. Every change re-proved

    Each late fix, or ECO, re-runs the proof. A wire moved for timing must still join the same two ends.

Try It

Run it: the crossed pair fails both its rows, and the other two hold.

Change CROSSED to 0 (the predict question below). What does every row print?

Which free values make the first row fail? Find them in the loop.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: row u_uart.rx_ready -> u_dma.rx_ready: counterexample row u_uart.tx_room -> u_dma.tx_room: counterexample row u_uart.irq -> u_plic.irq[1]: holds row u_gpio.irq -> u_plic.irq[2]: holds

Check Yourself

Predict the outputThe toy top level now has no crossed pair (CROSSED = 0). What is the last line printed?
// A toy wiring table of four rows, checked against a toy top level, as a connectivity proof checks each row.
// The top level drives every destination from a source; one pair is crossed when CROSSED is 1.
module tb;
  localparam int CROSSED = 0;
  logic uart_rx_ready, uart_tx_room, gpio_irq, uart_irq;     // sources: block outputs, free
  logic dma_rx_ready, dma_tx_room, plic_irq2, plic_irq1;     // destinations: block inputs
  always_comb begin
    dma_rx_ready = CROSSED ? uart_tx_room : uart_rx_ready;
    dma_tx_room  = CROSSED ? uart_rx_ready : uart_tx_room;
    plic_irq1 = uart_irq;
    plic_irq2 = gpio_irq;
  end
  int failed [4];
  initial begin
    // Every source value at once: 16 combinations of four free outputs. A proof covers them all symbolically.
    for (int v = 0; v < 16; v++) begin
      {uart_rx_ready, uart_tx_room, gpio_irq, uart_irq} = v[3:0];
      #1;
      if (dma_rx_ready !== uart_rx_ready) failed[0]++;
      if (dma_tx_room  !== uart_tx_room)  failed[1]++;
      if (plic_irq1    !== uart_irq)      failed[2]++;
      if (plic_irq2    !== gpio_irq)      failed[3]++;
    end
    $display("row u_uart.rx_ready -> u_dma.rx_ready: %0s", failed[0] ? "counterexample" : "holds");
    $display("row u_uart.tx_room -> u_dma.tx_room: %0s", failed[1] ? "counterexample" : "holds");
    $display("row u_uart.irq -> u_plic.irq[1]: %0s", failed[2] ? "counterexample" : "holds");
    $display("row u_gpio.irq -> u_plic.irq[2]: %0s", failed[3] ? "counterexample" : "holds");
  end
endmodule
ConceptWhat does one row of connect.csv become in the proof?
ConceptWhy are the blocks empty boxes during the proof?
ConceptIn the lab, the proof on chip Q064 reported a counterexample. What did its first step show?
ConceptWhich question can a connectivity proof never answer?

Common Mistakes

Wrong Count the wiring as checked because the block tests pass through it.

A test proves only the values and wires it touched; a crossed pair can hide behind values that agree.

Fix Prove each row of the table, with the blocks as empty boxes.

Wrong Accept a proof without counting the loads that have no row.

A load with no row is unconstrained; any wire there passes.

Fix Require every destination of the part to have a row.

Wrong Ask the wiring proof whether a synchronized request arrives in time.

The proof checks the wire into and out of the synchronizer, not the delay through it.

Fix Use a sequential property or a crossing check for timing.

Remember

  • Each row of connect.csv becomes one property: load equals driver.
  • Blocks are empty boxes, so the proof covers every value with no stimulus.
  • A missing row checks nothing; count the unconstrained loads.
  • Pad functions are conditional rows; time and synchronizers are outside the proof.

Practice

Report a problem with this page