- Page 1 and 2: BSV by Example The next-generation
- Page 3 and 4: 3.6.3 UInt#(n) . . . . . . . . . .
- Page 5 and 6: 10 Advanced types and pattern-match
- Page 7 and 8: A.6.1 Scheduling error due to paral
- Page 9 and 10: 1 Introduction BSV (Bluespec System
- Page 11 and 12: • Haskell, for more advanced type
- Page 13 and 14: would be unnecessary if sequential
- Page 15 and 16: A few examples span multiple sectio
- Page 17 and 18: In this simple example, the name of
- Page 19 and 20: 2.2.4 Create a project file Figure
- Page 21 and 22: This next example looks at a design
- Page 23 and 24: • ActionValue Methods: These meth
- Page 25 and 26: Another example: the Ord typeclass
- Page 27 and 28: cannot automatically convert from a
- Page 29 and 30: $display("maxInt16/4 = %x", maxInt1
- Page 31 and 32: 3.9 Strings Source directory: data/
- Page 33 and 34: 4.1.3 Value initialization from a V
- Page 35: ActionValue #(Coord) g = s.response
- Page 39 and 40: package Tb; (* synthesize *) module
- Page 41 and 42: In BSV, the logical sequence of rul
- Page 43 and 44: These are both legal final states o
- Page 45 and 46: ule r1; x2
- Page 47 and 48: Because of the rule condition if (v
- Page 49 and 50: 6 Module hierarchy and interfaces 6
- Page 51 and 52: Wherever mkM2 is instantiated, the
- Page 53 and 54: Window Bluespec Development Worksta
- Page 55 and 56: 6.3.1 The let statement This statem
- Page 57 and 58: module mkTb (Empty); Dut_ifc dut 0
- Page 59 and 60: interface Put_int; method Action pu
- Page 61 and 62: module mkStimulusGen (Client_int);
- Page 63 and 64: interface Server#(type req_type, ty
- Page 65 and 66: Conflicts are discussed in more det
- Page 67 and 68: (* descending_urgency = "r1, r2, r3
- Page 69 and 70: Figure 6: Execution Order Graph As
- Page 71 and 72: If you compile with the mutually_ex
- Page 73 and 74: (* preempts = "(the_bar.r1, (r2, r3
- Page 75 and 76: However, the rule calls dut.put() a
- Page 77 and 78: After you compile and observe the r
- Page 79 and 80: Sometimes, splitting a rule syntact
- Page 81 and 82: Note that in each cycle, with respe
- Page 83 and 84: interface Counter; method int read(
- Page 85 and 86: noAction is a special null Action (
- Page 87 and 88:
In this example, the four lines enu
- Page 89 and 90:
Notice that the default value on bo
- Page 91 and 92:
ule doit; case (tuple2 (rw_incr.wge
- Page 93 and 94:
method Action enq(v) if (enq_ok); r
- Page 95 and 96:
In the next few examples we’ll cr
- Page 97 and 98:
Common Overloading Provisos Proviso
- Page 99 and 100:
module mkPlainReg2( Reg#(Bit#(n)) )
- Page 101 and 102:
Since type_b is a different type th
- Page 103 and 104:
• The optional deriving Eq clause
- Page 105 and 106:
color0 color1 color2 8 bits 8 bits
- Page 107 and 108:
A common example of a tagged union
- Page 109 and 110:
The simple processor module contain
- Page 111 and 112:
defines instruction addresses to be
- Page 113 and 114:
typedef struct { Reg#(int) ra; Reg#
- Page 115 and 116:
Functions like tuple2 are ordinary
- Page 117 and 118:
At every state, it tries to reduce
- Page 119 and 120:
Reg#(int) cycle
- Page 121 and 122:
• Z a wire that is not driven at
- Page 123 and 124:
These function expressions can be u
- Page 125 and 126:
Reg#(int) arr3[4]; for (Integer i=0
- Page 127 and 128:
to produce a vector of 4 elements (
- Page 129 and 130:
We can then use the genWith vector
- Page 131 and 132:
The output is: 13.4 Whole register
- Page 133 and 134:
Error: "Tb.bsv", line 20, column 35
- Page 135 and 136:
We’ll take a simple approach and
- Page 137 and 138:
arr[5]
- Page 139 and 140:
Reg#(int) counter
- Page 141 and 142:
ule stateIdle ( state[idle] == 1 );
- Page 143 and 144:
statement times (the number of cloc
- Page 145 and 146:
function Action functionOfAction( i
- Page 147 and 148:
action $display("Enq 10 at time ",
- Page 149 and 150:
Warning: "Tb.bsv", line 36, column
- Page 151 and 152:
module SizedFIFO(V_CLK, V_RST_N, V_
- Page 153 and 154:
• Every import "BVI" wrapper must
- Page 155 and 156:
The Verilog parameters, inputs, and
- Page 157 and 158:
A Source Files Complete, compilable
- Page 159 and 160:
package DeepThought; interface Ifc_
- Page 161 and 162:
rule step3 ( step == 3 ); $display(
- Page 163 and 164:
Reg#(int) step
- Page 165 and 166:
(* synthesize *) module mkTb (Empty
- Page 167 and 168:
(* synthesize *) module mkTb (Empty
- Page 169 and 170:
(* synthesize *) module mkTb (Empty
- Page 171 and 172:
method Action send (int a); f1.enq
- Page 173 and 174:
endmodule // ----------------------
- Page 175 and 176:
Copyright 2010 Bluespec, Inc. All r
- Page 177 and 178:
interface Put_int put_response; end
- Page 179 and 180:
f_out.enq (y); endrule interface re
- Page 181 and 182:
endrule rule enq2 (state > 4); f.en
- Page 183 and 184:
(* synthesize *) module mkGadget (S
- Page 185 and 186:
cycle
- Page 187 and 188:
(* descending_urgency = "r1, r2" *)
- Page 189 and 190:
$display ("%0d: Enqueuing %d into f
- Page 191 and 192:
A.7 RWires and Wire types Chapter e
- Page 193 and 194:
endrule method int read(); return v
- Page 195 and 196:
Version 2 of the counter (* synthes
- Page 197 and 198:
method Action decrement (int dd); v
- Page 199 and 200:
-----------------------------------
- Page 201 and 202:
-----------------------------------
- Page 203 and 204:
ule decr2 (state > 3); c2.decrement
- Page 205 and 206:
ule e; let x = state * 10; f.enq (x
- Page 207 and 208:
endfunction function Bool isBlock(
- Page 209 and 210:
method Action drive(tx ina, ty inb)
- Page 211 and 212:
package Tb; import SimpleProcessor:
- Page 213 and 214:
Reg#(InstructionAddress) pc
- Page 215 and 216:
$display("=== step 0 ==="); $displa
- Page 217 and 218:
endrule endmodule: mkTb endpackage:
- Page 219 and 220:
it o = 0; for (Bit#(2) i=0; i
- Page 221 and 222:
step
- Page 223 and 224:
Copyright 2008 Bluespec, Inc. All r
- Page 225 and 226:
endfunction Vector#(16,bit) bar2 =
- Page 227 and 228:
Reg#( Vector#(10,Status) ) regstatu
- Page 229 and 230:
endmodule: mkTb endpackage: Tb A.12
- Page 231 and 232:
A top-level module connecting the s
- Page 233 and 234:
Copyright 2010 Bluespec, Inc. All r
- Page 235 and 236:
functionOfAction( 30 ); // Create a
- Page 237 and 238:
endseq endpar $display("Par block d
- Page 239 and 240:
endmodule schedule first SB (clear,