forked from llvm/circt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlower-to-bmc-errors.mlir
More file actions
75 lines (60 loc) · 2.66 KB
/
lower-to-bmc-errors.mlir
File metadata and controls
75 lines (60 loc) · 2.66 KB
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
// RUN: circt-opt --lower-to-bmc="top-module=testModule bound=10" --split-input-file --verify-diagnostics %s
// expected-error @below {{hw.module named 'testModule' not found}}
module {}
// -----
// expected-error @below {{hw.module named 'testModule' not found}}
module {
func.func @testModule(%in: i8) -> (i8) {
func.return %in : i8
}
}
// -----
// expected-error @below {{no num_regs or initial_values attribute found - please run externalize registers pass first}}
hw.module @testModule(in %in0 : i32, in %in1 : i32, out out : i32) {
%0 = comb.add %in0, %in1 : i32
%1 = comb.icmp eq %in0, %in1 : i32
verif.assert %1 : i1
hw.output %0 : i32
}
// -----
// expected-error @below {{no num_regs or initial_values attribute found - please run externalize registers pass first}}
hw.module @testModule(in %in0 : i32, in %in1 : i32, out out : i32) attributes {num_regs = 0 : i32} {
%0 = comb.add %in0, %in1 : i32
%1 = comb.icmp eq %in0, %in1 : i32
verif.assert %1 : i1
hw.output %0 : i32
}
// -----
// expected-error @below {{no num_regs or initial_values attribute found - please run externalize registers pass first}}
hw.module @testModule(in %in0 : i32, in %in1 : i32, out out : i32) attributes {initial_values = []} {
%0 = comb.add %in0, %in1 : i32
%1 = comb.icmp eq %in0, %in1 : i32
verif.assert %1 : i1
hw.output %0 : i32
}
// -----
// expected-error @below {{initial_values attribute must contain only integer or unit attributes}}
hw.module @testModule(in %clk0 : !seq.clock, in %in0 : i32, in %in1 : i32, in %reg0_state : i32, in %reg1_state : i32, out out : i32, out reg0_input : i32, out reg1_input : i32) attributes {num_regs = 2 : i32, initial_values = [unit, "foo"]} {
%0 = comb.add %reg0_state, %reg1_state : i32
%1 = comb.icmp eq %0, %in0 : i32
verif.assert %1 : i1
hw.output %0, %in0, %in1 : i32, i32, i32
}
// -----
// expected-error @below {{designs with struct-embedded clocks not yet supported}}
hw.module @testModule(in %clk0 : !seq.clock, in %clkStruct : !hw.struct<clk: !seq.clock>, in %in0 : i32, in %in1 : i32, in %reg0_state : i32, in %reg1_state : i32, out out : i32, out reg0_input : i32, out reg1_input : i32) attributes {num_regs = 2 : i32, initial_values = [unit, unit]} {
%0 = comb.add %reg0_state, %reg1_state : i32
%1 = comb.icmp eq %0, %in0 : i32
verif.assert %1 : i1
hw.output %0, %in0, %in1 : i32, i32, i32
}
// -----
// expected-error @below {{could not resolve cycles in module}}
hw.module @testModule(in %in0 : i32) attributes {num_regs = 0 : i32, initial_values = []} {
%add = comb.add %in0, %or : i32
%or = comb.or %in0, %add : i32
// Dummy property
%true = hw.constant true
verif.assert %true : i1
hw.output
}