Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ... Verification of Parameterised FPGA Circuit Descriptions with Layout ...

24.04.2013 Views

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 96 2.ÎnRna. ∀ qs137 qs138 qs139. 0 ≤ Height (qs138 ;;; R $ qs137 ;;; qs139); ∀ qs137 qs138 qs139. 0 ≤ Width (qs138 ;;; R $ qs137 ;;; qs139); ∀ l t b r. 0 ≤ irow.width na R l t b r =⇒ ∀ l t b r. 0 ≤ irow.width (Suc na) R l t b r The proof should now be completed by auto intro: width ser ge0, however the automatic proof tools do not work in this case. We can however prove the base case and expand the induction case using only the simplifier: > apply (simp, simp) goal (theorem (width ge0 int), 1 subgoal): 1.ÎRna. ∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba); ∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba); ∀ l t b r. 0 ≤ irow.width na R l t b r =⇒ ∀ l t b r. 0 ≤ Width (snd.snd $ (converse.converse $ (apr $ int na)) ;; beside $ ((| Def = λb c. arbitrary, Height = λb c. arbitrary, Width = λ(l, t). split (irow.width na R l t) |), R $ int na + 1) ;; fst . fst $ (apr $ int na)) (l, t) (b, r) We can apply the width ser ge0 rule manually, after removing the universal quantifiers, which splits the goal into three sub-goals: > apply (rule allI )+ > apply (rule width ser ge0)+ goal (theorem (width ge0 int), 3 subgoals): 1.ÎRna l t b r x y xa ya. ∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba); ∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba); ∀ l t b r. 0 ≤ irow.width na R l t b r

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 97 =⇒ 0 ≤ Width (snd.snd $ (converse.converse $ (apr $ int na))) xa ya 2.ÎRna l t b r x y xa ya. ∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba); ∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba); ∀ l t b r. 0 ≤ irow.width na R l t b r =⇒ 0 ≤ Width (beside $ ((| Def = λb c. arbitrary, Height = λb c. arbitrary, Width = λ(l, t). split (irow.width na R l t) |), R $ int na + 1)) xa ya 3.ÎRna l t b r x y. ∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba); ∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba); ∀ l t b r. 0 ≤ irow.width na R l t b r =⇒ 0 ≤ Width (fst.fst $ (apr $ int na)) x y The proof can then be completed by auto. Similar techniques can be adopted for other proofs, although not all will require induction (the containment theorem for irow does not). Note that we have not required any properties of maxf or sum - these functions are used when describing the layout of iteratively defined blocks and are not needed for recursively defined combinators. We also attempted proofs for manually specified size functions which expanded the definitions of apr and apl etc, referring to explicit vector indexes. These are simpler expressions than the full expressions produced by the inference algorithm, however a slightly unexpected result is that this substantially complicates the proofs. Proof now requires expansion of the definitions of intermediate signals within the series compositions to check that there is a correspondence between the values produced by the usages of the append blocks and those that are manually specified. This should be a simple process but it is not because of the way blocks are defined as logical predicates rather than functions. The usage of block predicates to define values bound by the define description operator requires the elimination of definite descriptions to extract the real value. This is a significant

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 97<br />

=⇒ 0 ≤ Width (snd.snd $ (converse.converse $ (apr $ int na))) xa ya<br />

2.ÎRna l t b r x y xa ya.<br />

∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba);<br />

∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba);<br />

∀ l t b r. 0 ≤ irow.width na R l t b r <br />

=⇒ 0 ≤ Width<br />

(beside $<br />

((| Def = λb c. arbitrary, Height = λb c. arbitrary,<br />

Width = λ(l, t). split (irow.width na R l t) |),<br />

R $ int na + 1))<br />

xa ya<br />

3.ÎRna l t b r x y.<br />

∀ qs137 a b aa ba. 0 ≤ Height R qs137 (a, b) (aa, ba);<br />

∀ qs137 a b aa ba. 0 ≤ Width R qs137 (a, b) (aa, ba);<br />

∀ l t b r. 0 ≤ irow.width na R l t b r <br />

=⇒ 0 ≤ Width (fst.fst $ (apr $ int na)) x y<br />

The pro<strong>of</strong> can then be completed by auto. Similar techniques can be adopted for other pro<strong>of</strong>s,<br />

although not all will require induction (the containment theorem for irow does not). Note<br />

that we have not required any properties <strong>of</strong> maxf or sum - these functions are used when<br />

describing the layout <strong>of</strong> iteratively defined blocks and are not needed for recursively defined<br />

combinators.<br />

We also attempted pro<strong>of</strong>s for manually specified size functions which expanded the definitions<br />

<strong>of</strong> apr and apl etc, referring to explicit vector indexes. These are simpler expressions than the<br />

full expressions produced by the inference algorithm, however a slightly unexpected result is<br />

that this substantially complicates the pro<strong>of</strong>s. Pro<strong>of</strong> now requires expansion <strong>of</strong> the definitions<br />

<strong>of</strong> intermediate signals <strong>with</strong>in the series compositions to check that there is a correspondence<br />

between the values produced by the usages <strong>of</strong> the append blocks and those that are manually<br />

specified. This should be a simple process but it is not because <strong>of</strong> the way blocks are defined<br />

as logical predicates rather than functions.<br />

The usage <strong>of</strong> block predicates to define values bound by the define description operator<br />

requires the elimination <strong>of</strong> definite descriptions to extract the real value. This is a significant

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

Saved successfully!

Ooh no, something went wrong!