Return Statement in Specman - example #2 - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

  Testbench + Design
  Specman  

 Tools & Simulators

 Examples

205


17
 
1
<'
2
extend sys {
3
4
   get_value() : uint is {
5
      return 2;
6
   };
7
   
8
   get_value() : uint is first {
9
      return 1;
10
   };
11
      
12
   run() is also {
13
      messagef(NONE, "Returned value is: %d", get_value());
14
   };
15
};
16
17
'>
11
 
1
module top;
2
  
3
  bit clock;
4
  
5
  initial begin
6
    clock = 0;
7
    forever #5 clock = ~clock;
8
  end
9
  
10
endmodule
11
76 views and 0 likes     
 
This example is part of the blog post "[The Strange Ways of Specman’s Return Statement](http://cfs-vision.com/2022/04/12/the-strange-ways-of-specmans-return-statement/)"
It shows how *return* statement works in Specman when we are dealing with method extensions.

This example is part of the blog post "The Strange Ways of Specman’s Return Statement"

It shows how return statement works in Specman when we are dealing with method extensions.

3450:0