ASIC/FPGA Design and Verification Out Source Services
This document shows a nice way to look for a certain pattern in all loaded specman e-files.
- I needed to maintain some specman code of a very large and complex project. Most of it was written by many people participating in the project, long before I arrived.
- Frequently one needs to search all loaded to the project specman e-files with a certain pattern.
- While there is probably an elegant method to do it within specman GUI, this requires a license, which we should try to use only for simulation: regression / debug purposes.
- Therefor I came up with the following scheme of search methodology:
Go to the place where specman saved its compilation log usually named: specman.elog.
Run the script, which is described below. The script extracts all files and stores the list to a file named: e_list_1.txt
The extraction is done in two steps executed from the file e_list.unx. This bash "grep"s all files from the compilation log and than calls a perl script, e_list.pl, to trim unnecessary words.
e_list.unx specman.elog
Once you have the list, you free to choose your own way of search. I'll show one way, which took me little time to develop.
cat e_list_1.txt | xargs -n1 | grep transmitter | xargs -i= grep -l tx_load_item_done =
- To get the scripts just go to the download area and look for specman_all_file_search.tar.gz.
- Some explanations to the script follows: e_search.
- Recently I had some spare time and improved the e_search script. The new one is very simple to read and maintain. It also communicates with the user using xmessage windows.: improved e_search.
- An even easier way of generating the list is explained below.Form the command line I issued, display all loaded and compiled files by: sh mod [show modules]
The output (in the specman.elog) looks like:
modules =
Name Lines Checksum Linked on
--------------------------- ------ ----------- ----------------
0. vr_ad_types 61 2906978188 Loaded
/tools/cds/ies/ies82.c.lnx86/ipcm_8.20-s003.lnx86/util_lib/vr_ad/e/vr_ad_types.e
1. ...
The script is simple and is shown below:
#!/bin/perl
open(FPR, $ARGV[0]) || die("open fail $ARGV[0]\n");
open(FPW, ">e_list_mod.txt");
$flg=0;
$cnt=0;
while(eof(FPR) != 1) {
$line=<FPR>; chomp($line);
if($flg == 0) {
if($line =~ /modules =/) {$flg=1;}
} else {
if($cnt == 0) {
if($line =~ /[0-9]*\..*Loaded/) {$cnt++;}
}
elsif($cnt > 0) {
if($line =~ /\.e/) {
$line =~ s/^ *//g;
$cnt=0;
print FPW ("$line\n");
}
}
}
}#while
close(FPR);
close(FPW);
- You can do the same, i.e. genearting list of all loaded source files, for your HDL (VHDL/verilog) files. The list of HDL files, which were loaded to the simulator, are generated by the command:
For ncsim do:
ncls -source -verilog -SNAPSHOT pm_tb_lib.pm_tb:module pm_tb_lib.pm_tb:modulegrep -e "\.vhd" -e "\.v" ncls.log > v_list.txt
For QUESTA / MTI simulator do:
write report file.list
From the command line and grep the source files.
-
Once you generated a list of files, you can easily invoke them with vim.
Just put the cursor on the file name and type the
gf or CtrlW F
(vim command: open file name under cursor).
Contact me now at: |