repo.or.cz
/
fpgammix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
initial
[fpgammix.git]
/
tools
/
data2mif.sh
blob
a6b2394ed5da9811ba8757f230780a660f670ca5
1
#!/bin/bash
2
3
depth
=
256
4
5
printf
"WIDTH=32;
\n
"
6
printf
"DEPTH=%d;
\n
"
$depth
7
printf
"ADDRESS_RADIX=HEX;
\n
"
8
printf
"DATA_RADIX=HEX;
\n
"
9
printf
"CONTENT BEGIN
\n
"
10
a
=
0
11
while
read
v
12
do
13
printf
" %02x : %08x ;
\n
"
$a
0
x
$v
14
a
=
$
((
$a
+
1
))
15
done
<
$1
16
printf
" [%02x..%x] : 00000000;
\n
"
$a
$
((
depth
-
1
))
17
printf
"END;
\n
"