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.

APPENDIX D. CIRCUIT LAYOUT CASE STUDIES 269<br />

block mux (int b) (wire s) (wire d0[b], wire d1[b]) ∼ (wire o[b]) {<br />

int j.<br />

for j = 0..b−1 {<br />

(d0[j ], d1[j ]) ; mux lut s ; (o[j ]) at (0, j).<br />

} .<br />

}<br />

block mux ff (wire clk) (int b) (wire s) (wire d0[b], wire d1[b]) ∼ (wire o[b]) {<br />

int j.<br />

for j = 0..b−1 {<br />

(d0[j ], d1[j ]) ; mux lut ff clk s ; (o[j ]) at (0, j).<br />

} .<br />

}<br />

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

wire a geq b[bits+1].<br />

int j.<br />

a geq b[0] = true.<br />

for j = 0..bits−1 {<br />

((a[j ], b[j ]) , a geq b[j]) ; comp lut ;a geq b[j+1] at (0, j).<br />

} .<br />

(b, a) ; mux bits (a geq b[bits]) ; c at (1, 0).<br />

}<br />

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

wire a geq b[bits+1].<br />

int j.<br />

a geq b[0] = true.<br />

for j = 0..bits−1 {<br />

((a[j ], b[j ]) , a geq b[j]) ; comp lut ;a geq b[j+1] at (0, j).<br />

} .<br />

(a, b) ; mux bits (a geq b[bits]) ; c at (1,0).<br />

}<br />

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

int j.<br />

wire match[n+1].<br />

match[0] = true.<br />

for j = 0..n−1 {<br />

(match[j], a[j ], b[j ]) ; and3 ; (match[j+1]) at (0, j).<br />

} .<br />

c = match[n].<br />

}<br />

/∗∗ Insertion sort ∗/<br />

block insert (int bits) (int n) (‘t a, ‘t b[n]) ∼ (‘t c[n+1]) →<br />

row (n, fork ; [min2 bits, max2 bits]) ; apr n.<br />

block lct cell (int bits) ((wire f, ‘t a), ‘t s) ∼ (wire d, (wire f2,‘t a2)) {<br />

wire a eq s.<br />

a2 = a.<br />

d = f.<br />

(a, s) ; eq bits ; a eq s at (0, height((a eq s, f) ;or2 ; f2)).<br />

(a eq s, f) ; or2 ; f2 at (0, 0).<br />

}

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

Saved successfully!

Ooh no, something went wrong!