setws xsct_ws

platform create -name diot_wr_platform -hw hardware/diot_wr_mpsoc.xsa -no-boot-bsp
# create domain for FSBL
domain create -name "fsbl_domain" -os standalone -proc psu_cortexa53_0
bsp setlib xilffs
bsp setlib xilsecure
bsp setlib xilpm
bsp config zynqmp_fsbl_bsp true
# create domain for PMU firmware
domain create -name "pmufw_domain" -os standalone -proc psu_pmu_0
bsp setlib xilfpga
bsp setlib xilsecure
bsp setlib xilskey
# create standalone sw domain
domain create -name "standalone_domain" -os standalone -proc psu_cortexa53_0
# generate platform
platform generate

# Generate FSBL APP
app create -name diot_fsbl -template {Zynq MP FSBL} -platform diot_wr_platform -domain fsbl_domain -sysproj diot_wr_system
# Generate PMU FW APP
app create -name diot_pmufw -template {ZynqMP PMU Firmware} -platform diot_wr_platform -domain pmufw_domain -sysproj diot_wr_system

# Generate Hello World APP
app create -name hello_world -template {Hello World} -platform diot_wr_platform -domain standalone_domain -sysproj diot_wr_system

# Configure applications
app config -name diot_fsbl build-config release
app config -name diot_pmufw build-config release
app config -name hello_world build-config release

exec cp my_src/helloworld.c xsct_ws/hello_world/src/
exec cp my_src/Si5341-RevD-diot_sb-Registers.h xsct_ws/hello_world/src/

# Building all apps
app build -name diot_fsbl
app build -name diot_pmufw
app build -name hello_world

# Generate BOOT.BIN
exec bootgen -image bootgen.bif -arch zynqmp -w -o BOOT.bin
