change_dir_to_project() { cd $project_workspace/$project_name }
config_hdf_file() { if [ ! -d $hdf_file_dir ];then echo "$hdf_file_dir directory does not exist" exit fi
change_dir_to_project inner_hdf_and_bit_dir="$project_workspace/$project_name/hdf_and_bit" cp -rf $hdf_file_dir $inner_hdf_and_bit_dir if [ $? -ne 0 ]; then error_log "copy the .hdf and .bit failed" exit fi
hw_description_config="--get-hw-description=$inner_hdf_and_bit_dir" find_bit_file_cmd="find $inner_hdf_and_bit_dir -maxdepth 1 -name "*.bit" " find_hdf_file_cmd="find $inner_hdf_and_bit_dir -maxdepth 1 -name "*.hdf" " bit_file_number=`$find_bit_file_cmd | wc -l` hdf_file_number=`$find_hdf_file_cmd | wc -l` if [ $bit_file_number -eq 0 -a $hdf_file_number -eq 0 ];then warning_log "script will not load the hw-description" hw_description_config="" fpga_bitstream_config="" fi
if [ $bit_file_number -gt 1 -o $hdf_file_number -gt 1 ];then error_log "there are multiple .bit/.hdf files" exit fi bit_file=`$find_bit_file_cmd` if [ -f $bit_file ];then fpga_bitstream_config="--fpga $bit_file" fi