Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CTU CAN FD IP Core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
canbus
CTU CAN FD IP Core
Commits
db52b0b8
Commit
db52b0b8
authored
Jan 19, 2019
by
Martin Jeřábek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vivado: add script to generate component.xml
parent
758fd1e6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
668 additions
and
0 deletions
+668
-0
scripts/component.xml.j2
scripts/component.xml.j2
+642
-0
scripts/gen_vivado_component.py
scripts/gen_vivado_component.py
+26
-0
No files found.
scripts/component.xml.j2
0 → 100644
View file @
db52b0b8
This diff is collapsed.
Click to expand it.
scripts/gen_vivado_component.py
0 → 100755
View file @
db52b0b8
#!/usr/bin/python3
"""
Generate vivado component file in /src/component.xml.
Serves to update the list of source files -- run when you add/delete/rename
a src vhdl file.
"""
from
jinja2
import
Environment
,
FileSystemLoader
,
select_autoescape
from
pathlib
import
Path
d
=
Path
(
__file__
).
parent
jinja_env
=
Environment
(
loader
=
FileSystemLoader
(
str
(
d
)),
autoescape
=
select_autoescape
([
'html'
,
'xml'
]))
template
=
jinja_env
.
get_template
(
'component.xml.j2'
)
src_dir
=
d
/
'..'
/
'src'
files
=
[
str
(
f
.
relative_to
(
src_dir
))
for
f
in
src_dir
.
glob
(
'**/*.vhd'
)]
files
=
sorted
(
files
)
contents
=
template
.
render
(
files
=
files
)
with
(
src_dir
/
'component.xml'
).
open
(
'wt'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
contents
)
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