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

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [tools/] [amber-memparams128.sh] - Blame information for rev 71

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 36 csantifort
#  amber-memparams128.sh                                       #
6 2 csantifort
#                                                              #
7
#  This file is part of the Amber project                      #
8
#  http://www.opencores.org/project,amber                      #
9
#                                                              #
10
#  Description                                                 #
11
#  Create a memparams file. Used to seed the boot_mem SRAM     #
12
#                                                              #
13
#  Author(s):                                                  #
14
#      - Conor Santifort, csantifort.amber@gmail.com           #
15
#                                                              #
16
#//////////////////////////////////////////////////////////////#
17
#                                                              #
18
# Copyright (C) 2010 Authors and OPENCORES.ORG                 #
19
#                                                              #
20
# This source file may be used and distributed without         #
21
# restriction provided that this copyright statement is not    #
22
# removed from the file and that any derivative work contains  #
23
# the original copyright notice and the associated disclaimer. #
24
#                                                              #
25
# This source file is free software; you can redistribute it   #
26
# and/or modify it under the terms of the GNU Lesser General   #
27
# Public License as published by the Free Software Foundation; #
28
# either version 2.1 of the License, or (at your option) any   #
29
# later version.                                               #
30
#                                                              #
31
# This source is distributed in the hope that it will be       #
32
# useful, but WITHOUT ANY WARRANTY; without even the implied   #
33
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      #
34
# PURPOSE.  See the GNU Lesser General Public License for more #
35
# details.                                                     #
36
#                                                              #
37
# You should have received a copy of the GNU Lesser General    #
38
# Public License along with this source; if not, download it   #
39
# from http://www.opencores.org/lgpl.shtml                     #
40
#                                                              #
41
#--------------------------------------------------------------#
42
 
43 36 csantifort
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==1' |\
44
paste -d" "  - - - - - - - - | \
45 61 csantifort
awk '{ if      (NR<=64)  { printf "    .SRAM0_INIT_" NR-1  " ( 256%ch", 39 }  \
46
       else if (NR<=128) { printf "    .SRAM4_INIT_" NR-65 " ( 256%ch", 39 }} \
47 36 csantifort
     $8==""  {printf "00000000"} \
48
     $7==""  {printf "00000000"} \
49
     $6==""  {printf "00000000"} \
50
     $5==""  {printf "00000000"} \
51
     $4==""  {printf "00000000"} \
52
     $3==""  {printf "00000000"} \
53
     $2==""  {printf "00000000"} \
54
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
55 2 csantifort
     > $2
56
 
57 36 csantifort
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==2' |\
58
paste -d" "  - - - - - - - - | \
59 61 csantifort
awk '{ if      (NR<=64)  { printf "    .SRAM1_INIT_" NR-1  " ( 256%ch", 39 }  \
60
       else if (NR<=128) { printf "    .SRAM5_INIT_" NR-65 " ( 256%ch", 39 }} \
61 36 csantifort
     $8==""  {printf "00000000"} \
62
     $7==""  {printf "00000000"} \
63
     $6==""  {printf "00000000"} \
64
     $5==""  {printf "00000000"} \
65
     $4==""  {printf "00000000"} \
66
     $3==""  {printf "00000000"} \
67
     $2==""  {printf "00000000"} \
68
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
69 2 csantifort
     >> $2
70 36 csantifort
 
71
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==3' |\
72
paste -d" "  - - - - - - - - | \
73 61 csantifort
awk '{ if      (NR<=64)  { printf "    .SRAM2_INIT_" NR-1  " ( 256%ch", 39 }  \
74
       else if (NR<=128) { printf "    .SRAM6_INIT_" NR-65 " ( 256%ch", 39 }} \
75 36 csantifort
     $8==""  {printf "00000000"} \
76
     $7==""  {printf "00000000"} \
77
     $6==""  {printf "00000000"} \
78
     $5==""  {printf "00000000"} \
79
     $4==""  {printf "00000000"} \
80
     $3==""  {printf "00000000"} \
81
     $2==""  {printf "00000000"} \
82
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
83 2 csantifort
     >> $2
84
 
85 36 csantifort
 
86
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==0' |\
87
paste -d" "  - - - - - - - - | \
88 61 csantifort
awk '{ if      (NR<=64)  { printf "    .SRAM3_INIT_" NR-1  " ( 256%ch", 39 }  \
89
       else if (NR<=128) { printf "    .SRAM7_INIT_" NR-65 " ( 256%ch", 39 }} \
90 36 csantifort
     $8==""  {printf "00000000"} \
91
     $7==""  {printf "00000000"} \
92
     $6==""  {printf "00000000"} \
93
     $5==""  {printf "00000000"} \
94
     $4==""  {printf "00000000"} \
95
     $3==""  {printf "00000000"} \
96
     $2==""  {printf "00000000"} \
97
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
98 2 csantifort
     >> $2
99
 
100
echo "    .UNUSED       ( 1'd0 ) " >> $2

powered by: WebSVN 2.1.0

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