line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# See copyright, etc in below POD section. |
2
|
|
|
|
|
|
|
###################################################################### |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Verilog::Std; |
5
|
12
|
|
|
12
|
|
72263
|
use Config; |
|
12
|
|
|
|
|
24
|
|
|
12
|
|
|
|
|
425
|
|
6
|
12
|
|
|
12
|
|
52
|
use IO::File; |
|
12
|
|
|
|
|
16
|
|
|
12
|
|
|
|
|
1091
|
|
7
|
12
|
|
|
12
|
|
54
|
use File::Path; |
|
12
|
|
|
|
|
17
|
|
|
12
|
|
|
|
|
588
|
|
8
|
12
|
|
|
12
|
|
466
|
use Verilog::Language; |
|
12
|
|
|
|
|
32
|
|
|
12
|
|
|
|
|
191
|
|
9
|
12
|
|
|
12
|
|
44
|
use Carp; |
|
12
|
|
|
|
|
12
|
|
|
12
|
|
|
|
|
431
|
|
10
|
12
|
|
|
12
|
|
52
|
use strict; |
|
12
|
|
|
|
|
14
|
|
|
12
|
|
|
|
|
265
|
|
11
|
|
|
|
|
|
|
|
12
|
12
|
|
|
12
|
|
48
|
use vars qw($VERSION); |
|
12
|
|
|
|
|
13
|
|
|
12
|
|
|
|
|
1953
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
###################################################################### |
15
|
|
|
|
|
|
|
#### Configuration Section |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$VERSION = '3.480'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
####################################################################### |
20
|
|
|
|
|
|
|
# It's a PITRA to have pure datafiles get installed properly, so we have |
21
|
|
|
|
|
|
|
# the std text here in this package. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $_Std_Text = <
|
24
|
|
|
|
|
|
|
`line 1 "Perl_Verilog::Std_module" 0 |
25
|
|
|
|
|
|
|
// Verilog-Perl Verilog::Std |
26
|
|
|
|
|
|
|
// The basis for this package is described in IEEE 1800-2017 Annex G |
27
|
|
|
|
|
|
|
package std; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
class semaphore; |
30
|
|
|
|
|
|
|
extern function new(int keyCount = 0); |
31
|
|
|
|
|
|
|
extern function void put(int keyCount = 1); |
32
|
|
|
|
|
|
|
extern task get(int keyCount = 1); |
33
|
|
|
|
|
|
|
extern function int try_get(int keyCount = 1); |
34
|
|
|
|
|
|
|
endclass |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
class mailbox #(type T = dynamic_singular_type) ; |
37
|
|
|
|
|
|
|
extern function new(int bound = 0); |
38
|
|
|
|
|
|
|
extern function int num(); |
39
|
|
|
|
|
|
|
extern task put( T message); |
40
|
|
|
|
|
|
|
extern function int try_put( T message); |
41
|
|
|
|
|
|
|
extern task get( ref T message ); |
42
|
|
|
|
|
|
|
extern function int try_get( ref T message ); |
43
|
|
|
|
|
|
|
extern task peek( ref T message ); |
44
|
|
|
|
|
|
|
extern function int try_peek( ref T message ); |
45
|
|
|
|
|
|
|
endclass |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
class process; |
48
|
|
|
|
|
|
|
typedef enum { FINISHED, RUNNING, WAITING, SUSPENDED, KILLED } state; |
49
|
|
|
|
|
|
|
extern static function process self(); |
50
|
|
|
|
|
|
|
extern function state status(); |
51
|
|
|
|
|
|
|
extern function void kill(); |
52
|
|
|
|
|
|
|
extern task await(); |
53
|
|
|
|
|
|
|
extern function void suspend(); |
54
|
|
|
|
|
|
|
extern function void resume(); |
55
|
|
|
|
|
|
|
endclass |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
// randomize is here, however the parsing rules are special, |
58
|
|
|
|
|
|
|
// For example there is "(null)", variable arguments, and "with {...}" |
59
|
|
|
|
|
|
|
// randomize really should be a language keyword. |
60
|
|
|
|
|
|
|
function int randomize(); |
61
|
|
|
|
|
|
|
endfunction |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
endpackage : std |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
import std::*; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
EOF |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
####################################################################### |
70
|
|
|
|
|
|
|
# ACCESSORS |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub std { |
73
|
461
|
|
33
|
461
|
1
|
1966
|
my $std = shift || Verilog::Language::language_standard(); |
74
|
461
|
50
|
|
|
|
2233
|
if ($std =~ /^1800/) { |
75
|
461
|
|
|
|
|
4061
|
return $_Std_Text; |
76
|
|
|
|
|
|
|
} else { |
77
|
0
|
|
|
|
|
|
return ""; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
####################################################################### |
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=pod |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 NAME |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Verilog::Std - SystemVerilog Built-in std Package Definition |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 SYNOPSIS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Internally used by Verilog::SigParser, etc. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use Verilog::Std; |
95
|
|
|
|
|
|
|
print Verilog::Std::std; |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 DESCRIPTION |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Verilog::Std contains the built-in "std" package required by the |
100
|
|
|
|
|
|
|
SystemVerilog standard. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 FUNCTIONS |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=over 4 |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item std({I}) |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
Return the definition of the std package. Optionally pass the language |
109
|
|
|
|
|
|
|
standard, defaulting to what Verilog::Language::language_standard returns if |
110
|
|
|
|
|
|
|
unspecified. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=back |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 DISTRIBUTION |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Verilog-Perl is part of the L free Verilog EDA |
117
|
|
|
|
|
|
|
software tool suite. The latest version is available from CPAN and from |
118
|
|
|
|
|
|
|
L. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
Copyright 2009-2022 by Wilson Snyder. This package is free software; you |
121
|
|
|
|
|
|
|
can redistribute it and/or modify it under the terms of either the GNU |
122
|
|
|
|
|
|
|
Lesser General Public License Version 3 or the Perl Artistic License |
123
|
|
|
|
|
|
|
Version 2.0. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head1 AUTHORS |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Wilson Snyder |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head1 SEE ALSO |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
L |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
###################################################################### |