1 |
11 |
csantifort |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
#--------------------------------------------------------------#
|
4 |
|
|
# #
|
5 |
|
|
# amber-get-segment.sh #
|
6 |
|
|
# #
|
7 |
|
|
# This file is part of the Amber project #
|
8 |
|
|
# http://www.opencores.org/project,amber #
|
9 |
|
|
# #
|
10 |
|
|
# Description #
|
11 |
|
|
# Copy a small section of the Amber disassembly file into #
|
12 |
|
|
# another file, mid.dis. Useful when the amber.dis file #
|
13 |
|
|
# becomes too large to view all at once in a text editor. #
|
14 |
|
|
# This script takes the tick count as its input argument. #
|
15 |
|
|
# #
|
16 |
|
|
# Author(s): #
|
17 |
|
|
# - Conor Santifort, csantifort.amber@gmail.com #
|
18 |
|
|
# #
|
19 |
|
|
#//////////////////////////////////////////////////////////////#
|
20 |
|
|
# #
|
21 |
|
|
# Copyright (C) 2010 Authors and OPENCORES.ORG #
|
22 |
|
|
# #
|
23 |
|
|
# This source file may be used and distributed without #
|
24 |
|
|
# restriction provided that this copyright statement is not #
|
25 |
|
|
# removed from the file and that any derivative work contains #
|
26 |
|
|
# the original copyright notice and the associated disclaimer. #
|
27 |
|
|
# #
|
28 |
|
|
# This source file is free software; you can redistribute it #
|
29 |
|
|
# and/or modify it under the terms of the GNU Lesser General #
|
30 |
|
|
# Public License as published by the Free Software Foundation; #
|
31 |
|
|
# either version 2.1 of the License, or (at your option) any #
|
32 |
|
|
# later version. #
|
33 |
|
|
# #
|
34 |
|
|
# This source is distributed in the hope that it will be #
|
35 |
|
|
# useful, but WITHOUT ANY WARRANTY; without even the implied #
|
36 |
|
|
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR #
|
37 |
|
|
# PURPOSE. See the GNU Lesser General Public License for more #
|
38 |
|
|
# details. #
|
39 |
|
|
# #
|
40 |
|
|
# You should have received a copy of the GNU Lesser General #
|
41 |
|
|
# Public License along with this source; if not, download it #
|
42 |
|
|
# from http://www.opencores.org/lgpl.shtml #
|
43 |
|
|
# #
|
44 |
|
|
#--------------------------------------------------------------#
|
45 |
|
|
|
46 |
|
|
MIDPOS=`grep -n " $1 " amber.dis | awk {'print $1'} | sed s/:// | head -1`
|
47 |
|
|
HEADEND=$(( $MIDPOS + 10000 ))
|
48 |
|
|
head -$HEADEND < amber.dis > amber.head
|
49 |
|
|
tail -20000 < amber.head > mid.dis
|
50 |
|
|
|
51 |
|
|
|