Verification of Parameterised FPGA Circuit Descriptions with Layout ...
Verification of Parameterised FPGA Circuit Descriptions with Layout ... Verification of Parameterised FPGA Circuit Descriptions with Layout ...
APPENDIX C. PLACED COMBINATOR LIBRARIES 260 by auto end C.5 H-Tree block htree (int n, block R (‘a, ‘a) ∼ ‘a) (‘a i [m]) ∼ (‘a o) { const m = 2 ∗∗ n. ‘a st1 in[m/2], st2 in[m/2], st1 out, st2 out. if n == 0 { o = i[0] . } else { i ; half (m/2) ; (st1 in, st2 in) at (0,0). if (n mod 2 == 0) { // Vertical sub−tree arrangement st1 in ; htree (n−1, R) ; st1 out at (0,0). (st1 out, st2 out) ; R ; o at (0, height(st1 in ; htree (n−1, R) ; st1 out)). st2 in ; htree (n−1, R) ; st2 out at (0, height(st1 in;htree (n−1, R);st1 out) + height ((st1 out, st2 out);R;o )). } else { // Horizontal sub−tree arrangement st1 in ; htree (n−1, R) ; st1 out at (0,0). (st1 out, st2 out) ; R ; o at (width(st1 in ;htree (n−1, R) ; st1 out), 0). st2 in ; htree (n−1, R) ; st2 out at (width(st1 in;htree (n−1, R);st1 out) + width ((st1 out, st2 out);R;o), 0) . } . } . } theory htree = half: section {* Function definitions *} consts struct:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20) vector=>’t20=>bool" height:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20) vector=>’t20=>int" width:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20) vector=>’t20=>int" htree:: "((int*(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block))=>(’t20) vector=>’t20=>bool, (int*(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int) block))=>(’t20)vector=>’t20=>int)block" defs htree_def: "htree == (| Def = % (n, R) i o_. struct (int2nat n) R i o_, Height = % (n, R) i o_. height (int2nat n) R i o_, Width = % (n, R) i o_. width ( int2nat n) R i o_|)"
APPENDIX C. PLACED COMBINATOR LIBRARIES 261 primrec "struct 0 R i o_ = (o_ = i)" "struct (Suc n) R i o_ = (let m = (2 pwr (int (Suc n))) in EX (st1_in::(’t20)vector) (st2_in::(’t20)vector) (st1_out::’t20) (st2_out::’t20). Def (i ;;; half $ (m div 2) ;;; (st1_in, st2_in)) & (if ((Suc n) mod 2) = 0 then (struct n R st1_in st1_out) & Def ((st1_out, st2_out ) ;;; R ;;; o_) & (struct n R st2_in st2_out) else (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & ( struct n R st2_in st2_out)))" primrec "height 0 R i o_ = 0" "height (Suc n) R i o_ = (let m = (2 pwr (int (Suc n))) in let st1_in = (THE (st1_in::(’t20)vector). EX (st2_in::(’t20)vector) (st1_out::’ t20) (st2_out::’t20). Def (i ;;; half $ (m div 2) ;;; (st1_in, st2_in)) & (if ((Suc n) mod 2) = 0 then (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & (struct n R st2_in st2_out) else (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & ( struct n R st2_in st2_out)) ) in let st2_in = (THE (st2_in::(’t20)vector). EX (st1_in::(’t20)vector) (st1_out::’ t20) (st2_out::’t20). Def (i ;;; half $ (m div 2) ;;; (st1_in, st2_in)) & (if ((Suc n) mod 2) = 0 then (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & (struct n R st2_in st2_out) else (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & ( struct n R st2_in st2_out)) ) in let st1_out = (THE (st1_out::’t20). EX (st1_in::(’t20)vector) (st2_in::(’t20) vector) (st2_out::’t20). Def (i ;;; half $ (m div 2) ;;; (st1_in, st2_in)) & (if ((Suc n) mod 2) = 0 then (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & (struct n R st2_in st2_out) else (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & ( struct n R st2_in st2_out)) ) in let st2_out = (THE (st2_out::’t20). EX (st1_in::(’t20)vector) (st2_in::(’t20) vector) (st1_out::’t20). Def (i ;;; half $ (m div 2) ;;; (st1_in, st2_in)) & (if ((Suc n) mod 2) = 0 then (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & (struct n R st2_in st2_out) else (struct n R st1_in st1_out) & Def ((st1_out, st2_out) ;;; R ;;; o_) & ( struct n R st2_in st2_out)) ) in max (Height (i ;;; half $ (m div 2) ;;; (st1_in, st2_in))) (if ((Suc n) mod 2) = 0 then max ((height n R st1_in st1_out) + (Height ((st1_out, st2_out) ;;; R ;;; o_)) + (height n R st2_in st2_out)) ((max ((height n R st1_in st1_out) + (Height ((st1_out, st2_out) ;;; R ;;; o_))) (height n R st1_in st1_out))) else max (height n R st2_in st2_out) ((max (Height ((st1_out, st2_out) ;;; R ;;; o_)) (height n R st1_in st1_out)))) )" primrec "width 0 R i o_ = 0" "width (Suc n) R i o_ = (let m = (2 pwr (int (Suc n))) in
- Page 219 and 220: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 221 and 222: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 223 and 224: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 225 and 226: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 227 and 228: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 229 and 230: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 231 and 232: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 233 and 234: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 235 and 236: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 237 and 238: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 239 and 240: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 241 and 242: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 243 and 244: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 245 and 246: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 247 and 248: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 249 and 250: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 251 and 252: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 253 and 254: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 255 and 256: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 257 and 258: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 259 and 260: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 261 and 262: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 263 and 264: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 265 and 266: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 267 and 268: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 269: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 273 and 274: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 275 and 276: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 277 and 278: APPENDIX C. PLACED COMBINATOR LIBRA
- Page 279 and 280: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 281 and 282: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 283 and 284: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 285 and 286: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 287 and 288: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 289 and 290: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 291 and 292: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 293 and 294: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 295 and 296: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 297 and 298: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 299 and 300: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 301 and 302: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 303 and 304: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 305 and 306: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 307 and 308: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 309 and 310: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 311 and 312: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 313 and 314: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 315 and 316: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 317 and 318: APPENDIX D. CIRCUIT LAYOUT CASE STU
- Page 319 and 320: APPENDIX D. CIRCUIT LAYOUT CASE STU
APPENDIX C. PLACED COMBINATOR LIBRARIES 260<br />
by auto<br />
end<br />
C.5 H-Tree<br />
block htree (int n, block R (‘a, ‘a) ∼ ‘a) (‘a i [m]) ∼ (‘a o)<br />
{<br />
const m = 2 ∗∗ n.<br />
‘a st1 in[m/2], st2 in[m/2], st1 out, st2 out.<br />
if n == 0 {<br />
o = i[0] .<br />
} else {<br />
i ; half (m/2) ; (st1 in, st2 in)<br />
at (0,0).<br />
if (n mod 2 == 0) {<br />
// Vertical sub−tree arrangement<br />
st1 in ; htree (n−1, R) ; st1 out<br />
at (0,0).<br />
(st1 out, st2 out) ; R ; o<br />
at (0, height(st1 in ; htree (n−1, R) ; st1 out)).<br />
st2 in ; htree (n−1, R) ; st2 out<br />
at (0, height(st1 in;htree (n−1, R);st1 out) + height ((st1 out, st2 out);R;o<br />
)).<br />
} else {<br />
// Horizontal sub−tree arrangement<br />
st1 in ; htree (n−1, R) ; st1 out<br />
at (0,0).<br />
(st1 out, st2 out) ; R ; o<br />
at (width(st1 in ;htree (n−1, R) ; st1 out), 0).<br />
st2 in ; htree (n−1, R) ; st2 out<br />
at (width(st1 in;htree (n−1, R);st1 out) + width ((st1 out, st2 out);R;o), 0)<br />
.<br />
} .<br />
} .<br />
}<br />
theory htree = half:<br />
section {* Function definitions *}<br />
consts<br />
struct:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20)<br />
vector=>’t20=>bool"<br />
height:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20)<br />
vector=>’t20=>int"<br />
width:: "nat=>(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block)=>(’t20)<br />
vector=>’t20=>int"<br />
htree:: "((int*(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)block))=>(’t20)<br />
vector=>’t20=>bool, (int*(((’t20*’t20)=>’t20=>bool,(’t20*’t20)=>’t20=>int)<br />
block))=>(’t20)vector=>’t20=>int)block"<br />
defs<br />
htree_def: "htree == (| Def = % (n, R) i o_. struct (int2nat n) R i o_, Height =<br />
% (n, R) i o_. height (int2nat n) R i o_, Width = % (n, R) i o_. width (<br />
int2nat n) R i o_|)"