File: label_function.v

package info (click to toggle)
verilog-mode 20161124.fd230e6-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 3,764 kB
  • ctags: 5,143
  • sloc: lisp: 12,430; perl: 293; makefile: 146; sh: 35; fortran: 2
file content (66 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module test();

  // function with no lifetime, return-type, or port-list
  function f0;
    blah0;
  endfunction

  // empty port-list
  function f1();
    blah1;
  endfunction

  // non-empty portlist
  function f2(stuff2);
    blah2;
  endfunction

  // test that ": function_identifier" remains unscathed
  function f3;
  endfunction : f3

  // return type
  function void f4;
    blah4;
  endfunction

  // return type with empty port-list.
  function void f5();
    int i;
    begin
      blah4;
    end
  endfunction

  // return type, non-empty portlist
  // also check that a stale auto-comment gets removed
  function void f6(stuff,
                   that,
                   spans,
                   lines);
    blah5;
  endfunction // fX

  // test lifetime keywords 'automatic' and 'static'
  function automatic f7();
  endfunction

  // test a crazy-long function declaration
  function static union packed signed {bit[1:0] a, bit[2:0] b} [5:0] f8(input ports, input ports, output ports);
  endfunction

  // port-list that doesn't start on the same line as the function declaration
  function automatic void f9
    (int a,
     int b);
  endfunction

  // mismatched keyword
  function f10;
  endtask

  // make sure previous screw-up doesn't affect future functions
  function f11;
  endfunction

endmodule