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
31
Issues
31
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
f32a938c
Commit
f32a938c
authored
Nov 13, 2015
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate *.bram instead of *.ram file for faster synthesis
parent
2f6024bc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
18 deletions
+37
-18
.gitignore
.gitignore
+1
-1
Makefile
Makefile
+4
-4
genraminit.c
tools/genraminit.c
+32
-13
No files found.
.gitignore
View file @
f32a938c
*.o
*.a
*.elf
*.ram
*.
b
ram
*.bin
*.mif
*.*~
...
...
Makefile
View file @
f32a938c
...
...
@@ -63,7 +63,7 @@ obj-$(CONFIG_EMBEDDED_NODE) += \
cflags-$(CONFIG_LM32)
+=
-mmultiply-enabled
-mbarrel-shift-enabled
ldflags-$(CONFIG_LM32)
=
-mmultiply-enabled
-mbarrel-shift-enabled
\
-nostdlib
-T
$(LDS-y)
arch-files-$(CONFIG_LM32)
=
$(OUTPUT).ram
$(OUTPUT).vhd
$(OUTPUT).mif
arch-files-$(CONFIG_LM32)
=
$(OUTPUT).
b
ram
$(OUTPUT).vhd
$(OUTPUT).mif
# packet-filter rules: for CONFIG_VLAN we use both sets
...
...
@@ -173,8 +173,8 @@ config.o: .config
%.bin
:
%.elf
${
OBJCOPY
}
-O
binary
$^
$@
%.ram
:
tools %.bin
./tools/genraminit
$*
.bin
0
>
$@
%.
b
ram
:
tools %.bin
./tools/genraminit
$*
.bin
$(CONFIG_RAMSIZE)
>
$@
%.vhd
:
tools %.bin
./tools/genramvhd
-s
$(CONFIG_RAMSIZE)
$*
.bin
>
$@
...
...
@@ -185,7 +185,7 @@ config.o: .config
$(AUTOCONF)
:
silentoldconfig
clean
:
rm
-f
$(OBJS)
$(OUTPUT)
.elf
$(OUTPUT)
.bin
$(OUTPUT)
.ram
\
rm
-f
$(OBJS)
$(OUTPUT)
.elf
$(OUTPUT)
.bin
$(OUTPUT)
.
b
ram
\
$(LDS)
rules-
*
.bin
$(MAKE)
-C
$(PPSI)
clean
$(MAKE)
-C
sdb-lib clean
...
...
tools/genraminit.c
View file @
f32a938c
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 201
1
CERN (www.cern.ch)
* Author:
Tomasz Wlostowski <tomasz.wlostowski
@cern.ch>
* Copyright (C) 201
7
CERN (www.cern.ch)
* Author:
Grzegorz Daniluk <grzegorz.daniluk
@cern.ch>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
const
char
*
byte_to_binary
(
int
x
)
{
unsigned
int
z
;
static
char
b
[
33
];
b
[
0
]
=
'\0'
;
for
(
z
=
0x80000000
;
z
>
0
;
z
>>=
1
)
{
strcat
(
b
,
((
x
&
z
)
==
z
)
?
"1"
:
"0"
);
}
return
b
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
3
)
return
-
1
;
FILE
*
f
=
fopen
(
argv
[
1
],
"rb"
);
if
(
!
f
)
return
-
1
;
unsigned
char
x
[
4
]
;
int
tmp
;
int
i
=
0
;
int
n
=
atoi
(
argv
[
2
]);
int
ram_size
=
atoi
(
argv
[
2
]);
while
(
!
feof
(
f
))
{
fread
(
x
,
1
,
4
,
f
);
printf
(
"write %x %02X%02X%02X%02X
\n
"
,
i
++
,
x
[
0
],
x
[
1
],
x
[
2
],
x
[
3
]);
}
ram_size
=
(
ram_size
+
3
)
/
4
;
for
(;
i
<
n
;)
{
printf
(
"write %x %02X%02X%02X%02X
\n
"
,
i
++
,
0
,
0
,
0
,
0
);
fprintf
(
stderr
,
"filesize=%d
\n
"
,
ram_size
);
while
(
fread
(
&
tmp
,
1
,
4
,
f
))
{
printf
(
"%s
\n
"
,
byte_to_binary
(
htonl
(
tmp
)));
++
i
;
}
//padding
for
(;
i
<
ram_size
;
++
i
)
{
printf
(
"00000000000000000000000000000000
\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