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 6. LAYOUT CASE STUDIES 155<br />

block cube (int x, int y, int z, block R (‘a, ‘b, ‘c) ∼ (‘c, ‘b, ‘a))<br />

(‘a x d[z][y], ‘b y d[z][x], ‘c z d[y][x]) ∼<br />

(‘c z r[y][x], ‘b y r[z][x], ‘a x r[z][y]) {<br />

((x d, y d), z d) ;<br />

fst (zip 2) ;<br />

col (z, swap ; rsh ; fst (zip 2) ;<br />

grid (x, y, cube cell (x, R)) ;<br />

snd (converse (zip 2)) ; rsh ; fst swap ; lsh) ;<br />

snd (converse (zip 2)) ;<br />

(z r, (y r, x r)).<br />

}<br />

Figure 6.19: A Quartz description for cube as a column <strong>of</strong> grids<br />

block cube cell (int n, block R (‘a, ‘b, ‘c) ∼ (‘c, ‘b, ‘a))<br />

((‘c z[n], ‘a x), ‘b y) ∼ (‘b y2, (‘c z2[n], ‘a x2)) {<br />

((x,y), z) ;<br />

snd (converse (apl (n−1))) ; rsh ;<br />

fst (tplapr 2 ; R ; converse (tplapl 2) ; swap) ;<br />

lsh ; snd (swap ; apr (n−1)) ;<br />

((y2, x2), z2).<br />

}<br />

Figure 6.20: The cube cell re-wiring block<br />

This cube combinator creates a grid <strong>of</strong> not R blocks but cube cell blocks. This is a wiring<br />

block <strong>with</strong> a description shown in Figure 6.20. It splits the full z vector that has been<br />

“packaged” up <strong>with</strong> the x vector and extracts the signal that is for this element, connects it<br />

to R and then appends the z output <strong>of</strong> R back into the z vector. The whole operation rotates<br />

the z vector as the value is extracted from the left and appended to the right, meaning that<br />

the next block will extract the correct (different) z signal and by the end <strong>of</strong> the row the<br />

resulting z signals are all neatly packed into the vector. Figure 6.21 illustrates this structure.<br />

6.6.2 Describing N-dimensional Combinators<br />

The description in Figure 6.20 uses two new language constructs: tplapl and tplapr. These<br />

are tuple append blocks that function in much the same way as apl and apr do for vectors,<br />

adding or removing elements from the left or right <strong>of</strong> a tuple. These must be defined as<br />

language constructs that are statically parameterised because otherwise they are not valid<br />

<strong>with</strong>in the Quartz type system which requires that tuples are fixed-arity data structures. We

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

Saved successfully!

Ooh no, something went wrong!