ModelSim::List(3)
π ModelSim::List π
okay bestie, so this is the manual for ModelSim::List β a lil Perl module from the User Contributed Perl Documentation collection. It's the one that analyses the list output of the ModelSim simulator. Buckle up, we're doing EDA testing but make it cute β¨
πΈ NAME πΈ
ModelSim::List β Analyse the list output of the ModelSim simulator
π VERSION π
This document describes ModelSim::List 0.06 released on 2 June, 2007.
β¨ SYNOPSIS β¨
use ModelSim::List;
$list = ModelSim::List->new;
# ram.lst is generated by ModelSim
# simulator (via the "write list" command)
$list->parse('ram.lst') or
die $list->error();
# get the value of signal /ram/address at time 100:
$value = $list->strobe('/ram/address', 100);
# get the time when signal /alu/rdy get the value 1:
$time = $list->time_of('/alu/rdy', 1);
# specify regex rather than actual value:
$time = $list->time_of('/processor/bus_data', qr/^z+$/i);
$time = $list->time_of($signal, $value, $start_time);
$time = $list->time_of($signal, $value, $start_time, $end_time);
die $list->error() unless defined $time;
π¦ DESCRIPTION π¦
So this module hands you a class called ModelSim::List, and the whole point is: if you're an EDA tester, you can check the signals sitting inside the files that ModelSim's write list command spits out β but programmatically, like a real dev, instead of scrolling and squinting. π
π METHODS π
$list = ModelSim::List->new()
This is the constructor of the ModelSim::List class. It makes the object. That's it. That's the vibe. π«Ά
$list->parse($file_name)
This method gets the object to parse the list file you named in $file_name. And here's the slay part: you can call parse on the same object as many times as you want. Once you specify a list file, the new file overrides the old one completely β like, no leftovers, no crumbs, gone. π§Ή
And ngl, it doesn't even matter whether you used an -event option in your write list command to generate that file or not β the object will recognize the list format automatically. It just knows. iykyk.
Wanna see both formats? Say less. Here's one example for each of the two file formats:
ns /ram/mfc
delta /ram/bus_data
0 +2 1 xxxxxxxx
0 +3 0 zzzzzzzz
10 +0 1 0000aaaa
10 +1 0 0000abcd
29 +0 1 0000abcd
38 +0 0 0000abcd
38 +2 0 zzzzzzzz
86 +0 1 zzzzzzzz
86 +1 1 0000abcd
and if you use the -event option in the write list command, the list file will look like this:
@0 +0
/ram/mfc x
/ram/mfc 0
/ram/bus_data zzzzzzzz
/ram/bus_data zzzzzzzz
@10 +0
/ram/bus_data 0000abcd
@29 +0
/ram/mfc 1
@38 +0
/ram/mfc 0
@38 +2
The method returns 1 to indicate success. When it returns undef, it is recommended to check the error info via the error() method. (Translation: if it flops, go read the error, bestie. π)
$list->error()
Returns the error message for the last failed operation. Your little diagnostic bestie. π©Ή
$list->strobe($signal, $time)
The strobe method is used to get the value of a signal named $signal at any given time instant, $time. And listen β the object will preserve the original signal value format used in the list file. No format conversion will happen. Zero. None. It's giving "what you wrote is what you get". β¨
When strobe() returns undef, it is recommended to check the detailed info via the error() method if you feel surprised. (And you will feel surprised, bestie, that's the whole genre. π)
CAUTION: The delta number will be totally ignored. So if signal/module/abecomes0at"0 ns +0", and changes to1at"0 ns +1", then$obj->strobe('/module/a', 0)will return1rather than0. Yeah. That's the rule. Delta said "not today". π
$list->time_of($signal, $value, ?$start, ?$end)
You can utilize the time_of method to get the time instant when $signal first gained the value $value within the time interval specified by $tart and $end. Both the last two arguments are optional. In the case that $start is missing, the initial time 0 will be assumed. And if the signal fails to achieve $value, time_of will return undef. Rude, but honest. π€
If the $value argument is a regex ref, time_of will perform pattern matching instead of string comparing. Fancy, I know. π
When time_of() returns undef, it is recommended to check the detailed info via the error() method if you feel surprised. (Again. The surprise is canon.) π¦
π VERSION CONTROL π
You can always get the latest source from the following Subversion repository:
<http://svn.openfoundry.org/modlesimlist>
which has anonymous access to all. π
If you do want a commit bit, please let me know. π
π₯ BUGS π₯
There must be some serious bugs lurking somewhere. If you find one, please consider firing off a report to <http://rt.cpan.org>.
fr fr, go report it. The bugs are lurking. They're lowkey in their villain era and only you can stop them. π
β CODE COVERAGE β
I use Devel::Cover to test the code coverage of this module and here is the report:
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/ModelSim/List.pm 89.4 82.8 77.8 91.7 40.0 99.7 85.0
---------------------------- ------ ------ ------ ------ ------ ------ ------
πΈ AUTHOR πΈ
Agent Zhang (<agentzh@gmail.com>) β the icon who wrote this. π
π«Ά COPYRIGHT π«Ά
Copyright (C) 2005-2007 by Agent Zhang. .
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π SEE ALSO π
ModelSim Command Reference
and that's the whole page, bestie β you ate, no crumbs. this was rendered from the manpage source and dated 2025-07-25, manning it up as perl v5.42.0, filed under ModelSim::List(3). π β¨
π¦ where this page comes from
- fedora 43: perl-ModelSim-List 0.06-46.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms