Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ... Verification of Parameterised FPGA Circuit Descriptions with Layout ...

24.04.2013 Views

CHAPTER 6. LAYOUT CASE STUDIES 156 x_in y_in R x_out z_in z_out y_out Figure 6.21: The cube cell wiring block have implemented tplapl and tplapr using the Quartz compiler infrastructure for defining new experimental language constructs. The tuple-append operations do exhibit some interesting behaviour because of the way they interact with other aspects of the Quartz type system, in particular the typing rule which treats a singleton as equivalent to a single-element tuple. For example, the operation tplapl 1 or tplapr 1 applied to a pair leaves the pair unchanged – the effect is to append the left or right element to the single element tuple of the other element forming a new pair within the original tuple, which is then eliminated because it only contains a single element (the pair). For tplapl the process looks a little like: (a, b) −→ ((a), b) −→ ((a, b)) −→ (a, b) The tuple-append operators allow us to decompose an n-tuple into a pair of the leftmost/right- most element and the rest of the tuple. Once this has been done we can use standard oper- ations on pairs to manipulate the tuple. They are vital in allowing us to generalise the 3D combinator we have developed in this section into an n-dimensional meta-combinator, nd . We describe this as a meta-combinator because it is not itself a valid Quartz combinator since it is parameterised in its number of dimensions and utilises tuples of parameterisable lengths, something that is not valid in the Quartz type system. Each possible instance is a valid combinator but must be described individually. It has been designed to use point-free wiring constructs in order to achieve its generality and thus could be a valid construct in the untyped Ruby calculus. The limiting influence of type systems in specification languages has

CHAPTER 6. LAYOUT CASE STUDIES 157 nd2 (i1, i2) R = coli2 (rowi1 R) ndn (i1, . . .,in) R = tplaprn−1 −1 ; fst (zip n−1 ) ; colin swap ; snd tplapln−2 −1 ; rsh ; fst (zip 2,n−2 ) ; tplapln−2 ; ndn−1 (i1, . . .,in−1) (ndcelln (x, R)) ; tplaprn−2 −1 −1 ; snd(zip2,n−2 ; swap) ; rsh ; swap ; snd tplaprn−2 ; snd(zip n−1 −1 ) ; tplapln−1 ndcelln (m, R) = tplapln−2 −1 ; fstswap ; lsh ; sndswap ; rsh ; fst tplapln−2 ; been much discussed [38]. snd(aplm−1 −1 ) ; tplapl2 ; tplapr2 −1 ; fst (tplaprn−1 ; R ; tplaprn−1 −1 ; swap) ; lsh ; snd(swap ; aprm−1) ; fst tplaprn−2 −1 ; lsh ; sndswap ; tplaprn−2 Figure 6.22: Description of an n-dimensional meta-combinator Figure 6.22 illustrates our n-dimensional combinator description. This combinator is defined recursively with a base case of n = 2 (grid ). For n = 3 the description of nd simplifies to that of cube and ndcell simplifies to the description of cube cell. The definition of an n-dimensional combinator description raises the tantalising possibility of being able to prove theorems for all higher-dimensional combinators as a single theorem. For example, we could prove a theorem that could totally pipeline an n-dimensional array taking the pipelining theorem for a grid as the base case. Alternatively we could investigate how to serialise [45] higher-dimensional descriptions into lower dimensional ones (e.g. converting a 4D description into 3D, 2D, 1D equivalents with appropriate multiplexers to manipulate the input signals). Unfortunately, the descriptions of nd and ndcell themselves are complex and fiddly, even though most individual steps are just describing simple wiring re-arrangements. Since most of the commands are simple wiring they are easy to reason about, for example tplapl and tplapr are timeless and thus registers can be moved through them easily. The complex description does seem to suggest that it could be a candidate for employing mechanised theorem proving.

CHAPTER 6. LAYOUT CASE STUDIES 157<br />

nd2 (i1, i2) R = coli2 (rowi1 R)<br />

ndn (i1, . . .,in) R = tplaprn−1 −1 ; fst (zip n−1 ) ; colin<br />

swap ; snd tplapln−2 −1 ; rsh ; fst (zip 2,n−2 ) ;<br />

tplapln−2 ; ndn−1 (i1, . . .,in−1) (ndcelln (x, R)) ;<br />

tplaprn−2 −1 −1<br />

; snd(zip2,n−2 ; swap) ; rsh ;<br />

<br />

swap ; snd tplaprn−2 ;<br />

snd(zip n−1 −1 ) ; tplapln−1<br />

ndcelln (m, R) = tplapln−2 −1 ; fstswap ; lsh ; sndswap ; rsh ; fst tplapln−2 ;<br />

been much discussed [38].<br />

snd(aplm−1 −1 ) ; tplapl2 ; tplapr2 −1 ;<br />

fst (tplaprn−1 ; R ; tplaprn−1 −1 ; swap) ;<br />

lsh ; snd(swap ; aprm−1) ; fst tplaprn−2 −1 ;<br />

lsh ; sndswap ; tplaprn−2<br />

Figure 6.22: Description <strong>of</strong> an n-dimensional meta-combinator<br />

Figure 6.22 illustrates our n-dimensional combinator description. This combinator is defined<br />

recursively <strong>with</strong> a base case <strong>of</strong> n = 2 (grid ). For n = 3 the description <strong>of</strong> nd simplifies to<br />

that <strong>of</strong> cube and ndcell simplifies to the description <strong>of</strong> cube cell.<br />

The definition <strong>of</strong> an n-dimensional combinator description raises the tantalising possibility <strong>of</strong><br />

being able to prove theorems for all higher-dimensional combinators as a single theorem. For<br />

example, we could prove a theorem that could totally pipeline an n-dimensional array taking<br />

the pipelining theorem for a grid as the base case. Alternatively we could investigate how to<br />

serialise [45] higher-dimensional descriptions into lower dimensional ones (e.g. converting a<br />

4D description into 3D, 2D, 1D equivalents <strong>with</strong> appropriate multiplexers to manipulate the<br />

input signals).<br />

Unfortunately, the descriptions <strong>of</strong> nd and ndcell themselves are complex and fiddly, even<br />

though most individual steps are just describing simple wiring re-arrangements. Since most<br />

<strong>of</strong> the commands are simple wiring they are easy to reason about, for example tplapl and tplapr<br />

are timeless and thus registers can be moved through them easily. The complex description<br />

does seem to suggest that it could be a candidate for employing mechanised theorem proving.

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

Saved successfully!

Ooh no, something went wrong!