diff --git a/gen_tcl.sh b/gen_tcl.sh index b5f8caa58bfc2532012b1efc81ad0f64677c236a..273808302085be494a8bc02f00036e94a9f1deeb 100755 --- a/gen_tcl.sh +++ b/gen_tcl.sh @@ -19,6 +19,12 @@ function burn_file () { " } +function list_sources () { + find ${proj_dir}/*.srcs -regex '^.*\.s?vh?$' -exec echo add_files \{\} \; + find ${proj_dir}/*.srcs -regex '^.*\.o?cc?p?p?x?x?$' -exec echo add_files \{\} \; + find ${proj_dir}/*.srcs -regex '^.*\.hh?p?p?x?x?$' -exec echo add_files \{\} \; +} + if [[ $1 == build ]]; then xpr="$2" run_name_synth="$3" @@ -32,8 +38,7 @@ if [[ $1 == build ]]; then echo "# Generated by Vivado wrapper, licensed under GPL 3.0 # Copyright (C) Recolic Keghart <root@recolic.net> open_project ${xpr} - `find ${proj_dir}/*.srcs -regex '^.*\.s?vh?$' -exec echo add_files \{\} \;` - `find ${proj_dir}/*.srcs -regex '^.*\.o?cc?p?p?x?x?$' -exec echo add_files \{\} \;` + `list_sources` set_property top ${top_mod} [current_fileset] reset_run ${run_name_synth} reset_run ${run_name_impl} @@ -59,8 +64,7 @@ elif [[ $1 == gui ]]; then xpr="$2" proj_dir=`dirname ${xpr}` echo "open_project ${xpr} - `find ${proj_dir}/*.srcs -regex '^.*\.s?vh?$' -exec echo add_files \{\} \;` - `find ${proj_dir}/*.srcs -regex '^.*\.o?cc?p?p?x?x?$' -exec echo add_files \{\} \;` + `list_sources` start_gui" elif [[ $1 == init-project ]]; then proj_name="$2" diff --git a/template/Vivadofile b/template/Vivadofile index e66752823e8f220aaefcdad5c891bdc16b9416a1..d312c7035cf731d5588b3165459728e05601f07d 100644 --- a/template/Vivadofile +++ b/template/Vivadofile @@ -2,7 +2,8 @@ # Required options # -# You may use SystemVerilog, Verilog, or VHDL files as sources. +# You may use SystemVerilog, Verilog, or VHDL files as sources. (.sv .v .vh) +# You may also use C, C++, ObjectC or SystemC files as sources. (.c .cc .cxx .cpp .oc .h .hh .hpp .hxx) # sources=(test_main.sv lib/* ./mod?.v) sources=(src/*)