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 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 41<br />

〈expr〉 ::= 〈expr〉 〈bop〉 〈expr〉<br />

| 〈uop〉 〈expr〉<br />

| 〈var〉<br />

| 〈num〉<br />

| true | false<br />

| height ( 〈blkinst〉 )<br />

| width ( 〈blkinst〉 )<br />

| max ( 〈expr〉, 〈expr〉 (, 〈expr〉)* )<br />

| if ( 〈expr〉 , 〈expr〉 , 〈expr〉 )<br />

| sum ( 〈id〉 = 〈expr〉 .. 〈expr〉 , 〈expr〉 )<br />

| maxf ( 〈id〉 = 〈expr〉 .. 〈expr〉 , 〈expr〉 )<br />

〈bop〉 ::= and | or | nand | nor | xor | xnor<br />

| + | - | * | / | ** | mod | == | !=<br />

| < | | >=<br />

〈uop〉 ::= - | abs | not<br />

Figure 3.2: Grammar <strong>of</strong> Quartz expressions<br />

once again returning zero if the lower bound is greater than the upper bound.<br />

More formally, the semantics <strong>of</strong> Quartz expressions are described by the evaluation function<br />

E. The clauses describing the semantics <strong>of</strong> the new operations are shown in Figure 3.3.<br />

The concept <strong>of</strong> a “function” is kept clearly restricted to block height and width expressions,<br />

while elsewhere the semantics are based on substitution (shown as {a ↦→ b}) rather than<br />

λ-abstraction. This distinction exists because Quartz expressions must be compiled into<br />

Pebble/VHDL expressions <strong>with</strong>out functions, λ-calculus like semantics are restricted to block<br />

size functions since these will be eliminated during Quartz compilation. We will show in<br />

Chapter 4 how λ-calculus style functions can be used to achieve the same semantics.<br />

Note that we have extended expressions <strong>with</strong> max and maxf operators but have not included<br />

their duals min and minf. While this might be desirable in the interests <strong>of</strong> symmetry actu-<br />

ally we do not require minimum-finding operations for generating layouts and in any event<br />

expressions using these functions can be manipulated to eliminate them using the following<br />

two relationships:<br />

Theorem 2 ∀a b. min(a, b) = −max(−a, −b)<br />

Theorem 3 ∀e1 e2 e3. minf(i = e1..e2, e3) = −maxf(i = e1..e2, −e3)

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

Saved successfully!

Ooh no, something went wrong!