OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [tools/] [amber-jumps.sh] - Blame information for rev 62

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 csantifort
#!/bin/bash
2
 
3
#--------------------------------------------------------------#
4
#                                                              #
5
#  amber-jumps.sh                                              #
6
#                                                              #
7
#  This file is part of the Amber project                      #
8
#  http://www.opencores.org/project,amber                      #
9
#                                                              #
10
#  Description                                                 #
11
#  Parse the Amber disassembly file, amber.dis, and extract    #
12
#  all the function jumps, using the test disassembly file     #
13
#  to get the function names and addresses.                    #
14
#                                                              #
15
#  Author(s):                                                  #
16
#      - Conor Santifort, csantifort.amber@gmail.com           #
17
#                                                              #
18
#//////////////////////////////////////////////////////////////#
19
#                                                              #
20
# Copyright (C) 2010 Authors and OPENCORES.ORG                 #
21
#                                                              #
22
# This source file may be used and distributed without         #
23
# restriction provided that this copyright statement is not    #
24
# removed from the file and that any derivative work contains  #
25
# the original copyright notice and the associated disclaimer. #
26
#                                                              #
27
# This source file is free software; you can redistribute it   #
28
# and/or modify it under the terms of the GNU Lesser General   #
29
# Public License as published by the Free Software Foundation; #
30
# either version 2.1 of the License, or (at your option) any   #
31
# later version.                                               #
32
#                                                              #
33
# This source is distributed in the hope that it will be       #
34
# useful, but WITHOUT ANY WARRANTY; without even the implied   #
35
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      #
36
# PURPOSE.  See the GNU Lesser General Public License for more #
37
# details.                                                     #
38
#                                                              #
39
# You should have received a copy of the GNU Lesser General    #
40
# Public License along with this source; if not, download it   #
41
# from http://www.opencores.org/lgpl.shtml                     #
42
#                                                              #
43
#--------------------------------------------------------------#
44
 
45
show_usage() {
46
    echo " Usage:"
47
    echo "$0 <test-name>"
48
    exit
49
}
50
 
51
 
52
MINARGS=1
53
 
54
case $1 in
55
        ""|"-h"|"--help") show_usage ;;
56
esac
57
 
58
if [[ $# -lt $MINARGS ]] ; then
59
 echo "Too few arguments given (Minimum:$MINARGS)"
60
 echo
61
 show_usage
62
fi
63
 
64
 
65
#--------------------------------------------------------
66
# Find the test
67
#--------------------------------------------------------
68
TEST_NAME=$1
69
 
70
# First check if its an assembly test
71
if [ -f ../tests/${TEST_NAME}.S ]; then
72
    TEST_DIS=../tests/${TEST_NAME}.dis
73
elif [ -d ../../sw/${TEST_NAME} ]; then
74
    TEST_DIS=../../sw/${TEST_NAME}/${TEST_NAME}.dis
75
else
76
    echo "Test ${TEST_NAME} not found"
77
    exit
78
fi
79
 
80
 
81 61 csantifort
grep jump amber.dis | awk '{print $1, $4, $6, $8, $10}' | sed 's/,//g' > /tmp/jumps
82 2 csantifort
 
83
grep '>:' $TEST_DIS  | sed 's/<//' | sed 's/>://' > /tmp/funcsx
84
 
85
sort /tmp/funcsx > /tmp/funcs
86
 
87
# Remove some very common linux function jumps
88
../../sw/tools/amber-func-jumps /tmp/jumps /tmp/funcs \
89
  | grep -v "cpu_idle -" \
90
  | grep -v "cpu_idle <" \
91
  | grep -v "default_idle -" \
92
  | grep -v "default_idle <"
93
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.