Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wrpc-sw
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
wr-cores
wrpc-sw
Commits
aa191d56
There was an error fetching the commit references. Please try again later.
Commit
aa191d56
authored
12 years ago
by
Wesley W. Terpstra
Browse files
Options
Downloads
Patches
Plain Diff
new tool genrammif: generate altera-formatted mif file from binary
parent
120770b7
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
Makefile
+5
-2
5 additions, 2 deletions
Makefile
tools/Makefile
+6
-8
6 additions, 8 deletions
tools/Makefile
tools/genrammif.c
+43
-0
43 additions, 0 deletions
tools/genrammif.c
with
56 additions
and
10 deletions
.gitignore
+
2
−
0
View file @
aa191d56
...
...
@@ -2,6 +2,7 @@
*.elf
*.ram
*.bin
*.mif
*.*~
*~
include/board.h
...
...
@@ -9,6 +10,7 @@ tools/zpu-loader
tools/vuart_console
tools/genraminit
tools/genramvhd
tools/genrammif
tools/lm32-loader
wrc_disasm.S
wrc.ram
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
5
−
2
View file @
aa191d56
...
...
@@ -90,7 +90,7 @@ OUTPUT = wrc
REVISION
=
$(
shell git describe
--dirty
--always
)
all
:
tools $(OUTPUT).ram $(OUTPUT).vhd
all
:
tools $(OUTPUT).ram $(OUTPUT).vhd
$(OUTPUT).mif
.PRECIOUS
:
%.elf %.bin
.PHONY
:
all tools clean gitmodules
...
...
@@ -111,7 +111,10 @@ $(OUTPUT).o: $(OBJS)
./tools/genraminit
$*
.bin 0
>
$@
%.vhd
:
tools %.bin
./tools/genramvhd
-s
90112
$*
.bin
>
$@
./tools/genramvhd
-s
`
.
./.config
;
echo
$$
CONFIG_RAMSIZE
`
$*
.bin
>
$@
%.mif
:
tools %.bin
./tools/genrammif
$*
.bin
`
.
./.config
;
echo
$$
CONFIG_RAMSIZE
`
>
$@
$(AUTOCONF)
:
silentoldconfig
...
...
This diff is collapsed.
Click to expand it.
tools/Makefile
+
6
−
8
View file @
aa191d56
CFLAGS
=
-Wall
-ggdb
-I
.
-I
../include
-Imini_bone
ALL
=
genraminit genramvhd genrammif
AS
=
as
LD
=
ld
...
...
@@ -10,16 +11,13 @@ STRIP = strip
OBJCOPY
=
objcopy
OBJDUMP
=
objdump
all
:
genraminit genramvhd
all
:
$(ALL)
genraminit
:
genraminit
.o
${
CC
}
-o
genraminit genraminit.o
%
:
%
.o
${
CC
}
-o
$@
$<
genramvhd
:
genramvhd.o
${
CC
}
-o
genramvhd genramvhd.o
%.o
:
%.c
${
CC
}
-c
$^
$(
CFLAGS
)
-O0
%.o
:
%.c
${
CC
}
-c
$^
$(
CFLAGS
)
-O0
clean
:
rm
-f
$(
ALL
)
*
.o
This diff is collapsed.
Click to expand it.
tools/genrammif.c
0 → 100644
+
43
−
0
View file @
aa191d56
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2013 GSI (www.gsi.de)
* Author: Wesley W. Terpstra <w.terpstra@gsi.de>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include
<stdio.h>
#include
<stdlib.h>
int
main
(
int
argc
,
char
*
argv
[])
{
unsigned
char
x
[
4
];
int
i
,
n
;
FILE
*
f
;
if
(
argc
<
3
)
return
1
;
if
(
!
(
f
=
fopen
(
argv
[
1
],
"rb"
)))
return
1
;
n
=
atoi
(
argv
[
2
])
/
4
;
printf
(
"DEPTH = %d;
\n
"
,
n
);
printf
(
"WIDTH = 32;
\n
"
);
printf
(
"ADDRESS_RADIX = HEX;
\n
"
);
printf
(
"DATA_RADIX = HEX;
\n
"
);
printf
(
"CONTENT
\n
"
);
printf
(
"BEGIN
\n
"
);
for
(
i
=
0
;
!
feof
(
f
);
++
i
)
{
fread
(
x
,
1
,
4
,
f
);
printf
(
"%x : %02X%02X%02X%02X;
\n
"
,
i
,
x
[
0
],
x
[
1
],
x
[
2
],
x
[
3
]);
}
for
(;
i
<
n
;
++
i
)
{
printf
(
"%x : %02X%02X%02X%02X;
\n
"
,
i
,
0
,
0
,
0
,
0
);
}
printf
(
"END;
\n
"
);
fclose
(
f
);
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment