source: trunk/IPs/systemC/processor/Morpheo/Script/log_trace.pl @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 2.8 KB
Line 
1#! /usr/bin/perl -w
2
3### -------------------------------------------------------------- ###
4#                                                                    #
5# File       : log_trace.pl                                          #
6# Authors    : Sroka Marek                                          #
7# Date       : 20/07/2006                                            #
8# Modif.     : 18/08/2006                                            #
9# Version    : 1.0                                                   #
10#                                                                    #
11# Origin     : this description has been developed by CAO-VLSI team  #
12#              at ASIM laboratory, University Pierre et Marie Curie  #
13#              4 Place Jussieu 75252 Paris Cedex 05 - France         #
14#                                                                    #
15### -------------------------------------------------------------- ###
16
17my $TAB1='|  ';
18my $TAB2='+--';
19
20sub usage() 
21{
22    print "Usage     : $0 rob_trace_file nm_file\n";
23    print "Arguments : ";
24    print " * rob_trace_file : Trace file generate by simulation\n";
25    print " * nm_file        : List of symbol (generate by nm)\n";
26    exit(1);
27}
28
29my $rob = $ARGV[0];
30my $nm  = $ARGV[1];
31
32if (not defined $rob) 
33{
34    usage();
35}
36
37unless (defined $nm) 
38{
39    usage();
40}
41
42my %calls=();
43my %end=();
44
45open (nm_f,$nm) or die "could not open $nm : $!\n";
46
47my $current_section;
48
49while ($line = <nm_f>) 
50{ 
51    if ($line =~ /([0-9a-f]{8}) [Tt] (.*)/) 
52    { 
53        my $addr=hex $1;
54        $calls{$addr}=$2;
55        $end{$current_section} = $addr if (defined $current_section);
56        $current_section=$addr;
57    }
58}
59
60$end{$current_section}=0xffffffff;
61
62close nm_f;
63
64my @pile  = ();
65my $depth = 0;
66open (rob_f,$rob) or die "could not open $rob : $!\n";
67
68print "[ time     ] ","depth"," ","address "," ","function\n";
69
70while (<rob_f>) 
71{
72    if (/(\d+) inst OK - \@([0-9a-f]{8})/) 
73    {
74        my $addr        = hex $2;
75        my $time        = sprintf "%-8d",$1;
76        my $print_addr  = sprintf "%-8x",$addr;
77
78        if (exists $calls{$addr}) 
79        { 
80            my $print_depth = sprintf "%-5d",$depth;
81            $depth = $depth + 1;
82
83            #print "[ $time ] ",$print_depth," ",$print_addr," ",$TAB1x@pile,"[1;32m$calls{$addr}[0m\n";
84            print "[ $time ] ",$print_depth," ",$print_addr," ",$TAB1 x(@pile-1),$TAB2,"  $calls{$addr}\n";
85            push(@pile,$addr);
86        }
87
88        while (@pile and ($addr < $pile[-1] or $addr >= $end{$pile[-1]})) 
89        {
90            $depth = $depth - 1;
91            my $print_depth = sprintf "%-5d",$depth;
92
93            my $end=pop(@pile);
94            #print "[ $time ] ",$print_depth," ","        "," ",$TAB2x@pile,"[0;31m$calls{$end}[0m\n";
95            print "[ $time ] ",$print_depth," ","        "," ",$TAB1 x@pile,"  $calls{$end}\n";
96        }
97    }
98}
99close rob_f;
Note: See TracBrowser for help on using the repository browser.