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

#define VERTICAL 0<br />

#define HORIZONTAL 1<br />

// Map combinator supporting horizontal and vertical placement<br />

block map (int orientation) (int n, block R ‘a ∼ ‘b) (‘a i [n]) ∼ (‘b o[n])<br />

attributes {<br />

width = if(orientation==1, sum(k=0..n−1, width (i[k] ;R ;<br />

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

height = if(orientation==1, maxf(k=0..n−1, height (i[k] ;R ;<br />

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

} {<br />

int j.<br />

assert (orientation == 1 or orientation == 0) ”Invalid placement specified”;<br />

for j = 0..n−1 {<br />

if (orientation == 0) {<br />

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

} else {<br />

i [j] ; R ; o[j] at (sum(k=0..j−1,width(i[k] ;R ;o[k ])), 0).<br />

} .<br />

} .<br />

}<br />

// Overloaded map block providing default placement interpretation<br />

block map (int n, block R ‘a ∼ ‘b) (‘a i[n]) ∼ (‘b o[n]) → map VERTICAL.<br />

Figure 3.15: Using overloading to provide multiple layout interpretations <strong>of</strong> combinators<br />

be replaced <strong>with</strong> an enumerated type parameter <strong>with</strong> values <strong>of</strong> horizontal or vertical. In this<br />

case the pre-processor definitions <strong>of</strong> the constants could be removed and the parameter-<br />

checking assertion would not be necessary.<br />

This approach can be applied for all combinator blocks which have more than one possible<br />

orientation, for example a row could be laid out vertically or a column could be laid out<br />

horizontally.<br />

3.7 Compiling Placed Quartz Designs<br />

Our goal when compiling Quartz is, where possible, to only partially evaluate the Quartz<br />

description maintaining the maximum possible degree <strong>of</strong> parameterisation in the Pebble<br />

output. When compiling Quartz <strong>with</strong> layout into Pebble relative positioning information<br />

must be eliminated and replaced <strong>with</strong> expressions defining absolute coordinates.

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

Saved successfully!

Ooh no, something went wrong!