Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
litex
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jonathan Currier
litex
Commits
77805a5e
Unverified
Commit
77805a5e
authored
Jun 05, 2019
by
enjoy-digital
Committed by
GitHub
Jun 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #195 from antmicro/extend_generated_headers
Extend generated headers & csv
parents
cb2d4372
93b61a65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
litex/soc/integration/builder.py
litex/soc/integration/builder.py
+10
-1
litex/soc/integration/cpu_interface.py
litex/soc/integration/cpu_interface.py
+3
-1
No files found.
litex/soc/integration/builder.py
View file @
77805a5e
...
...
@@ -58,6 +58,7 @@ class Builder:
cpu_type
=
self
.
soc
.
cpu_type
memory_regions
=
self
.
soc
.
get_memory_regions
()
flash_boot_address
=
getattr
(
self
.
soc
,
"flash_boot_address"
,
None
)
shadow_base
=
getattr
(
self
.
soc
,
"shadow_base"
,
None
)
csr_regions
=
self
.
soc
.
get_csr_regions
()
constants
=
self
.
soc
.
get_constants
()
...
...
@@ -102,7 +103,7 @@ class Builder:
write_to_file
(
os
.
path
.
join
(
generated_dir
,
"mem.h"
),
cpu_interface
.
get_mem_header
(
memory_regions
,
flash_boot_address
))
cpu_interface
.
get_mem_header
(
memory_regions
,
flash_boot_address
,
shadow_base
))
write_to_file
(
os
.
path
.
join
(
generated_dir
,
"csr.h"
),
cpu_interface
.
get_csr_header
(
csr_regions
,
constants
))
...
...
@@ -120,6 +121,14 @@ class Builder:
csr_regions
=
self
.
soc
.
get_csr_regions
()
constants
=
self
.
soc
.
get_constants
()
shadow_base
=
getattr
(
self
.
soc
,
"shadow_base"
,
None
)
if
shadow_base
:
constants
.
append
((
'shadow_base'
,
shadow_base
))
flash_boot_address
=
getattr
(
self
.
soc
,
"flash_boot_address"
,
None
)
if
flash_boot_address
:
constants
.
append
((
'flash_boot_address'
,
flash_boot_address
))
csr_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
self
.
csr_csv
))
os
.
makedirs
(
csr_dir
,
exist_ok
=
True
)
write_to_file
(
...
...
litex/soc/integration/cpu_interface.py
View file @
77805a5e
...
...
@@ -70,13 +70,15 @@ def get_linker_regions(regions):
return
r
def
get_mem_header
(
regions
,
flash_boot_address
):
def
get_mem_header
(
regions
,
flash_boot_address
,
shadow_base
):
r
=
generated_banner
(
"//"
)
r
+=
"#ifndef __GENERATED_MEM_H
\
n
#define __GENERATED_MEM_H
\
n
\
n
"
for
name
,
base
,
size
in
regions
:
r
+=
"#define {name}_BASE 0x{base:08x}L
\
n
#define {name}_SIZE 0x{size:08x}
\
n
\
n
"
.
format
(
name
=
name
.
upper
(),
base
=
base
,
size
=
size
)
if
flash_boot_address
is
not
None
:
r
+=
"#define FLASH_BOOT_ADDRESS 0x{:08x}L
\
n
\
n
"
.
format
(
flash_boot_address
)
if
shadow_base
is
not
None
:
r
+=
"#define SHADOW_BASE 0x{:08x}L
\
n
\
n
"
.
format
(
shadow_base
)
r
+=
"#endif
\
n
"
return
r
...
...
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