diff --git a/cmake/hwip.cmake b/cmake/hwip.cmake index 82ed6cc..bcc2149 100644 --- a/cmake/hwip.cmake +++ b/cmake/hwip.cmake @@ -253,7 +253,7 @@ endfunction() # :type [HEADERS]: list #]] function(ip_sources IP_LIB LANGUAGE) - cmake_parse_arguments(ARG "PREPEND;REPLACE" "FILE_SET" "HEADERS" ${ARGN}) + cmake_parse_arguments(ARG "PREPEND;REPLACE" "FILE_SET" "HEADERS;FILELIST" ${ARGN}) # Delete PREPEND and REPLACE from argument list, so only sources are left list(REMOVE_ITEM ARGN "PREPEND" "REPLACE") @@ -285,6 +285,7 @@ function(ip_sources IP_LIB LANGUAGE) # Convert all listed files to absolute paths relative to ${CMAKE_CURRENT_SOURCE_DIR} convert_paths_to_absolute(file_list ${ARGN}) convert_paths_to_absolute(header_list ${ARG_HEADERS}) + convert_paths_to_absolute(filelist_list ${ARG_FILELIST}) unset(append_arg) # If the PREPEND option is passed prepend the new sources to the old ones @@ -309,6 +310,9 @@ function(ip_sources IP_LIB LANGUAGE) ip_include_directories(${IP_LIB} ${LANGUAGE} FILE_SET ${ARG_FILE_SET} ${header_incdir}) endforeach() endif() + if(ARG_FILELIST) + set_property(TARGET ${_reallib} ${append_arg} PROPERTY FILELIST ${filelist_list}) + endif() endfunction() #[[[ diff --git a/cmake/sim/cadence/xcelium.cmake b/cmake/sim/cadence/xcelium.cmake index 539443c..e6bf90e 100644 --- a/cmake/sim/cadence/xcelium.cmake +++ b/cmake/sim/cadence/xcelium.cmake @@ -27,7 +27,7 @@ include_guard(GLOBAL) # :type TOP_MODULE: string # :keyword LIBRARY: replace the default library name (worklib) to be used for elaboration and simulation. # :type LIBRARY: string -# :keyword COMPILE_ARGS: Extra arguments to be passed to the compilation step (C, C++). +# :keyword COMPILE_ARGS: Extra arguments to be passed to the compilation step, like filelist files (.f, .flist). # :type COMPILE_ARGS: string # :keyword XRUN_COMPILE_ARGS: Extra arguments to be passed to the xrun -compile command # :type XRUN_COMPILE_ARGS: string @@ -102,6 +102,13 @@ function(xcelium IP_LIB) set(ARG_XRUN_COMPILE_ARGS XRUN_COMPILE_ARGS ${ARG_XRUN_COMPILE_ARGS}) endif() + get_target_property(FILELIST ${IP_LIB} FILELIST) + if(FILELIST AND NOT FILELIST STREQUAL "NOTFOUND") + foreach(file IN LISTS FILELIST) + list(APPEND ARG_COMPILE_ARGS -f "${file}") + endforeach() + endif() + ####################### ### Set target names ## ####################### @@ -242,7 +249,7 @@ endfunction() # :type LIBRARY: string # :keyword TOP_MODULE: Top module name to be used for elaboration and simulation. # :type TOP_MODULE: string -# :keyword COMPILE_ARGS: Extra arguments to be passed to the compilation step (C, C++). +# :keyword COMPILE_ARGS: Extra arguments to be passed to the compilation step, like filelist files (.f, .flist). # :type COMPILE_ARGS: string # :keyword XRUN_COMPILE_ARGS: Extra arguments to be passed to the xrun -compile command # :type XRUN_COMPILE_ARGS: string