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 5. SPECIALISATION 111<br />

// Hardware primitive<br />

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

// Specialising when both inputs are known<br />

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

→ c = (a and b).<br />

// Specialising when one input is known<br />

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

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

block and2 (wire a, bool b) ∼ (wire c) → (b, a) ; and2 ; c.<br />

Figure 5.2: Distributed specialisation <strong>of</strong> an and2 block<br />

A B Q<br />

0 0 0<br />

0 1 1<br />

1 0 1<br />

1 1 0<br />

(a) 2-input<br />

B Q<br />

0 1<br />

1 0<br />

(b) A=true<br />

B Q<br />

0 0<br />

1 1<br />

(c) A=false<br />

Figure 5.3: Exclusive-or gate truth tables<br />

A slightly more complicated example is an exclusive-or function. The full and specialised<br />

truth tables for this block are given in Figure 5.3. Here the relationship between B and Q<br />

when A is known is slightly different, if A is false then Q = B however if A is true then Q is<br />

B inverted. Distributed specialisation can describe xor2 blocks which enclose this behaviour,<br />

either connecting the two signals together or generating a simple inverter rather than a full<br />

xor gate. Figure 5.4 shows the Quartz description for xor specialisation.<br />

This example is a particularly significant one because it demonstrates how conditionals in<br />

size expressions can be used to reflect the specialisation in the layout <strong>of</strong> a circuit. These size<br />

expressions will be propagated through the circuit to create a size expression for the overall<br />

circuit which is dependent on the value <strong>of</strong> the static parameter.<br />

Specialising the xor2 gate to an inverter does not actually save any logic area on an <strong>FPGA</strong>,<br />

since logic functions are implemented by look-up tables, however if realised on an ASIC the<br />

difference between 8 transistors to implement an xor function and 2 to implement an inverter<br />

is definitely worth having.

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

Saved successfully!

Ooh no, something went wrong!