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 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 42<br />

E :: SizeEnv → BlockEnv → V arEnv → Exp → Exp<br />

Eσ β µ height(x ; bs ; y) =<br />

let (w,h) = SIσ βbs in Eσ β µh(x, y)<br />

Eσ β µ width(x ; bs ; y) =<br />

let (w,h) = SIσ βbs in Eσ β µw(x, y)<br />

Eσ β µ max(e1, e2, . . . , en) =<br />

let e ′ 1 = Eσ β µe1 in<br />

let e ′ 2 = Eσ β µe2 in<br />

.<br />

let e ′ n = Eσ β µen in<br />

max (e ′ 1 , e′ 2 , . . ., e′ n)<br />

Eσ β µ sum(i = e1..e2, f) =<br />

let e ′ 2 = Eσ β µe2 in<br />

if e ′ 2 < Eσ β µe1 then 0<br />

else Eσ β µ{i ↦→ e ′ 2 }f+sum(i = e1..(e ′ 2<br />

Eσ β µ maxf(i = e1..e2, f) =<br />

− 1), f)<br />

let e ′ 1 = Eσ β µe1 in let e ′ 2 = Eσ β µe2 in<br />

if e ′ 2 < e′ 1 then 0<br />

else if e ′ 2 = e′ 1 then {i ↦→ e′ 2 }f<br />

else Eσ β µmax({i ↦→ e ′ 2 }f, maxf(i = e1..(e ′ 2 − 1), f))<br />

Figure 3.3: Semantics <strong>of</strong> size expressions<br />

Pro<strong>of</strong> Theorem 2 is proved by expanding the definitions <strong>of</strong> min and max and re-arranging.<br />

Theorem 3 is proved by analysing the cases where e1 > e2 and e1 ≤ e2 separately. In the<br />

first case, both functions return zero and thus the proposition holds, in the latter case pro<strong>of</strong><br />

is by induction on e2 (<strong>with</strong> a base case <strong>of</strong> e1 = e2) and then re-arrangement using Theorem<br />

2. Mechanised pro<strong>of</strong>s are given as theorems min max corres and minf maxf corres in<br />

Appendix B.11.<br />

3.4.2 Size <strong>of</strong> Block Instantiations<br />

The function SIσ β returns the size functions for a particular block instantiation. It is<br />

parameterised by two environments, σ maps block identifiers to a pair <strong>of</strong> (width, height)<br />

functions, β maps block identifiers to their definition. The function definition can be seen in<br />

Figure 3.4. The semantic function for blocks, Bβ, generates a logical predicate corresponding<br />

to the definition <strong>of</strong> a block identifier, SIσ β uses the function B ′ β which carries out the same<br />

operation for block instantiation statements. These functions are defined in Figure 4.8 on<br />

page 81 however their precise definition is mainly relevant to layout verification in Chapter 4<br />

rather than compilation.

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

Saved successfully!

Ooh no, something went wrong!