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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 84<br />

∀ d1 . . . dn r.<br />

<br />

(∀(A :: block d A 1 . . . dA m ∼ rA ) ∈ {d1, . . .,dn, r}.<br />

∀ d A 1 . . .d A m r A . 0 ≤ HeightA d A 1 . . . d A m r A ) ∧<br />

<br />

(∀ c ∈ assertions(B). c) ⇒<br />

0 ≤ HeightB d1 . . . dn r<br />

The width theorem is similar, <strong>with</strong> width functions substituted for height functions 1 .<br />

The validity theorems for each block’s height and width function are given the names<br />

height ge0 and width ge0 and can be used in other theories. It is common to require these<br />

pro<strong>of</strong>s when determining the validity <strong>of</strong> size functions for blocks that use them.<br />

Containment theorems are generated for each statement that involves block instantiations,<br />

stating that the leftmost bottom point <strong>of</strong> each block is greater than <strong>of</strong> equal to (0, 0) and<br />

the top rightmost is less than or equal to (width, height) for all possible values <strong>of</strong> block<br />

parameters (provided assertions are met). The recursive descent algorithm that calculates<br />

containment theorems is shown in Figure 4.10.<br />

For the map n R combinator this generates a containment theorem <strong>of</strong>:<br />

theorem "Î(n::int) (R::((’t395⇒ ’t396⇒ bool,’t395⇒ ’t396⇒ int)block)) (i::(’t395)vector) (o<br />

::(’t396)vector). ∀ (j::int). ((0 ≤ j) ∧ (j ≤ (n − 1))) −→ Def (i ;;; R ;;; o ) ; ∀ (<br />

qs691::’t395) (qs692::’t396). 0 ≤ (Height (qs691 ;;; R ;;; qs692)) ; ∀ (qs691 ::’ t395) (qs692<br />

::’ t396). 0 ≤ (Width (qs691 ;;; R ;;; qs692)) =⇒<br />

∀ (j :: int). ((0 ≤ j) ∧ (j ≤ (n − 1))) −→ (((0::int) ≤ 0) ∧ (0 ≤ sum (0, j − 1, λqs403.<br />

Height (i ;;; R ;;; o ))) ∧ ((0 + (Width (i ;;; R ;;; o ))) ≤ (<br />

maxf (0, n − 1, λqs401. Width (i ;;; R ;;; o )))) ∧ ((sum (0, j − 1, λ<br />

qs403. Height (i ;;; R ;;; o )) + (Height (i ;;; R ;;; o ))) ≤<br />

sum (0, n − 1, λqs402. Height (i ;;; R ;;; o ))))"<br />

Note that the Quartz compiler has annotated the Isabelle theory <strong>with</strong> the results <strong>of</strong> its own<br />

1 Actually the Isabelle module generates 4 validity theorems, in two different representations. This is done<br />

because a size function can be evaluated either as (Height A) p1 . . . pn or as Height(pn−1 ; A p1 . . . pn−2 ; pn).<br />

Both <strong>of</strong> these are precisely equivalent and the compiler automatically generates a pro<strong>of</strong> for one in terms <strong>of</strong><br />

the other, requiring the designer to only prove 2 <strong>of</strong> the theorems manually. It was originally felt that both<br />

representations could be useful in pro<strong>of</strong>s however it has emerged that one format is the most useful and thus<br />

the other 2 theorems are essentially redundant.

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

Saved successfully!

Ooh no, something went wrong!