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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 2. BACKGROUND AND RELATED WORK 17<br />

Quartz also supports overloading. Overloading, or ad-hoc polymorphism, describes the use<br />

<strong>of</strong> a single identifier to produce different implementations depending on context, the standard<br />

example being the use <strong>of</strong> “+” to represent addition <strong>of</strong> both integers and floating point num-<br />

bers in most programming languages. Quartz blocks can be overloaded by defining multiple<br />

blocks <strong>with</strong> the same name, a mechanism that has a number <strong>of</strong> uses, including:<br />

• Primitive blocks can be overloaded when multiple hardware primitives are available<br />

which essentially carry out the same operation but <strong>with</strong> different types.<br />

• Higher-order combinators can be overloaded when multiple blocks have the same basic<br />

function but different parameterisations, or different non-functional properties.<br />

• Composite blocks can be overloaded <strong>with</strong> primitive ones as “wrappers” around the<br />

primitives e.g. to provide multiple different interfaces to the same functionality.<br />

The inclusion <strong>of</strong> overloading allows the designer to work at a higher level <strong>of</strong> abstraction than<br />

would otherwise be possible. In order to maintain type inference and permit the automatic<br />

resolution <strong>of</strong> overloading <strong>with</strong>out requiring explicit annotations by the designer Quartz uses<br />

a type inference algorithm based on satisfiability matrix predicates [63, 64] – matrices that<br />

represent possible values <strong>of</strong> a type and relationships between type variables. This system<br />

minimises ambiguity and can express n-ary constraints between type variables clearly and<br />

easily.<br />

A key feature <strong>of</strong> the Quartz overloading system is that it permits overloading <strong>of</strong> blocks<br />

<strong>with</strong> overlapping types. This means, for example, that it is possible to overload a fully<br />

polymorphic block <strong>with</strong> type τ ∼ τ <strong>with</strong> specific instances for wire ∼ wire and int ∼ int.<br />

The overloading mechanism will select the most specific matching block to use, so for this<br />

example the instance <strong>with</strong> type wire ∼ wire would be used if wire types were supplied, even<br />

though the polymorphic instance also matches.<br />

Satisfiability matrices can also support blocks <strong>with</strong> different numbers <strong>of</strong> parameters by using<br />

an empty/void type Ω, which can be used to “pad” matrices and block types so that they<br />

are all the same length. Ω only unifies <strong>with</strong> itself so blocks <strong>with</strong> the wrong number <strong>of</strong><br />

parameters are eliminated from the matrix when unification fails. This is a particularly<br />

useful mechanism for overloading blocks <strong>with</strong> versions that are have the same function but

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

Saved successfully!

Ooh no, something went wrong!