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 60<br />

which can not be further simplified <strong>of</strong>:<br />

height = if(n = 0, 0, height(i[0] ; R ; o[0]) + height(i[n − 1..1] ; map n−1 R ; o[n − 1..1]))<br />

width = if(n = 0, 0, max(width(i[0] ; R ; o[0]), width(i[n − 1..1] ; map n−1 R ; o[n − 1..1]))<br />

Without knowing the value <strong>of</strong> n it is not possible to compile away the height() and width()<br />

references in the same way as for iterative size expressions. One strategy for dealing <strong>with</strong><br />

these expressions is to mark them as requiring unwinding in the final output, in which case the<br />

full expression can be evaluated at compile time and non-parameterised Pebble is generated 2 .<br />

Another way for dealing <strong>with</strong> these expressions while maintaining parameterisation is to<br />

compile the recursion directly into Pebble. This requires the addition <strong>of</strong> a fix operator to<br />

Pebble expressions and makes them much more complex. This does resolve the issue and the<br />

recursive Pebble expressions can be compiled into specific VHDL functions for translation<br />

into VHDL (see the next section) however it does introduce unwanted complexity into Pebble.<br />

An alternative, which is not a fully general approach, is to attempt to compute the transitive<br />

closure <strong>of</strong> the recursive size functions. Often recursive blocks are controlled by a single<br />

integer parameter which decreases by 1 for each recursive call and in these circumstances the<br />

resulting value can <strong>of</strong>ten be determined. This approach depends on the complexity <strong>of</strong> the<br />

height and width functions for the R block, however if the size <strong>of</strong> R is constant for all inputs<br />

then the recursive functions can be simplified to just:<br />

height = heightR × n<br />

width = widthR<br />

In general it is better to write iterative descriptions where possible as these can usually be<br />

compiled more efficiently anyway.<br />

2 This is the approach taken in the current implementation <strong>of</strong> the compiler.

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

Saved successfully!

Ooh no, something went wrong!