1ModelSim::List(3) User Contributed Perl Documentation ModelSim::List(3)
2
3
4
6 ModelSim::List - Analyse the 'list' output of the ModelSim simulator
7
9 This document describes ModelSim::List 0.06 released on 2 June, 2007.
10
12 use ModelSim::List;
13 $list = ModelSim::List->new;
14
15 # ram.lst is generated by ModelSim
16 # simulator (via the "write list" command)
17 $list->parse('ram.lst') or
18 die $list->error();
19
20 # get the value of signal /ram/address at time 100:
21 $value = $list->strobe('/ram/address', 100);
22
23 # get the time when signal /alu/rdy get the value 1:
24 $time = $list->time_of('/alu/rdy', 1);
25
26 # specify regex rather than actual value:
27 $time = $list->time_of('/processor/bus_data', qr/^z+$/i);
28
29 $time = $list->time_of($signal, $value, $start_time);
30 $time = $list->time_of($signal, $value, $start_time, $end_time);
31 die $list->error() unless defined $time;
32
34 This module provides a class named "ModelSim::List" with which the EDA
35 tester can easily check in the signals contained in the files generated
36 by ModelSim's "write list" command in a programming manner.
37
39 "$list = ModelSim::List->new()"
40 This is the constructor of the "ModelSim::List" class.
41
42 "$list->parse($file_name)"
43 This method gets the object parse the list file specified as
44 $file_name. You can invoke the parse method on the same object
45 several times. Once you specify a list file, the new file will
46 override the old one completely. No matter whether you use an
47 "-event" option in your "write list" command to generate the file
48 or not, the object will recognize the list format automatically.
49
50 I'd like to give one example for each of the two file format here:
51
52 ns /ram/mfc
53 delta /ram/bus_data
54 0 +2 1 xxxxxxxx
55 0 +3 0 zzzzzzzz
56 10 +0 1 0000aaaa
57 10 +1 0 0000abcd
58 29 +0 1 0000abcd
59 38 +0 0 0000abcd
60 38 +2 0 zzzzzzzz
61 86 +0 1 zzzzzzzz
62 86 +1 1 0000abcd
63
64 and if you use the "-event" option in the "write list" command, the
65 list file will like follows:
66
67 @0 +0
68 /ram/mfc x
69 /ram/mfc 0
70 /ram/bus_data zzzzzzzz
71 /ram/bus_data zzzzzzzz
72 @10 +0
73 /ram/bus_data 0000abcd
74 @29 +0
75 /ram/mfc 1
76 @38 +0
77 /ram/mfc 0
78 @38 +2
79
80 The method returns 1 to indicate success. When it returns undef, it
81 is recommended to check the error info via the "error()" method.
82
83 "$list->error()"
84 Returns the error message for the last failed operation.
85
86 "$list->strobe($signal, $time)"
87 The strobe method are used to get the value of a signal named
88 $signal at any given time instant, $time. The object will preserve
89 the original signal value format used in the list file. No format
90 conversion will happen.
91
92 When "strobe()" returns undef, it is recommended to check the
93 detailed info via the "error()" method if you feel surprised.
94
95 CAUTION: The delta number will be totally ignored. Therefore, if
96 signal /module/a becomes 0 at "0 ns +0", and changes to 1 at "0 ns
97 +1", thus "$obj->strobe('/module/a', 0)" will return 1 rather than
98 0.
99
100 "$list->time_of($signal, $value, ?$start, ?$end)"
101 You can utilize the time_of method to get the time instant when
102 $signal first gained the value $value within the time interval
103 specified by $tart and $end. Both the last two arguments are
104 optional. In the case that $start is missing, the initial time 0
105 will be assumed. If the signal fails to achieve $value, time_of
106 will return undef.
107
108 If the $value argument is a regex ref, time_of will perform pattern
109 matching instead of string comparing.
110
111 When "time_of()" returns undef, it is recommended to check the
112 detailed info via the "error()" method if you feel surprised.
113
115 You can always get the latest source from the following Subversion
116 repository:
117
118 <http://svn.openfoundry.org/modlesimlist>
119
120 which has anonymous access to all.
121
122 If you do want a commit bit, please let me know.
123
125 There must be some serious bugs lurking somewhere. If you find one,
126 please consider firing off a report to <http://rt.cpan.org>.
127
129 I use Devel::Cover to test the code coverage of this module and here is
130 the report:
131
132 ---------------------------- ------ ------ ------ ------ ------ ------ ------
133 File stmt bran cond sub pod time total
134 ---------------------------- ------ ------ ------ ------ ------ ------ ------
135 blib/lib/ModelSim/List.pm 89.4 82.8 77.8 91.7 40.0 99.7 85.0
136 ---------------------------- ------ ------ ------ ------ ------ ------ ------
137
139 Agent Zhang (<agentzh@gmail.com>)
140
142 Copyright (C) 2005-2007 by Agent Zhang. .
143
144 This library is free software; you can redistribute it and/or modify it
145 under the same terms as Perl itself.
146
148 ModelSim Command Reference
149
150
151
152perl v5.32.0 2020-07-28 ModelSim::List(3)