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

Subversion Repositories amber

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

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 2 csantifort
awk '{printf "    .SRAM0_INIT_" NR-1 " ( 256%ch", 39 } \
46 36 csantifort
     $8==""  {printf "00000000"} \
47
     $7==""  {printf "00000000"} \
48
     $6==""  {printf "00000000"} \
49
     $5==""  {printf "00000000"} \
50
     $4==""  {printf "00000000"} \
51
     $3==""  {printf "00000000"} \
52
     $2==""  {printf "00000000"} \
53
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
54 2 csantifort
     > $2
55
 
56 36 csantifort
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==2' |\
57
paste -d" "  - - - - - - - - | \
58 2 csantifort
awk '{printf "    .SRAM1_INIT_" NR-1 " ( 256%ch", 39 } \
59 36 csantifort
     $8==""  {printf "00000000"} \
60
     $7==""  {printf "00000000"} \
61
     $6==""  {printf "00000000"} \
62
     $5==""  {printf "00000000"} \
63
     $4==""  {printf "00000000"} \
64
     $3==""  {printf "00000000"} \
65
     $2==""  {printf "00000000"} \
66
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
67 2 csantifort
     >> $2
68 36 csantifort
 
69
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==3' |\
70
paste -d" "  - - - - - - - - | \
71 2 csantifort
awk '{printf "    .SRAM2_INIT_" NR-1 " ( 256%ch", 39 } \
72 36 csantifort
     $8==""  {printf "00000000"} \
73
     $7==""  {printf "00000000"} \
74
     $6==""  {printf "00000000"} \
75
     $5==""  {printf "00000000"} \
76
     $4==""  {printf "00000000"} \
77
     $3==""  {printf "00000000"} \
78
     $2==""  {printf "00000000"} \
79
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
80 2 csantifort
     >> $2
81
 
82 36 csantifort
 
83
grep '@' $1 | awk '{print $2}'  |  awk 'NR%4==0' |\
84
paste -d" "  - - - - - - - - | \
85 2 csantifort
awk '{printf "    .SRAM3_INIT_" NR-1 " ( 256%ch", 39 } \
86 36 csantifort
     $8==""  {printf "00000000"} \
87
     $7==""  {printf "00000000"} \
88
     $6==""  {printf "00000000"} \
89
     $5==""  {printf "00000000"} \
90
     $4==""  {printf "00000000"} \
91
     $3==""  {printf "00000000"} \
92
     $2==""  {printf "00000000"} \
93
     {print $8 $7 $6 $5 $4 $3 $2 $1 " )," } '  \
94 2 csantifort
     >> $2
95
 
96
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.