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.

CHAPTER 5. SPECIALISATION 118<br />

block or2 (bool a, wire b) ∼ (wire c) attributes { width = 0. height = 0. }<br />

→ if a { c = true. } else { c = b. } .<br />

block or2 (wire a, bool b) ∼ (wire c)<br />

→ (b, a) ; or2 ; c.<br />

Figure 5.8: Distributed specialisation for an or2 block<br />

the dynamic input or statically assign it to some value, depending on the value <strong>of</strong> the static<br />

input.<br />

For or2, c is connected to b if a is false, and connected to ground otherwise. Because c is<br />

connected to a wire in one branch <strong>of</strong> the conditional it must itself have a wire type since it<br />

is not possible to assign wire values to any other type. The assignment c = true used in<br />

the other branch uses the overloaded signal connection operator, which allows static boolean<br />

values to be assigned to wires.<br />

This block correctly specialises itself, however it does not allow a propagation <strong>of</strong> the constant<br />

value. If a is true, the more optimal solution is to produce a boolean output c assigned <strong>with</strong><br />

the value true. This would then allow blocks connected to the c output <strong>of</strong> or2 to properly<br />

specialise themselves, whereas <strong>with</strong> this block description other blocks assume that the value<br />

<strong>of</strong> c is unknown.<br />

5.3.2 Modified Type System<br />

To achieve proper propagation <strong>of</strong> the constant, c would need to be typed as a boolean if a<br />

is true and as a wire otherwise. This is impossible in a statically typed language like Quartz<br />

where types are determined by an inference process prior to the program executing.<br />

This problem also occurs at the combinator level. When the col combinator is used to<br />

connect together multiple fadd blocks it requires that the fadd block has a type <strong>of</strong> the form<br />

(α, β) ∼ (β, γ) - that is that the top and bottom connections must have the same type so they<br />

can be connected together. This means that it is not possible for the carry signal moving up<br />

the column to alternate between bool and wire types, depending on whether the carry value is<br />

known. Nor is it possible to take account <strong>of</strong> the fact that, in our ripple adder implementation,<br />

the initial carry-in input is always zero and use this to simplify the first full adder.

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

Saved successfully!

Ooh no, something went wrong!