File: file.svh

package info (click to toggle)
gtksourceview4 4.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,840 kB
  • sloc: ansic: 49,715; sh: 4,917; xml: 1,302; makefile: 1,010; python: 230; perl: 52; yacc: 45; cobol: 20; objc: 19; sed: 16; fortran: 14; cpp: 8; ml: 3
file content (46 lines) | stat: -rw-r--r-- 1,089 bytes parent folder | download | duplicates (15)
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
class my_class extends some_class;

  // This is a comment.
  /* This is also a comment, but it containts keywords: bit string, etc */

  // Some types.
  string         my_string = "This is a string";
  bit [3:0]        my_bits = 4'b0z1x;
  integer       my_integer = 32'h0z2ab43x;
  real             my_real = 1.2124155e-123;
  shortreal   my_shortreal = -0.1111e1;
  int               my_int = 53152462;
 
  extern function bit
    my_function(
      int unsigned       something);

endclass : my_class

function bit
  my_class::my_function(
    int unsigned    something);

  /* Display a string.
   *
   *   This is a slightly awkward string as it has
   *   special characters and line continuations.
   */
  ("Display a string that continues over             multiple lines and contains special             characters: \n \t \" \'");

  // Use a system task.
  my_int = (my_bits);

  // ();     // Commenting a system task.
  // my_function();   // Commenting a function.

endfunction my_function

program test();

  my_class c;

  c = new();
  c.my_function(3);

endprogram : test