Zanehpn commited on
Commit
133d0a8
·
verified ·
1 Parent(s): 86266a7

Add files using upload-large-folder tool

Browse files
Files changed (20) hide show
  1. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.4--include_basic.sv +18 -0
  2. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.1--define-expansion_26.sv +19 -0
  3. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.1--define-expansion_6.sv +20 -0
  4. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.3--undefineall-and-redefine.sv +20 -0
  5. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.3--undefineall-basic.sv +16 -0
  6. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.12--assignment.sv +40 -0
  7. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.12--shallow_copy.sv +41 -0
  8. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.14--override_member.sv +52 -0
  9. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.15--super-default-new.sv +48 -0
  10. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.15--super.sv +50 -0
  11. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.23--scope_resolution.sv +29 -0
  12. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.25--parametrized_class_extend.sv +30 -0
  13. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.3--type_access_implements.sv +35 -0
  14. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.4--illegal_forward_def_implements.sv +38 -0
  15. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.5--cast_between_interface_classes.sv +43 -0
  16. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.1--name_conflict_unresolved.sv +39 -0
  17. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.3--diamond_relationship.sv +31 -0
  18. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.3--diamond_relationship_parametrized.sv +33 -0
  19. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.7--partial_implementation.sv +43 -0
  20. snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.9--static_properties.sv +33 -0
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.4--include_basic.sv ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: 22.4--include_basic
12
+ :description: Test
13
+ :tags: 22.4
14
+ :type: preprocessing parsing
15
+ */
16
+ `include "dummy_include.sv"
17
+ module top ();
18
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.1--define-expansion_26.sv ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: 22.5.1--define_expansion_26
12
+ :description: Test
13
+ :tags: 22.5.1
14
+ :type: preprocessing
15
+ */
16
+ `define append(f) f``_master
17
+ module top ();
18
+ initial $display(`append(clock));
19
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.1--define-expansion_6.sv ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: 22.5.1--define_expansion_6
12
+ :description: Test
13
+ :should_fail_because: If fewer actual arguments are specified than the number of formal arguments and all the remaining formal arguments have defaults, then the defaults are substituted for the additional formal arguments. It shall be an error if any of the remaining formal arguments does not have a default specified.
14
+ :tags: 22.5.1
15
+ :type: preprocessing
16
+ */
17
+ `define D(x,y) initial $display("start", x , y, "end");
18
+ module top ();
19
+ `D("msg1")
20
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.3--undefineall-and-redefine.sv ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: 22.5.3--undefineall-and-redefine
12
+ :description: Test
13
+ :tags: 22.5.3
14
+ :type: preprocessing
15
+ */
16
+ `define FOO "foo"
17
+ `undefineall
18
+ `define FOO 5
19
+ `undefineall
20
+ `define FOO(x,y) (x + y)
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-22/22.5.3--undefineall-basic.sv ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: 22.5.3--undefineall-basic
12
+ :description: Test
13
+ :tags: 22.5.3
14
+ :type: preprocessing
15
+ */
16
+ `undefineall
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.12--assignment.sv ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: assignment
12
+ :description: object assignment
13
+ :tags: 8.12
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class test_cls;
18
+ int a;
19
+ task test_method(int val);
20
+ $display("test_method");
21
+ a += val;
22
+ endtask
23
+ endclass
24
+
25
+ test_cls test_obj0;
26
+ test_cls test_obj1;
27
+
28
+ initial begin
29
+ test_obj0 = new;
30
+ test_obj1 = test_obj0;
31
+
32
+ test_obj0.a = 12;
33
+
34
+ $display(test_obj0.a);
35
+
36
+ test_obj0.test_method(9);
37
+
38
+ $display(test_obj1.a);
39
+ end
40
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.12--shallow_copy.sv ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: shallow_copy
12
+ :description: object shallow copy
13
+ :tags: 8.12
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class test_cls;
18
+ int a;
19
+ task test_method(int val);
20
+ $display("test_method");
21
+ a += val;
22
+ endtask
23
+ endclass
24
+
25
+ test_cls test_obj0;
26
+ test_cls test_obj1;
27
+
28
+ initial begin
29
+ test_obj0 = new;
30
+
31
+ test_obj0.a = 12;
32
+
33
+ $display(test_obj0.a);
34
+
35
+ test_obj1 = new test_obj0;
36
+
37
+ test_obj0.test_method(9);
38
+
39
+ $display(test_obj1.a);
40
+ end
41
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.14--override_member.sv ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: override_member
12
+ :description: class member override test
13
+ :tags: 8.14
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class super_cls;
18
+ int s = 2;
19
+ function int incs();
20
+ ++s;
21
+ incs = s;
22
+ endfunction
23
+ function new(int def = 3);
24
+ s = def;
25
+ endfunction
26
+ endclass
27
+
28
+ class test_cls extends super_cls;
29
+ int a;
30
+ function int incs();
31
+ s += 2;
32
+ incs = s;
33
+ endfunction
34
+ function new(int def = 42);
35
+ super.new(def + 3);
36
+ a = def;
37
+ endfunction
38
+ endclass
39
+
40
+ test_cls test_obj;
41
+ super_cls super_obj;
42
+
43
+ initial begin
44
+ test_obj = new(37);
45
+ super_obj = test_obj;
46
+
47
+ $display(test_obj.s);
48
+ $display(test_obj.incs());
49
+ $display(test_obj.s);
50
+ $display(super_obj.incs());
51
+ end
52
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.15--super-default-new.sv ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: super-def-new
12
+ :description: Base class has no user-defined constructor, derived class accesses superclass new()
13
+ :tags: 8.15
14
+ :unsynthesizable: 1
15
+ */
16
+ package test_pkg;
17
+
18
+ virtual class uvm_void;
19
+ endclass : uvm_void
20
+
21
+ class uvm_object extends uvm_void;
22
+ virtual function void print ();
23
+ $display ("Print");
24
+ endfunction : print
25
+ endclass : uvm_object
26
+
27
+ class uvm_report_object extends uvm_object;
28
+ function new ();
29
+ super.new ();
30
+ endfunction : new
31
+ endclass : uvm_report_object
32
+
33
+ endpackage : test_pkg
34
+
35
+ module m;
36
+ import test_pkg::*;
37
+ uvm_object u0;
38
+
39
+ initial begin : test
40
+ #100;
41
+ $display ("Hello World");
42
+ u0 = new ();
43
+ u0.print();
44
+
45
+ end : test
46
+
47
+ endmodule : m
48
+
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.15--super.sv ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: super
12
+ :description: accessing superclass methods via super
13
+ :tags: 8.15
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class super_cls;
18
+ int s = 2;
19
+ function int incs();
20
+ ++s;
21
+ incs = s;
22
+ endfunction
23
+ function new(int def = 3);
24
+ s = def;
25
+ endfunction
26
+ endclass
27
+
28
+ class test_cls extends super_cls;
29
+ int a;
30
+ function int incs();
31
+ s += 2;
32
+ incs = super.incs();
33
+ endfunction
34
+ function new(int def = 42);
35
+ super.new(def + 3);
36
+ a = def;
37
+ endfunction
38
+ endclass
39
+
40
+ test_cls test_obj;
41
+ super_cls super_obj;
42
+
43
+ initial begin
44
+ test_obj = new(37);
45
+ super_obj = test_obj;
46
+
47
+ $display(test_obj.s);
48
+ $display(test_obj.incs());
49
+ end
50
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.23--scope_resolution.sv ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: scope_resolution
12
+ :description: access static method using scope resolution operator
13
+ :tags: 8.23
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class test_cls;
18
+ static int id = 0;
19
+ static function int next_id();
20
+ ++id;
21
+ next_id = id;
22
+ endfunction
23
+ endclass
24
+
25
+ initial begin
26
+ $display(test_cls::next_id());
27
+ $display(test_cls::next_id());
28
+ end
29
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.25--parametrized_class_extend.sv ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: parametrized_class_extend
12
+ :description: parametrized class extending another parametrized class
13
+ :tags: 8.25
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class base_cls #(int b = 20);
18
+ int a;
19
+ endclass
20
+
21
+ class ext_cls #(int e = 25) extends base_cls #(5);
22
+ int c;
23
+ endclass
24
+
25
+ ext_cls #(15) inst;
26
+
27
+ initial begin
28
+ inst = new;
29
+ end
30
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.3--type_access_implements.sv ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: type_access_implements
12
+ :description: access interface class type with scope resolution operator
13
+ :tags: 8.26.3
14
+ :type: simulation elaboration parsing
15
+ :unsynthesizable: 1
16
+ */
17
+ module class_tb ();
18
+ interface class ihello;
19
+ typedef int int_t;
20
+ pure virtual function void hello(int_t val);
21
+ endclass
22
+
23
+ class Hello implements ihello;
24
+ virtual function void hello(ihello::int_t val);
25
+ $display(":assert:(%d == 12)", val);
26
+ endfunction
27
+ endclass
28
+
29
+ Hello obj;
30
+
31
+ initial begin
32
+ obj = new;
33
+ obj.hello(12);
34
+ end
35
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.4--illegal_forward_def_implements.sv ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: illegal_forward_def_implements
12
+ :description: implementing forward typedef for an interface class should fail
13
+ :should_fail_because: implementing forward typedef for an interface class should fail
14
+ :tags: 8.26.4
15
+ :type: simulation elaboration
16
+ :unsynthesizable: 1
17
+ */
18
+ module class_tb ();
19
+ typedef interface class ihello;
20
+
21
+ class Hello implements ihello;
22
+ virtual function void hello(ihello::int_t val);
23
+ $display("hello world %d", val);
24
+ endfunction
25
+ endclass
26
+
27
+ interface class ihello;
28
+ typedef int int_t;
29
+ pure virtual function void hello(int_t val);
30
+ endclass
31
+
32
+ Hello obj;
33
+
34
+ initial begin
35
+ obj = new;
36
+ obj.hello();
37
+ end
38
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.5--cast_between_interface_classes.sv ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: cast_between_interface_classes
12
+ :description: it should be possible to cast between implemented interface classes
13
+ :tags: 8.26.2
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ interface class ihello;
18
+ pure virtual function void hello();
19
+ endclass
20
+
21
+ interface class itest;
22
+ pure virtual function void test();
23
+ endclass
24
+
25
+ class Hello implements ihello, itest;
26
+ virtual function void hello();
27
+ $display("hello world");
28
+ endfunction
29
+ virtual function void test();
30
+ $display("test");
31
+ endfunction
32
+ endclass
33
+
34
+ Hello obj;
35
+ ihello ih_ref;
36
+ itest it_ref;
37
+
38
+ initial begin
39
+ obj = new;
40
+ ih_ref = obj;
41
+ $cast(it_ref, ih_ref);
42
+ end
43
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.1--name_conflict_unresolved.sv ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: name_conflict_unresolved
12
+ :description: unresolved interface class method name conflict
13
+ :should_fail_because: unresolved interface class method name conflict
14
+ :tags: 8.26.6.1
15
+ :type: simulation elaboration
16
+ :unsynthesizable: 1
17
+ */
18
+ module class_tb ();
19
+ interface class ihello;
20
+ pure virtual function void hello();
21
+ endclass
22
+
23
+ interface class itest;
24
+ pure virtual function int hello();
25
+ endclass
26
+
27
+ class Hello implements ihello, itest;
28
+ virtual function void hello();
29
+ $display("hello world");
30
+ endfunction
31
+ endclass
32
+
33
+ Hello obj;
34
+
35
+ initial begin
36
+ obj = new;
37
+ obj.hello();
38
+ end
39
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.3--diamond_relationship.sv ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: diamond_relationship
12
+ :description: interface class inherited from multiple sources shouldn't create symbol conflicts
13
+ :tags: 8.26.6.3
14
+ */
15
+ module class_tb ();
16
+ interface class ibase;
17
+ pure virtual function void fn();
18
+ endclass
19
+
20
+ interface class ic1 extends ibase;
21
+ pure virtual function void fn1();
22
+ endclass
23
+
24
+ interface class ic2 extends ibase;
25
+ pure virtual function void fn2();
26
+ endclass
27
+
28
+ interface class ic3 extends ic1, ic2;
29
+ pure virtual function void fn3();
30
+ endclass
31
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.6.3--diamond_relationship_parametrized.sv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: diamond_relationship_parametrized
12
+ :description: different specializations of an interface class are treated as unique interface class types
13
+ :should_fail_because: different specializations of an interface class are treated as unique interface class types
14
+ :tags: 8.26.6.3
15
+ :type: simulation elaboration
16
+ */
17
+ module class_tb ();
18
+ interface class ibase#(type T = logic);
19
+ pure virtual function void fn(T val);
20
+ endclass
21
+
22
+ interface class ic1 extends ibase#(bit);
23
+ pure virtual function void fn1();
24
+ endclass
25
+
26
+ interface class ic2 extends ibase#(string);
27
+ pure virtual function void fn2();
28
+ endclass
29
+
30
+ interface class ic3 extends ic1, ic2;
31
+ pure virtual function void fn3();
32
+ endclass
33
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.26.7--partial_implementation.sv ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: partial_implementation
12
+ :description: virtual classes can implement their interfaces partially
13
+ :tags: 8.26.7
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ interface class ihello;
18
+ pure virtual function void hello();
19
+ pure virtual function void world();
20
+ endclass
21
+
22
+ virtual class vhello implements ihello;
23
+ virtual function void hello();
24
+ $display("hello");
25
+ endfunction
26
+ pure virtual function void world();
27
+ endclass
28
+
29
+ class helloworld extends vhello;
30
+ virtual function void world();
31
+ $display("world");
32
+ endfunction
33
+ endclass
34
+
35
+ helloworld obj;
36
+
37
+ initial begin
38
+ obj = new;
39
+
40
+ obj.hello();
41
+ obj.world();
42
+ end
43
+ endmodule
snapshots/chipsalliance_sv-tests_pr7781/tests/chapter-8/8.9--static_properties.sv ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright (C) 2019-2021 The SymbiFlow Authors.
2
+ //
3
+ // Use of this source code is governed by a ISC-style
4
+ // license that can be found in the LICENSE file or at
5
+ // https://opensource.org/licenses/ISC
6
+ //
7
+ // SPDX-License-Identifier: ISC
8
+
9
+
10
+ /*
11
+ :name: static_properties
12
+ :description: static class properties test
13
+ :tags: 8.9
14
+ :unsynthesizable: 1
15
+ */
16
+ module class_tb ();
17
+ class test_cls;
18
+ static int s = 24;
19
+ endclass
20
+
21
+ test_cls test_obj0;
22
+ test_cls test_obj1;
23
+
24
+ initial begin
25
+ test_obj0 = new;
26
+ test_obj1 = new;
27
+
28
+ test_obj0.s = 12;
29
+ $display(test_obj0.s);
30
+ test_obj0.s = 13;
31
+ $display(test_obj1.s);
32
+ end
33
+ endmodule