Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
TDC core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
TDC core
Commits
01c194ea
Commit
01c194ea
authored
Sep 08, 2011
by
Sebastien Bourdeauducq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo: build BRAM initialization files
parent
cd65f5f7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
9 deletions
+29
-9
Makefile
demo/software/bios/Makefile
+14
-2
mmone-bios.bin
demo/software/bios/mmone-bios.bin
+0
-0
bin2hex.c
demo/tools/bin2hex.c
+15
-7
No files found.
demo/software/bios/Makefile
View file @
01c194ea
...
...
@@ -4,7 +4,19 @@ include $(MMDIR)/software/include.mak
OBJECTS
=
crt0.o main.o boot.o
SEGMENTS
=
-j
.text
-j
.data
-j
.rodata
all
:
bios.bin
all
:
bios.bin bios.h1 bios.h2 bios.h3 bios.h4
bios.h1
:
bios.bin
$(MMDIR)
/tools/bin2hex
$<
$@
4096 1
bios.h2
:
bios.bin
$(MMDIR)
/tools/bin2hex
$<
$@
4096 2
bios.h3
:
bios.bin
$(MMDIR)
/tools/bin2hex
$<
$@
4096 3
bios.h4
:
bios.bin
$(MMDIR)
/tools/bin2hex
$<
$@
4096 4
%.bin
:
%.elf
$(OBJCOPY)
$(SEGMENTS)
-O
binary
$<
$@
...
...
@@ -21,7 +33,7 @@ depend:
makedepend
-Y
--
$(CFLAGS)
--
*
.c
clean
:
rm
-f
*
.o bios.elf bios.bin .
*
~
*
~ Makefile.bak
rm
-f
*
.o bios.elf bios.bin
bios.h1 bios.h2 bios.h3 bios.h4
.
*
~
*
~ Makefile.bak
# DO NOT DELETE
...
...
demo/software/bios/mmone-bios.bin
deleted
100644 → 0
View file @
cd65f5f7
File deleted
demo/tools/bin2hex.c
View file @
01c194ea
/*
* Milkymist SoC
* Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
* Copyright (C) 2011 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -22,18 +23,25 @@ int main(int argc, char *argv[])
{
int
i
;
int
pad
;
int
pos
;
FILE
*
fdi
,
*
fdo
;
unsigned
char
w
[
4
];
if
(
argc
!=
4
)
{
fprintf
(
stderr
,
"Usage: bin2hex <infile> <outfile> <size>"
);
if
(
argc
!=
5
)
{
fprintf
(
stderr
,
"Usage: bin2hex <infile> <outfile> <size>
<pos>
\n
"
);
return
1
;
}
pad
=
atoi
(
argv
[
3
]);
if
(
pad
<=
0
)
{
fprintf
(
stderr
,
"Incorrect size"
);
fprintf
(
stderr
,
"Incorrect size
\n
"
);
return
1
;
}
pos
=
atoi
(
argv
[
4
]);
if
((
pos
<=
0
)
||
(
pos
>
4
))
{
fprintf
(
stderr
,
"Incorrect position
\n
"
);
return
1
;
}
pos
--
;
fdi
=
fopen
(
argv
[
1
],
"rb"
);
if
(
!
fdi
)
{
perror
(
"Unable to open input file"
);
...
...
@@ -47,14 +55,14 @@ int main(int argc, char *argv[])
}
while
(
1
)
{
if
(
fread
(
w
,
4
,
1
,
fdi
)
<=
0
)
break
;
fprintf
(
fdo
,
"%02hhx
%02hhx%02hhx%02hhx
\n
"
,
w
[
0
],
w
[
1
],
w
[
2
],
w
[
3
]);
fprintf
(
fdo
,
"%02hhx
\n
"
,
w
[
pos
]);
pad
--
;
}
fclose
(
fdi
);
if
(
pad
<
0
)
fprintf
(
stderr
,
"Warning: Input binary is larger than specified size"
);
if
(
pad
<
0
)
fprintf
(
stderr
,
"Warning: Input binary is larger than specified size
\n
"
);
for
(
i
=
0
;
i
<
pad
;
i
++
)
fprintf
(
fdo
,
"00
000000
\n
"
);
fprintf
(
fdo
,
"00
\n
"
);
if
(
fclose
(
fdo
)
!=
0
)
{
perror
(
"Unable to close output file"
);
return
1
;
...
...
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