Commit 0e0ee43b authored by Pascal Bos's avatar Pascal Bos Committed by Peter Jansweijer

ported to bash, added check for mmi file.

parent bb85f887
#! /bin/bash
proj_name=spec7_wr_ref_top
lm32_wrpc_elf=../../../sw/precompiled/wrps-sw_spec7/wrc.elf
lm32_wrpc_instpath=lm32_wrpc_memory
/opt/Xilinx/Vivado/2019.2/bin/updatemem -meminfo ./${proj_name}.mmi -data ${lm32_wrpc_elf} -bit ./work/${proj_name}.runs/impl_1/${proj_name}.bit -proc ${lm32_wrpc_instpath} -out ./work/${proj_name}.runs/impl_1/${proj_name}_elf.bit -force
#! /bin/bash
proj_name=spec7_write_top
lm32_wrpc_elf=../../../sw/precompiled/wrps-sw_spec7/wrc.elf
lm32_wrpc_instpath=lm32_wrpc_memory
/opt/Xilinx/Vivado/2019.2/bin/updatemem -meminfo ./${proj_name}.mmi -data ${lm32_wrpc_elf} -bit ./work/${proj_name}.runs/impl_1/${proj_name}.bit -proc ${lm32_wrpc_instpath} -out ./work/${proj_name}.runs/impl_1/${proj_name}_elf.bit -force
rem prog.cmd PeterJ, 02-Jul-2020.
@prompt $$$s
set proj_name=%~n1%
set lm32_wrpc_mmi=%proj_name%.mmi
set lm32_wrpc_elf=%2%
set lm32_wrpc_instpath="lm32_wrpc_memory"
if not exist "%1%" (
@echo ### %1% ### bit file not found
@echo Usage: do_vivado_mmi_elf <bitfile>.bit <elffile>.elf
......@@ -23,15 +28,15 @@ if not "%~x2%"==".elf" (
exit /B
)
if not exist "%lm32_wrpc_mmi%" (
@echo ### %lm32_wrpc_mmi% ### mmi file not found, has it been generated?"
exit /B
)
rem ### Cleanup old log files and stuff
del vivado_mmi_elf.log
del updatemem*.jou
del updatemem*.log
set proj_name=%~n1%
set lm32_wrpc_elf=%2%
set lm32_wrpc_instpath="lm32_wrpc_memory"
rem ### note that environment variable "VIVADO" must be set to something like "E:\Xilinx\Vivado\2017.1\bin\"
rem ### in your (User) Environment Variables
%VIVADO%updatemem -meminfo %proj_name%.mmi -data %lm32_wrpc_elf% -bit %proj_name%.bit -proc %lm32_wrpc_instpath% -out %proj_name%_elf.bit -force >> vivado_mmi_elf.log
......
#! /bin/bash
# do_vivado_mmi_elf.sh PascalB, 09-Jul-2020.
proj_name=$(basename $1 .bit)
lm32_wrpc_mmi=${proj_name}.mmi
lm32_wrpc_elf=$2
lm32_wrpc_instpath="lm32_wrpc_memory"
if not [ -f "$1" ]; then
echo "$1 bit file not found"
echo "Usage: do_vivado_mmi_elf.sh <bitfile>.bit <elffile>.elf"
exit
fi
if not [ ${1: -4} == ".bit" ]; then
echo "$1 bit file not found"
echo "Usage: do_vivado_mmi_elf.sh <bitfile>.bit <elffile>.elf"
exit
fi
if not [ -f "$2" ]; then
echo "$1 elf file not found"
echo "Usage: do_vivado_mmi_elf.sh <bitfile>.bit <elffile>.elf"
exit
fi
if not [ ${2: -4} == ".elf" ]; then
echo "$2 elf file not found"
echo "Usage: do_vivado_mmi_elf.sh <bitfile>.bit <elffile>.elf"
exit
fi
if not [ -f "$lm32_wrpc_mmi" ]; then
echo "$1 mmi file not found, has it been generated?"
exit
fi
# Cleanup old log files and stuff
rm vivado_mmi_elf.log 2>/dev/null
rm updatemem*.jou 2>/dev/null
rm updatemem*.log 2>/dev/null
updatemem -meminfo ${proj_name}.mmi -data $2 -bit $1 -proc $lm32_wrpc_instpath -out ${proj_name}_elf.bit -force >> vivado_mmi_elf.log
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