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

Modifications are necessary to the type system to provide this kind <strong>of</strong> support. One possibility<br />

is to provide a full system <strong>of</strong> dependent types, where the type <strong>of</strong> a signal could depend on a<br />

variable value. This complicates type inference - making it undecidable - and would require<br />

the designer to write complex type declarations.<br />

A better alternative is to achieve the same power by introducing the much simpler construct<br />

<strong>of</strong> enumerated types. These are standard constructs in many programming languages, which<br />

allow programmers to specify their own types using type constructors. Functional program-<br />

ming languages usually provide easy-to-use support for recursive types and these are used to<br />

define recursive data structures such as linked lists and trees. We do not require recursive<br />

types – merely the ability for a value that can have multiple interpretations to have a simple<br />

type.<br />

We could define a data type which could be declared by (in pseudo-code):<br />

type data =<br />

Known <strong>of</strong> bool<br />

Wire <strong>of</strong> wire.<br />

Values <strong>of</strong> type data would then be used in circuit descriptions, rather than wire or bool, and<br />

the specific value would be extracted by the block itself. Figure 5.9 illustrates what an or2<br />

block that used this mechanism could look like. Because static and dynamic values now have<br />

the same type we are no longer able to use the overloading mechanism to select between<br />

instances and instead this or2 block contains code to generate the correct output regardless<br />

<strong>of</strong> whether zero, one or both inputs are known. This block <strong>with</strong> specialising code can however<br />

be overloaded <strong>with</strong> the hardware primitive <strong>with</strong> type wire wire ∼ wire and the type system<br />

can determine which block to instantiate.<br />

In this description “Wire” and “Known” are used as both an access function, to retrieve the<br />

wire value attached to the data inputs a and b and as a constructor, and a constructor, to<br />

be pattern matched. It may be that there is a more appropriate syntax, however it is the<br />

concept that matters.<br />

This system can be used to achieve optimal constant propagation results and verification is<br />

still relatively easy using a suitable model in an automatic theorem prover.

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

Saved successfully!

Ooh no, something went wrong!