Commit fe7d39a9 authored by Martin Jeřábek's avatar Martin Jeřábek
Browse files

Merge branch 'vivado-component-generator' into 'master'

vivado: add component.xml generator

See merge request !204
parents 758fd1e6 0e3e033f
This diff is collapsed.
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(
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:
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment