-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathsp-basic.ucl
60 lines (44 loc) · 921 Bytes
/
sp-basic.ucl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Initial attempt at building simple datapath
// This one only performs the updating of the PC
module common {
// Types
// Instructions
type instr_t = bv32;
// Program counter
type pc_t = bv32;
// Instruction memory
type imem_t = [pc_t]instr_t;
// Uninterpreted functions
// Given instruction, compute next value of PC
function nextPC(i: instr_t) : pc_t;
}
module path {
input pc0 : common.pc_t;
var imem : common.imem_t;
var pc : common.pc_t;
init {
pc = pc0;
}
next {
pc' = common.nextPC(imem[pc]);
}
}
module main {
var pc_init : common.pc_t;
var step : integer;
instance unit : path(pc0 : (pc_init));
init {
step = 0;
}
next {
step' = step + 1;
next(unit);
}
invariant initial : unit.pc0 == pc_init;
control {
vobj = unroll(1);
check;
print_results;
// vobj.print_cex(step, pc_init, unit.pc0, unit.pc);
}
}