# {{ HEADER_AUTOGEN }}
set ROOT "{{ root }}"
{% if compilation_mode == 'separate' %}{# Individual block for each source file group
#}{% for group in srcs %}
{% if source_annotations %}# {{ group.metadata }}{# Add metadata #}
{% endif %}add_files -norecurse -fileset [current_fileset] [list \{# Add files command #}
{% for file in group.files %}{% if source_annotations %}{% if file.comment %}# {{ file.comment }}{# Add file comments, if present #}
{% endif %}{% endif %}{{ file.file | replace(from=root, to='$ROOT') }} \{# Add group's files #}
{% if not loop.last %} {% endif %}{% endfor %}]
{% endfor %}{% else %}{# compilation_mode == 'common' #}{# Common block for all files
#}{% for file in all_files %}{# Loop over all files
#}{% if loop.first %}add_files -norecurse -fileset [current_fileset] [list \{# Add files command #}
{% endif %}{% if source_annotations %}{% if file.comment %}# {{ file.comment }}{# Add file comments, if present #}
{% endif %}{% endif %}{{ file.file | replace(from=root, to='$ROOT') }} \{# Add all files #}
{% if not loop.last %} {% endif %}{% if loop.last %}]
{% endif %}{% endfor %}{% endif %}{#
#}{% for arg in vivado_filesets %}{# Loop over vivado arguments
#}{% for incdir in all_incdirs %}{# Loop over include directories
#}{% if loop.first %}
set_property include_dirs [list \
{% endif %}{{incdir | replace(from=root, to='$ROOT') }}{%if loop.last %} \{# Add all include directories #}
] [current_fileset{{ arg }}]{# Add all arguments #}
{% else %} \
{% endif %}{% endfor %}{% endfor %}{#
#}{% for arg in vivado_filesets %}{# Loop over vivado arguments
#}{% for define in all_defines %}{# Loop over defines
#}{% if loop.first %}
set_property verilog_define [list \
{% endif %}{{ define.0 }}{% if define.1 %}={{ define.1 }}{% endif %}{% if loop.last %} \{# Add all defines #}
] [current_fileset{{ arg }}]{# Add all arguments #}
{% else %} \
{% endif %}{% endfor %}{% endfor %}