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.

APPENDIX C. PLACED COMBINATOR LIBRARIES 231<br />

section {* Function definitions *}<br />

consts<br />

struct:: "nat=>((int=>’t106=>’t106=>bool,int=>’t106=>’t106=>int)block)=>(’t106)<br />

vector=>(’t106)vector=>bool"<br />

height:: "nat=>((int=>’t106=>’t106=>bool,int=>’t106=>’t106=>int)block)=>(’t106)<br />

vector=>(’t106)vector=>int"<br />

width:: "nat=>((int=>’t106=>’t106=>bool,int=>’t106=>’t106=>int)block)=>(’t106)<br />

vector=>(’t106)vector=>int"<br />

imap:: "((int*((int=>’t106=>’t106=>bool,int=>’t106=>’t106=>int)block))=>(’t106)<br />

vector=>(’t106)vector=>bool, (int*((int=>’t106=>’t106=>bool,int=>’t106=>’t106<br />

=>int)block))=>(’t106)vector=>(’t106)vector=>int)block"<br />

defs<br />

imap_def: "imap == (| Def = % (n, R) d r. struct (int2nat n) R d r, Height = % (n<br />

, R) d r. height (int2nat n) R d r, Width = % (n, R) d r. width (int2nat n) R<br />

d r |)"<br />

primrec<br />

"struct 0 R d r = (d = r)"<br />

"struct (Suc n) R d r = (<br />

struct n R (d) (r) &<br />

Def (d ;;; R $ (int (Suc n)) ;;; r)<br />

)"<br />

(* Parallel composition laid out vertically, heights add *)<br />

primrec<br />

"height 0 R d r = 0"<br />

"height (Suc n) R d r = (<br />

Height (d ;;; R $ (int (Suc n)) ;;; r) +<br />

height n R (d) (r)<br />

)"<br />

primrec<br />

"width 0 R d r = 0"<br />

"width (Suc n) R d r = (<br />

max (Width (d ;;; R $ (int (Suc n)) ;;; r))<br />

(width n R (d) (r))<br />

)"<br />

section {* Validity <strong>of</strong> width and height functions *}<br />

theorem height_ge0_int [rule_format]: "!! (n::nat) (R::((int=>’t31=>’t31=>bool,int=>’<br />

t31=>’t31=>int)block)). [| n >= 0 ; ALL (qs148::int) (qs149::’t31) (qs150::’t31)<br />

. 0 ’t31=>bool,int=>’<br />

t31=>’t31=>int)block)). [| n >= 0 ; ALL (qs148::int) (qs149::’t31) (qs150::’t31)

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

Saved successfully!

Ooh no, something went wrong!