-
Notifications
You must be signed in to change notification settings - Fork 11
/
errors.1.lv
106 lines (85 loc) · 2.31 KB
/
errors.1.lv
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
;;; Syntax and typing errors in LV
(enum bool
::true 1'b1
::false 1'b0)
(struct x :x 'bb)
(struct x :x bb)
(struct)
(enum bool2
::false 2'b00 ;; This field isn't a duplicate, since it can be disambiguated using bool2::false
::false 2'b00)
(enum bool2
::add 8'b10100000
::lsr 8'b01100000)
(struct instr
:kind 'kind
:kind 'kind
:imm1 bits)
(struct instr)
(extfun getinstr ((arg (bits 32))) (bits 32))
(extfun getinstr ((arg (bits 32))) (bits 32))
(extfun getinstr ((arg (bits 32))) (bits 32))
(extfun pack ((arg (bits 32))) (bits 32))
(extfun lsr ((arg (bits 32))) (bits 32))
(extfun progn ((arg (bits 32))) (bits 32))
(module syntax
(register r0 0)
(register r1 32'0)
(register r1 32'0)
(register_ r2 32'0)
(rule rl0
(switch (get :imm1 (init 'instr))
(::add (+sss (get :imm1 i) (get :imm2 i)))
(::lsr (>>> (get :imm1 i) (get :imm2 i)))
(_ 1)))
(rule rl1 (let ((false 1'b1)) (write.2)))
(rule rl2 (write.0 r1 (+ (read.1 r1) 31'0)))
(rule rl3 (getinstr (read.0 r1)))
(rule rl4 (write.0 r1 (getinstr (read.0 r1))))
(rule rl5
(let ((a 5'b0)
(b (unpack 'xyz (read.1 r0)))
(c (init 'instr))
(d (init (bits 16)))
(e (init 'bool2))
(f (init (array (bits 8) 4) 8'37 8'29)))
(setq x (+ x 5'b00010))
(write.0 r1
(zextl 1
(switch (get :kind i)
(xxx::add (+ (get :imm1 i) (get :imm2 i)))
(::lsr (>> (get :imm1 i) (get :imm2 i)))
(_ 1'b0))))))
(scheduler s1 (sequence rl1 rl))
(scheduler s2 (sequence rl2 rl2)))
(module types
(register r0 0'0)
(register r1 0'0)
(rule rl1 (write.0 r1 32'0))
(rule rl2 (write.0 r1 (+ (read.1 r1) 31'0)))
(rule rl3 (getinstr_ (read.0 r1)))
(rule rl4 (write.0 r1 (getinstr (read.0 r1))))
(scheduler s1 (sequence rl1 rl))
(scheduler s2 (sequence rl2 rl2)))
(struct instrb)
(struct nested
:instr 'instrb
:a (bits 16))
(struct nested
:instr 'instrb
:a (bits 16))
(struct nested2
:instr 'nested
:instr 'nested
:nested (bits 3))
(extfun f ((arg 'nested2)) 'nested)
(extfun f ((arg 'nested2)) 'nested)
(module test
(rule placeholder
(let ((n2 (init 'nested2 :instr (init 'nested :a 16'b0) :nested 3'b0)))
fail))
(scheduler s
(sequence placeholder)))
(module test
(scheduler s (sequence)))
(module