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 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 49<br />

The general case requires a more general layout description, shown in Figure 3.10. Instead<br />

<strong>of</strong> multiplication, the sum function is used to ensure that each block is placed at exactly the<br />

right position and the sum and maxf functions are used to describe the bounding box for the<br />

whole map n R block. Figure 3.9(c) demonstrates that this layout description can cope <strong>with</strong><br />

the irregular example.<br />

It is worth noting that the manually specified height and width for this block are not the<br />

same expressions that would be inferred by the inference algorithm in the previous section.<br />

The inferred height expression would be:<br />

maxf(j = 0..n − 1,width(i[j] ; R ; o[j]) + 0)<br />

and the width expression would be:<br />

maxf(j = 0..n − 1,height(i[j] ; R ; o[j]) +sum(k = 0..j − 1, height(i[k] ; R ; o[k]))<br />

Both <strong>of</strong> these are more complex expressions than the manually specified expressions and this<br />

is the main advantage <strong>of</strong> manually specifying size expressions rather than using the inference<br />

algorithm. It is important to note that they are exactly equivalent (we will develop pro<strong>of</strong>s<br />

<strong>of</strong> this kind <strong>of</strong> relationship in Chapter 4).<br />

3.5.3 A Placed Ripple Adder<br />

A simple example <strong>of</strong> the kind <strong>of</strong> parameterised placed circuit that can be described <strong>with</strong> this<br />

infrastructure is a ripple adder. The code in Figure 3.11 describes an n-bit ripple adder built<br />

from a row <strong>of</strong> full-adder blocks (note that we have assumed that a full-adder block fadd is<br />

available as a library/primitive element <strong>of</strong> size 2 × 1).<br />

This description uses the row combinator, which has been annotated <strong>with</strong> placement infor-<br />

mation, to generate a connected row <strong>of</strong> full adders. The rippleadd block uses the language<br />

construct zip to re-arrange the tuple <strong>of</strong> vectors (a, b) into a vector <strong>of</strong> tuples for application<br />

to the row <strong>of</strong> full adders and uses the wiring block apr (append-right) (in the Quartz prelude<br />

library) to append the carry-out wire to the sum output.

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

Saved successfully!

Ooh no, something went wrong!