ASIC/FPGA Design and Verification Out Source Services
This page show a little script to create a soft link in a given directory to all assorted coverage files.
- This script was targeted to specman tool. After regression the coverage files are in different directories. The scripts creates soft links in a single directory. the soft link includes the name found plus the directory name to overcome same seed case, by creating a unique name per each entry.
#!/bin/bash
if [ "$1" = "ucd" ] ; then
if [ "$2" = "" ] ; then
echo -n "you "
tput bold;
echo -n "must "
tput sgr0
echo "enter a destination directory if you select the ucd script generation"
exit
fi
ucd_cnt="0"
echo -n "prepare ucd soft link / copy script "
tput bold;
echo "link_ucd.sh"
tput sgr0
if [ -e "link_ucd.sh" ] ; then
\rm -f link_ucd.sh
fi
for f in $(find ./ -name "*.ucd"); do
ucd_cnt=$[$ucd_cnt+1]
ucd_mod=$(($ucd_cnt % $cnt_prg))
if [ $ucd_mod -eq "0" ] ; then
echo -ne "${ucd_mod} ucd files processed so far\r"
fi
f1=`echo $f | sed "s/\.\/ucd_tests//g"`
f2=`echo $f1 | sed "s/\//_/g"`
f1=`echo $f2 | sed "s/^\.//"`
f3=c"$f1"
# f4="ln -s"
f4="cp -f"
f5="$f4 $f ${2}"/"$f3"
echo "$f5" >> link_ucd.sh
done
fi
-
A few words on the bash script:
If you don't enter the first parameter as ucd, the script does nothing.
If you enter the first parameter, it must be followed by a second parameter. If you forget, to specify the second parameter, it will exit and print an error message, using bash echo font bold option.
Contact me now at: |