Skip to content

Commit 27645d4

Browse files
emacdo12jeanlego
emacdo12
authored andcommitted
Odin: Update defparam tests
this commit update the defparams test to test for different overrides hierarchy depth
1 parent f617a87 commit 27645d4

11 files changed

+346
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module simple_op(in1,in2,out1,out2);
2+
parameter width1 = 2;
3+
parameter width2 = 8;
4+
5+
input [width1-1:0] in1;
6+
input [width2-1:0] in2;
7+
output [width1-1:0] out1;
8+
output [width2-1:0] out2;
9+
10+
defparam m1.width = 2;
11+
defparam m2.width = 8;
12+
13+
assg m1 (in1,out1);
14+
assg m2 (in2,out2);
15+
16+
endmodule
17+
18+
module assg(in,out);
19+
parameter width = 3;
20+
21+
input [width-1:0] in;
22+
output [width-1:0] out;
23+
24+
assign out = in;
25+
endmodule
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module simple_op(in1,in2,out1,out2);
2+
parameter width1 = 2;
3+
parameter width2 = 8;
4+
5+
input [width1-1:0] in1;
6+
input [width2-1:0] in2;
7+
output [width1-1:0] out1;
8+
output [width2-1:0] out2;
9+
10+
defparam m1.width = 2;
11+
defparam m2.width = 8;
12+
13+
assg m1 (in1,out1);
14+
assg m2 (in2,out2);
15+
16+
endmodule
17+
18+
module assg(in,out);
19+
localparam width = 3;
20+
21+
input [width-1:0] in;
22+
output [width-1:0] out;
23+
24+
assign out = in;
25+
endmodule
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
GLOBAL_SIM_BASE_CLK in1 in2
2+
1 0X2 0X67
3+
0 0X2 0X41
4+
1 0X1 0X3c
5+
0 0X3 0Xf5
6+
1 0X1 0X2a
7+
0 0X0 0Xae
8+
1 0X3 0X55
9+
0 0X1 0Xc1
10+
1 0X1 0X08
11+
0 0X1 0X5c
12+
1 0X2 0X5c
13+
0 0X3 0X7f
14+
1 0X1 0X4d
15+
0 0X3 0Xa8
16+
1 0X1 0X8f
17+
0 0X1 0Xd0
18+
1 0X3 0X6c
19+
0 0X2 0Xcf
20+
1 0X1 0X0e
21+
0 0X0 0Xa7
22+
1 0X1 0X99
23+
0 0X0 0X27
24+
1 0X1 0Xe8
25+
0 0X2 0X20
26+
1 0X0 0Xc1
27+
0 0X2 0X97
28+
1 0X3 0X4e
29+
0 0X0 0X60
30+
1 0X2 0X18
31+
0 0X2 0X7d
32+
1 0X1 0X0b
33+
0 0X2 0X02
34+
1 0X1 0X11
35+
0 0X3 0Xc9
36+
1 0X0 0Xe9
37+
0 0X2 0X09
38+
1 0X1 0X04
39+
0 0X1 0X47
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
out1 out2
2+
0X2 0X7
3+
0X2 0X1
4+
0X1 0X4
5+
0X3 0X5
6+
0X1 0X2
7+
0X0 0X6
8+
0X3 0X5
9+
0X1 0X1
10+
0X1 0X0
11+
0X1 0X4
12+
0X2 0X4
13+
0X3 0X7
14+
0X1 0X5
15+
0X3 0X0
16+
0X1 0X7
17+
0X1 0X0
18+
0X3 0X4
19+
0X2 0X7
20+
0X1 0X6
21+
0X0 0X7
22+
0X1 0X1
23+
0X0 0X7
24+
0X1 0X0
25+
0X2 0X0
26+
0X0 0X1
27+
0X2 0X7
28+
0X3 0X6
29+
0X0 0X0
30+
0X2 0X0
31+
0X2 0X5
32+
0X1 0X3
33+
0X2 0X2
34+
0X1 0X1
35+
0X3 0X1
36+
0X0 0X1
37+
0X2 0X1
38+
0X1 0X4
39+
0X1 0X7
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
GLOBAL_SIM_BASE_CLK in1 in2
2+
1 0X2 0X67
3+
0 0X2 0X41
4+
1 0X1 0X3c
5+
0 0X3 0Xf5
6+
1 0X1 0X2a
7+
0 0X0 0Xae
8+
1 0X3 0X55
9+
0 0X1 0Xc1
10+
1 0X1 0X08
11+
0 0X1 0X5c
12+
1 0X2 0X5c
13+
0 0X3 0X7f
14+
1 0X1 0X4d
15+
0 0X3 0Xa8
16+
1 0X1 0X8f
17+
0 0X1 0Xd0
18+
1 0X3 0X6c
19+
0 0X2 0Xcf
20+
1 0X1 0X0e
21+
0 0X0 0Xa7
22+
1 0X1 0X99
23+
0 0X0 0X27
24+
1 0X1 0Xe8
25+
0 0X2 0X20
26+
1 0X0 0Xc1
27+
0 0X2 0X97
28+
1 0X3 0X4e
29+
0 0X0 0X60
30+
1 0X2 0X18
31+
0 0X2 0X7d
32+
1 0X1 0X0b
33+
0 0X2 0X02
34+
1 0X1 0X11
35+
0 0X3 0Xc9
36+
1 0X0 0Xe9
37+
0 0X2 0X09
38+
1 0X1 0X04
39+
0 0X1 0X47
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
out1 out2
2+
0X2 0X67
3+
0X2 0X41
4+
0X1 0X3c
5+
0X3 0Xf5
6+
0X1 0X2a
7+
0X0 0Xae
8+
0X3 0X55
9+
0X1 0Xc1
10+
0X1 0X08
11+
0X1 0X5c
12+
0X2 0X5c
13+
0X3 0X7f
14+
0X1 0X4d
15+
0X3 0Xa8
16+
0X1 0X8f
17+
0X1 0Xd0
18+
0X3 0X6c
19+
0X2 0Xcf
20+
0X1 0X0e
21+
0X0 0Xa7
22+
0X1 0X99
23+
0X0 0X27
24+
0X1 0Xe8
25+
0X2 0X20
26+
0X0 0Xc1
27+
0X2 0X97
28+
0X3 0X4e
29+
0X0 0X60
30+
0X2 0X18
31+
0X2 0X7d
32+
0X1 0X0b
33+
0X2 0X02
34+
0X1 0X11
35+
0X3 0Xc9
36+
0X0 0Xe9
37+
0X2 0X09
38+
0X1 0X04
39+
0X1 0X47
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
module simple_op(in1,in2,out1,out2);
2+
parameter width1 = 2;
3+
parameter width2 = 8;
4+
5+
input [width1-1:0] in1;
6+
input [width2-1:0] in2;
7+
output [width1-1:0] out1;
8+
output [width2-1:0] out2;
9+
10+
defparam m1.width = 2;
11+
defparam m2.width = 8;
12+
defparam m1.g1.width = 2;
13+
defparam m2.g1.width = 8;
14+
15+
assg1 m1 (in1,out1);
16+
assg1 m2 (in2,out2);
17+
18+
endmodule
19+
20+
module assg1(in,out);
21+
parameter width = 3;
22+
23+
input [width-1:0] in;
24+
output [width-1:0] out;
25+
26+
assg2 g1 (in,out);
27+
28+
endmodule
29+
30+
module assg2(in,out);
31+
parameter width = 2;
32+
33+
input [width-1:0] in;
34+
output [width-1:0] out;
35+
36+
assign out = in;
37+
38+
endmodule
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
GLOBAL_SIM_BASE_CLK in1 in2
2+
1 0X2 0X67
3+
0 0X2 0X41
4+
1 0X1 0X3c
5+
0 0X3 0Xf5
6+
1 0X1 0X2a
7+
0 0X0 0Xae
8+
1 0X3 0X55
9+
0 0X1 0Xc1
10+
1 0X1 0X08
11+
0 0X1 0X5c
12+
1 0X2 0X5c
13+
0 0X3 0X7f
14+
1 0X1 0X4d
15+
0 0X3 0Xa8
16+
1 0X1 0X8f
17+
0 0X1 0Xd0
18+
1 0X3 0X6c
19+
0 0X2 0Xcf
20+
1 0X1 0X0e
21+
0 0X0 0Xa7
22+
1 0X1 0X99
23+
0 0X0 0X27
24+
1 0X1 0Xe8
25+
0 0X2 0X20
26+
1 0X0 0Xc1
27+
0 0X2 0X97
28+
1 0X3 0X4e
29+
0 0X0 0X60
30+
1 0X2 0X18
31+
0 0X2 0X7d
32+
1 0X1 0X0b
33+
0 0X2 0X02
34+
1 0X1 0X11
35+
0 0X3 0Xc9
36+
1 0X0 0Xe9
37+
0 0X2 0X09
38+
1 0X1 0X04
39+
0 0X1 0X47
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
out1 out2
2+
0X2 0X67
3+
0X2 0X41
4+
0X1 0X3c
5+
0X3 0Xf5
6+
0X1 0X2a
7+
0X0 0Xae
8+
0X3 0X55
9+
0X1 0Xc1
10+
0X1 0X08
11+
0X1 0X5c
12+
0X2 0X5c
13+
0X3 0X7f
14+
0X1 0X4d
15+
0X3 0Xa8
16+
0X1 0X8f
17+
0X1 0Xd0
18+
0X3 0X6c
19+
0X2 0Xcf
20+
0X1 0X0e
21+
0X0 0Xa7
22+
0X1 0X99
23+
0X0 0X27
24+
0X1 0Xe8
25+
0X2 0X20
26+
0X0 0Xc1
27+
0X2 0X97
28+
0X3 0X4e
29+
0X0 0X60
30+
0X2 0X18
31+
0X2 0X7d
32+
0X1 0X0b
33+
0X2 0X02
34+
0X1 0X11
35+
0X3 0Xc9
36+
0X0 0Xe9
37+
0X2 0X09
38+
0X1 0X04
39+
0X1 0X47

ODIN_II/regression_test/benchmark/verilog/keywords/defparam/defparam_failure.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module simple_op(in1,in2,out1,out2);
22
parameter width1 = 3;
3-
parameter width2 = 6;
3+
parameter width2 = 4;
44

55
input [width1-1:0] in1;
66
input [width2-1:0] in2;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module simple_op(in1,out1);
2+
parameter width1 = 4;
3+
4+
input [width1-1:0] in1;
5+
output [width1-1:0] out1;
6+
7+
assg m1 (in1,out1);
8+
9+
endmodule
10+
11+
module assg(in,out);
12+
localparam width = 3;
13+
14+
input [width-1:0] in;
15+
output [width-1:0] out;
16+
17+
assign out = in;
18+
endmodule
19+
20+
module params;
21+
defparam
22+
simple_op.m1.width = 4;
23+
endmodule

0 commit comments

Comments
 (0)