VCS virtual fiacso - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

 Tools & Simulators

 Examples

208


41
 
1
virtual class foo;
2
  virtual function void my_name();
3
    $display("foo");
4
  endfunction
5
  
6
  function new();
7
    my_name();
8
  endfunction
9
  
10
  function wen();
11
    my_name();
12
  endfunction
13
endclass
14
15
class baz;
16
  int x = 1;
17
endclass
18
    
19
class bar extends foo;
20
  baz baz_o = new();
21
  
22
  virtual function void my_name();
23
    $display("bar");
24
    $display(baz_o.x);
25
  endfunction
26
  
27
  function new();
28
    super.new();
29
  endfunction 
30
  
31
  function wen();
32
    super.wen();
33
  endfunction
34
endclass
35
    
36
module top;
37
  initial begin
38
    automatic bar x = new();
39
    x.wen();
40
  end
41
endmodule
xxxxxxxxxx
1
 
1
// Code your design here
2
52 views and 0 likes     
A short description will be helpful for you to remember your playground's details
 
100:0