24.04.2013 Views

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 85<br />

CON T :: Block → Bool<br />

CON T block bid d1 . . . dn ∼ r { τ1 id1 . . . τp idp. stmts } =<br />

∀d1 . . . dn r. S ∅stmts ⇒ SCON T ′ stmts<br />

SCON T ′ :: StmtList → Bool<br />

SCON T ′<br />

β stmt1 . . . stmtn =<br />

let c1 = SCON T stmt1 in<br />

.<br />

let cn = SCON T stmtn in<br />

c1 ∧ . . . ∧ cn<br />

SCON T :: Stmt → Bool<br />

SCON T assert e str = True<br />

SCON T e1 = e2 = True<br />

SCON T if e { stmts1 } else { stmts2 } =<br />

if e then SCON T ′ stmts1 else SCON T ′ stmts2<br />

SCON T for i = e1..e2 { stmts } =<br />

∀i. e1 ≤ i ≤ e2 −→ SCON T ′ stmts<br />

SCON T a ; blkinst ; b at (x, y) =<br />

(0 ≤ x) ∧ (0 ≤ y) ∧<br />

(x + Width(a ; blkinst ; b) ≤ widthd1 . . .dn r) ∧<br />

(y + Height(a ; blkinst ; b) ≤ heightd1 . . . dn r)<br />

Figure 4.10: Generating containment theorems<br />

type inference, ensuring that the Isabelle types are correct. The semantic interpretation <strong>of</strong><br />

the block is generated as a set <strong>of</strong> assumptions, defining assertions and possibly determining<br />

the values <strong>of</strong> internal signals (none in the case <strong>of</strong> map ).<br />

Intersection theorems are the most complex. They are generated for each block instantiation<br />

except the first, checking intersection against the previous statements. Figure 4.11 gives the<br />

algorithm that generates intersection pro<strong>of</strong> obligations. At first glance this appears quite<br />

complex, however its structure is really quite simple. The compiler makes a forward pass<br />

through the block statements, accumulating statements that have already been processed in<br />

the list φ. For each block instantiation that is encountered the least and maximum x and<br />

y co-ordinates are identified and are then compared <strong>with</strong> the equivalent co-ordinates for all<br />

blocks previously instantiated. This implements Definition 7, as can be most clearly seen in<br />

the last clause <strong>of</strong> function IN T ERSECT .<br />

An important case is the handling <strong>of</strong> for loops by the function SIN T ERφ. This generates<br />

two set <strong>of</strong> requirements - that the elements <strong>with</strong>in a loop don’t intersect <strong>with</strong> previously<br />

instantiated blocks and that the elements <strong>with</strong>in the loop don’t intersect <strong>with</strong> each other. This

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!