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 74<br />

record (’a,’b)block =<br />

Def :: "’a"<br />

Height :: "’b"<br />

Width :: "’b"<br />

constdefs<br />

ap :: "[(’ a⇒ ’b,’a⇒ ’c)block,’a]⇒ (’b,’c)block"<br />

( infixl "$" 49)<br />

"ap ≡ λB x. (| Def = Def B x, Height = Height B x, Width = Width B x |)"<br />

constdefs<br />

inst :: "[’a, (’a⇒ ’b⇒ bool,’a⇒ ’b⇒ int)block,’b]⇒ (bool, int)block"<br />

(" ;;; ;;; " [45, 46, 47] 45)<br />

"inst ≡ (λ x B y. (| Def = Def B x y, Height = Height B x y, Width = Width B x y |))"<br />

Figure 4.4: Part <strong>of</strong> the Quartz<strong>Layout</strong> theory <strong>of</strong> blocks<br />

Because Quartz blocks are relational, rather than functional, we must model block semantics<br />

as logical predicates on their domain and range signals. A predicate block returns the boolean<br />

true for all valid combinations <strong>of</strong> inputs and outputs and false for invalid combinations. This<br />

means that a predicate can not calculate a block’s output values from its inputs in the same<br />

way as a function, however it can confirm that values are correct. Within block semantic<br />

definitions, internal signals can be represented using existential quantifiers ∃ (written “EX”<br />

in Isabelle/HOL).<br />

We model block size functions, rather than size expressions. A size function includes the<br />

block’s semantic definition <strong>with</strong>in it to define the values <strong>of</strong> any internal variables, bound<br />

using the definite description operator.<br />

A block is modelled as a record consisting <strong>of</strong> a logical predicate, height function and width<br />

function, as shown in Figure 4.4. A block <strong>with</strong> type δ1 δ2 . . .δn ∼ ρ will be modelled as a<br />

record <strong>of</strong> type (δ1 → δ2 → · · · → δn → ρ → bool, δ1 → δ2 → · · · → δn → ρ → int)block.<br />

While the general form <strong>of</strong> the type is the same for both the size functions (which return<br />

integers) and the semantic definition predicate (which returns a boolean) they have to be<br />

defined separately because <strong>of</strong> the way types are described.<br />

Two operations are defined on block records to model the behaviour described by statements<br />

<strong>of</strong> the type a ; bid p1 . . .pn ; b. Block application describes the application <strong>of</strong> an inner<br />

(curried) parameter to a block. So as not to confuse this <strong>with</strong> HOL function application<br />

in Quartz<strong>Layout</strong> this requires the use <strong>of</strong> a dollar sign operator. The block instantiation

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

Saved successfully!

Ooh no, something went wrong!