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 D. CIRCUIT LAYOUT CASE STUDIES 295<br />

}<br />

wire o2.<br />

i ; R ; o2 at (0,0).<br />

o2 ; fd clk ; o at (0,0).<br />

block and3 (wire a, wire b, wire c) ∼ (wire d)<br />

attributes { height = 1. width = 1. }{ }<br />

block mux lut (wire s) (wire d0, wire d1) ∼ (wire o)<br />

attributes { height = 1. width = 1. }{ }<br />

block gr lut ((wire a, wire b), (wire is gr, wire is eq)) ∼ (wire is gr2)<br />

attributes { height = 1. width = 1. }{ }<br />

block eq lut ((wire a, wire b), wire is eq) ∼ (wire is eq2)<br />

attributes { height = 1. width = 1. }{ }<br />

block comp elem ((wire a, wire b), (wire is gr, wire is eq)) ∼ (wire is gr2, wire is eq2) {<br />

((a, b), (is gr, is eq)) ; gr lut ; is gr2 at (0, 0).<br />

((a, b), is eq) ; eq lut ; is eq2 at (1, 0).<br />

}<br />

block comparator (int bits) (wire a[bits ], wire b[bits ]) ∼ (wire a gr b) {<br />

wire zero, one.<br />

zero = false. one = true.<br />

((a, b), (zero, one)) ; fst (zip 2) ; rdr (bits, comp elem) ;pi1 ; a gr b at (0,0).<br />

}<br />

/∗ Two input sorting circuit <strong>with</strong> output register ∗/<br />

block sort2 (wire clk) (int bits) (wire a[bits ], wire b[bits ]) ∼<br />

(wire min val[bits], wire max val[bits]) {<br />

wire a gr b.<br />

(a, b) ; comparator (bits) ; a gr b at (0,0).<br />

(a, b) ; zip 2 ; map (bits, register clk (mux lut a gr b)) ;min val at (width((a, b) ;<br />

comparator (bits) ; a gr b), 0).<br />

(b, a) ; zip 2 ; map (bits, register clk (mux lut a gr b)) ;max val at (width((a, b) ;<br />

comparator (bits) ;a gr b) + width((a, b) ;zip 2 ; map (bits, mux lut a gr b) ;<br />

min val), 0).<br />

}<br />

block vecpair (‘a i [2]) ∼ (‘a o1, ‘a o2) → (o1, o2) = (i [0], i [1]) .<br />

/∗ Combinator describing an arbitrary butterfly network ∗/<br />

block butterfly (int n, block R (‘a, ‘a) ∼ (‘a, ‘a)) (‘a l[m]) ∼ (‘a r[m]) {<br />

const m = 2 ∗∗ n.<br />

l ; rcomp (n,<br />

riffle (m/2) ;<br />

pair (m/2) ;<br />

map (m/2, vecpair ; R ; converse (vecpair)) ;<br />

converse (pair (m/2))<br />

)<br />

; r.<br />

}<br />

/∗ Pipelined bitonic merger ∗/<br />

block merger (int n) (wire a[m/2], wire b[m/2]) ∼ (wire c[m]) {<br />

const m = 2∗∗n.

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

Saved successfully!

Ooh no, something went wrong!