Verification of Parameterised FPGA Circuit Descriptions with Layout ...
Verification of Parameterised FPGA Circuit Descriptions with Layout ... Verification of Parameterised FPGA Circuit Descriptions with Layout ...
CHAPTER 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 44 Where a single block is instantiated the width and height functions are extracted from the σ environment and are returned after the application of curried parameters p1 . . . pn. The size of a parallel composition of blocks is calculated as though the blocks are arranged vertically, with the overall height being the sum of the height of each individual block and the overall width being the maximum width of any block in the composition. The size of a series composition of blocks is calculated as though the blocks are arranged horizontally in a similar manner. Series composition is represented as a fully associative binary operator (an n-size composition can be represented as nested series compositions) for convenience. The series composition size function internal signal s is defined in terms of the ι definite description operator. This operator, in the form ιx. P(x) can be read as “the x such that P(x) holds”. In this case the internal signal s is the one such that it obeys the predicates produced by the application of function B ′ to the two blocks. This is made necessary by the relational nature of Quartz blocks which means it is not possible to state whether block b1 or block b2 generates the value s (or some combination of the two, if it is a tuple of values). This logical nicety is practically irrelevant for us in this chapter since we will convert relational Quartz descriptions into functional ones during compilation while evaluating any size functions. The grey boxes with dotted outlines in Figure 3.5 illustrate the sizes calculated for series and parallel compositions diagrammatically. 3.4.3 Size Inference As noted in the previous section each type of statement has a particular layout interpretation and we can exploit that to describe the size of each type of statement recursively. The size of an entire block can then be described in terms of the sizes of its constituent statements. The function SB, shown in Figure 3.6, returns a pair of expressions describing the height and width of a block in terms of its domain, range and internal signals. Unlike the SI function we described previously this function is directly implementable since it does not use the definite description operator or refer explicitly to internal signals. Note also that this function does not infer size functions for the block, it infers size expressions in terms of the block’s local environment. These size expressions can be converted into
CHAPTER 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 45 SB :: Block → (Exp × Exp) SB block bid d1 . . . dn ∼ r { τ1 id1 . . . τq idq. stmts } = SS ′ stmts SS ′ :: StmtList → (Exp × Exp) SS ′ stmt1 . . . stmtn = let (w1, h1) = SSstmt1 in . let (wn, hn) = SSstmtn in (max(w1, . . .,wn), max(h1, . . . , hn)) SS :: Stmt → (Exp × Exp) SS assert e str = (0, 0) SS e1 = e2 = (0, 0) SS if e { stmts1 } else { stmts2 } = let (w1, h1) = SS ′ stmts1 in let (w2, h2) = SS ′ stmts2 in (if(e, w1, w2), if(e, h1, h2)) SS for i = e1..e2 { stmts } = let (w, h) = SSstmts in (maxf(i = e1..e2, w), maxf(i = e1..e2, h)) SS a ; blkinst ; b at (x, y) = (width(a ; blkinst ; b) + x, height(a ; blkinst ; b) + y) Figure 3.6: Inferring the size of a block functions in terms of the block’s domain and range variables by binding any local variables to values determined through an ι operator and the semantic meaning function for the block’s statements, however we will not pursue this approach in this chapter. This introduces a slight divergence between the function SI which is parameterised by a SizeEnv environment of block size functions and the size inference function, which produces expressions, however for the purposes of our implementation this is desirable - we take an alternative approach to implementing these semantics during the compilation process. In Chapter 4 we will return to using size functions for verification purposes and Figure 4.9 on page 82 illustrates how size expressions can be converted into size functions. The key concept this function implements is that a block’s size is the top right corner of a bounding box that encloses all sub-blocks instantiated within it. This is found by selecting the maximum value for each statement then selecting the maximum of all statements for the block as a whole. It is important to note that because max has been added to the set of available expression operators, the expressions that describe the height and width can remain fully parameterised in terms of a block’s signals and the max function can be evaluated exactly during full elaboration of the design rather than forcing the compiler to select a (possibly
- Page 3 and 4: Acknowledgements Firstly, I’d lik
- Page 5 and 6: TABLE OF CONTENTS iv 2.5 Isabelle:
- Page 7 and 8: TABLE OF CONTENTS vi 5.3.1 Speciali
- Page 9 and 10: TABLE OF CONTENTS viii C.1.1 fst .
- Page 11 and 12: Chapter 1 Introduction This thesis
- Page 13 and 14: CHAPTER 1. INTRODUCTION 3 B A C Fig
- Page 15 and 16: CHAPTER 1. INTRODUCTION 5 pler, all
- Page 17 and 18: CHAPTER 2. BACKGROUND AND RELATED W
- Page 19 and 20: CHAPTER 2. BACKGROUND AND RELATED W
- Page 21 and 22: CHAPTER 2. BACKGROUND AND RELATED W
- Page 23 and 24: CHAPTER 2. BACKGROUND AND RELATED W
- Page 25 and 26: CHAPTER 2. BACKGROUND AND RELATED W
- Page 27 and 28: CHAPTER 2. BACKGROUND AND RELATED W
- Page 29 and 30: CHAPTER 2. BACKGROUND AND RELATED W
- Page 31 and 32: CHAPTER 2. BACKGROUND AND RELATED W
- Page 33 and 34: CHAPTER 2. BACKGROUND AND RELATED W
- Page 35 and 36: CHAPTER 2. BACKGROUND AND RELATED W
- Page 37 and 38: CHAPTER 2. BACKGROUND AND RELATED W
- Page 39 and 40: CHAPTER 2. BACKGROUND AND RELATED W
- Page 41 and 42: CHAPTER 2. BACKGROUND AND RELATED W
- Page 43 and 44: CHAPTER 2. BACKGROUND AND RELATED W
- Page 45 and 46: CHAPTER 3. GENERATING PARAMETERISED
- Page 47 and 48: CHAPTER 3. GENERATING PARAMETERISED
- Page 49 and 50: CHAPTER 3. GENERATING PARAMETERISED
- Page 51 and 52: CHAPTER 3. GENERATING PARAMETERISED
- Page 53: CHAPTER 3. GENERATING PARAMETERISED
- Page 57 and 58: CHAPTER 3. GENERATING PARAMETERISED
- Page 59 and 60: CHAPTER 3. GENERATING PARAMETERISED
- Page 61 and 62: CHAPTER 3. GENERATING PARAMETERISED
- Page 63 and 64: CHAPTER 3. GENERATING PARAMETERISED
- Page 65 and 66: CHAPTER 3. GENERATING PARAMETERISED
- Page 67 and 68: CHAPTER 3. GENERATING PARAMETERISED
- Page 69 and 70: CHAPTER 3. GENERATING PARAMETERISED
- Page 71 and 72: CHAPTER 3. GENERATING PARAMETERISED
- Page 73 and 74: CHAPTER 3. GENERATING PARAMETERISED
- Page 75 and 76: Chapter 4 Verifying Circuit Layouts
- Page 77 and 78: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 79 and 80: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 81 and 82: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 83 and 84: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 85 and 86: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 87 and 88: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 89 and 90: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 91 and 92: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 93 and 94: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 95 and 96: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 97 and 98: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 99 and 100: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 101 and 102: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
- Page 103 and 104: CHAPTER 4. VERIFYING CIRCUIT LAYOUT
CHAPTER 3. GENERATING PARAMETERISED LIBRARIES WITH LAYOUT 44<br />
Where a single block is instantiated the width and height functions are extracted from the σ<br />
environment and are returned after the application <strong>of</strong> curried parameters p1 . . . pn. The size <strong>of</strong><br />
a parallel composition <strong>of</strong> blocks is calculated as though the blocks are arranged vertically, <strong>with</strong><br />
the overall height being the sum <strong>of</strong> the height <strong>of</strong> each individual block and the overall width<br />
being the maximum width <strong>of</strong> any block in the composition. The size <strong>of</strong> a series composition<br />
<strong>of</strong> blocks is calculated as though the blocks are arranged horizontally in a similar manner.<br />
Series composition is represented as a fully associative binary operator (an n-size composition<br />
can be represented as nested series compositions) for convenience. The series composition<br />
size function internal signal s is defined in terms <strong>of</strong> the ι definite description operator. This<br />
operator, in the form ιx. P(x) can be read as “the x such that P(x) holds”. In this case<br />
the internal signal s is the one such that it obeys the predicates produced by the application<br />
<strong>of</strong> function B ′ to the two blocks. This is made necessary by the relational nature <strong>of</strong> Quartz<br />
blocks which means it is not possible to state whether block b1 or block b2 generates the value<br />
s (or some combination <strong>of</strong> the two, if it is a tuple <strong>of</strong> values). This logical nicety is practically<br />
irrelevant for us in this chapter since we will convert relational Quartz descriptions into<br />
functional ones during compilation while evaluating any size functions.<br />
The grey boxes <strong>with</strong> dotted outlines in Figure 3.5 illustrate the sizes calculated for series and<br />
parallel compositions diagrammatically.<br />
3.4.3 Size Inference<br />
As noted in the previous section each type <strong>of</strong> statement has a particular layout interpretation<br />
and we can exploit that to describe the size <strong>of</strong> each type <strong>of</strong> statement recursively. The size<br />
<strong>of</strong> an entire block can then be described in terms <strong>of</strong> the sizes <strong>of</strong> its constituent statements.<br />
The function SB, shown in Figure 3.6, returns a pair <strong>of</strong> expressions describing the height<br />
and width <strong>of</strong> a block in terms <strong>of</strong> its domain, range and internal signals.<br />
Unlike the SI function we described previously this function is directly implementable since<br />
it does not use the definite description operator or refer explicitly to internal signals. Note<br />
also that this function does not infer size functions for the block, it infers size expressions<br />
in terms <strong>of</strong> the block’s local environment. These size expressions can be converted into