Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
30
Issues
30
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
aa191d56
Commit
aa191d56
authored
Mar 05, 2013
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new tool genrammif: generate altera-formatted mif file from binary
parent
120770b7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
10 deletions
+56
-10
.gitignore
.gitignore
+2
-0
Makefile
Makefile
+5
-2
Makefile
tools/Makefile
+6
-8
genrammif.c
tools/genrammif.c
+43
-0
No files found.
.gitignore
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
...
...
Makefile
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
...
...
tools/Makefile
View file @
aa191d56
CFLAGS
=
-Wall
-ggdb
-I
.
-I
../include
-Imini_bone
ALL
=
genraminit genramvhd genrammif
AS
=
as
LD
=
ld
...
...
@@ -10,13 +11,10 @@ STRIP = strip
OBJCOPY
=
objcopy
OBJDUMP
=
objdump
all
:
genraminit genramvhd
all
:
$(ALL)
genraminit
:
genraminit.o
${
CC
}
-o
genraminit genraminit.o
genramvhd
:
genramvhd.o
${
CC
}
-o
genramvhd genramvhd.o
%
:
%.o
${
CC
}
-o
$@
$<
%.o
:
%.c
${
CC
}
-c
$^
$(CFLAGS)
-O0
...
...
tools/genrammif.c
0 → 100644
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment