source: trunk/IPs/systemC/processor/Morpheo/Script/xilinx_extract_info.sh @ 145

Last change on this file since 145 was 145, checked in by rosiere, 14 years ago

1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#!/bin/bash
2
3#-----------------------------------------------------------
4# $Id: xilinx_extract_info.sh 145 2010-10-13 18:15:51Z rosiere $
5#-----------------------------------------------------------
6
7##-----[ usage ]---------------------------------------------
8#function usage ()
9#{
10#    echo "Usage     : ${0} [files]";
11#    echo "Arguments : ";
12#    echo ' * files : lists of files. If empty, take *.fpga.log';
13##   echo "Notes     :";
14##   echo " * Morpheo's environnement must be positionned.";
15#
16#    exit;
17#}
18
19#-----[ xilinx_extract_info_usage ]-------------------------
20function xilinx_extract_info_usage()
21{
22    echo "${0} option [files]";
23    echo "Arguments : ";
24    echo ' * files : lists of files. If empty, take *.fpga.log';
25    echo " * -s : print summary section";
26    echo " * -t : print timing section";
27    exit 1;
28}
29
30#-----[ xilinx_extract_info_summary ]-----------------------
31function xilinx_extract_info_summary ()
32{
33    summary_line_begin=$(grep -n "Device utilization summary:" ${1} | cut -d : -f 1);
34    summary_line_end=$(grep -n "Partition Resource Summary:"   ${1} | cut -d : -f 1);
35
36    if test "${summary_line_begin}" != "" -a "${summary_line_end}" != ""; then
37        head -n $(($summary_line_end-1)) ${1} | tail -n $(($summary_line_end-$summary_line_begin));
38    fi;
39}
40
41#-----[ xilinx_extract_info_timing ]------------------------
42function xilinx_extract_info_timing ()
43{
44    timing_line_begin=$(grep -n "Timing Summary:"              ${1} | cut -d : -f 1);
45    timing_line_end=$(grep -n "Timing Detail:"                 ${1} | cut -d : -f 1);
46
47    if test "${timing_line_begin}" != "" -a "${timing_line_end}" != ""; then
48        head -n $(($timing_line_end-1))  ${1} | tail -n $(($timing_line_end-$timing_line_begin));
49    fi;
50}
51
52#-----[ main ]----------------------------------------------
53function xilinx_extract_info()
54{
55    local summary=0;
56    local timing=0;
57    local nb_params=$#;
58    set -- $(getopt :tsh "$@")
59    for arg
60    do  case "$arg" in
61            -t) timing=1;  nb_params=$((nb_params-1));;
62            -s) summary=1; nb_params=$((nb_params-1));;
63            -h) xilinx_extract_info_usage   ${*}; break;;
64            --) if test ${summary} -eq 0 -a ${timing} -eq 0; then
65                    summary=1;
66                    timing=1;
67                fi;
68
69        esac
70    done
71
72    if test $nb_params -eq 0; then
73        files="*.fpga.log";
74    else
75        files="$*";
76    fi;
77
78    for i in $files; do
79        if test -f ${i}; then
80            echo "===================| ${i}";
81
82            if test ${summary} -ne 0; then
83                xilinx_extract_info_summary  $i;
84            fi;
85            if test ${timing} -ne 0; then
86                xilinx_extract_info_timing  $i;
87            fi;
88        fi;
89    done
90}
91
92#-----[ Corps ]---------------------------------------------
93xilinx_extract_info ${*}
94
Note: See TracBrowser for help on using the repository browser.