run_config: use an associative array to hold fvp container params

The proposed approach uses a associative array to hold all FVP
container parameters: 1. docker image (containing the FVP model)
2. model's absolute path and 3. model binary filename, allowing a single
table to store this infomation instead of multiple run configurations.

It is important to notice that not all models have the corresponding
FVP container (those models with tree semicolon as values,
[XXX]=";;;") because these are not publicly available. The Trusted
Firmware Open CI team (Linaro) will continue this work and get a NDA,
so LAVA testing can enabled on these.

Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: I88913ffbdd22e26f978ce326de0140b4c0eb83d4
diff --git a/fvp_utils.sh b/fvp_utils.sh
index a366909..dd1a443 100644
--- a/fvp_utils.sh
+++ b/fvp_utils.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #
-# Copyright (c) 2019-2020, Arm Limited. All rights reserved.
+# Copyright (c) 2020-2021, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
@@ -39,14 +39,59 @@
 # Default FVP model variables
 default_model_dtb="fvp-base-gicv3-psci.dtb"
 
-# default to the fvp container containing most of the models and its corresponding base
-# directory
-default_model_name="fvp:fvp_arm_std_library_11.12_38"
-default_model_dir="/opt/model/FVP_ARM_Std_Library/models/Linux64_GCC-6.4"
+# FVP containers and model paths
+fvp_arm_std_library="fvp:fvp_arm_std_library_${model_version}_${model_build};/opt/model/FVP_ARM_Std_Library/models/${model_flavour}"
+fvp_base_revc_2xaemv8a="fvp:fvp_base_revc-2xaemv8a_${model_version}_${model_build};/opt/model/Base_RevC_AEMv8A_pkg/models/${model_flavour}"
+foundation_platform="fvp:foundation_platform_${model_version}_${model_build};/opt/model/Foundation_Platformpkg/models/${model_flavour}"
 
-# This is intentionally black, so a the run config snippet MUST pass this the parameter
-# indicating the model's binary
-default_model_bin=""
+# FVP associate array, run_config are keys and fvp container parameters are the values
+#   Container parameters syntax: <model name>;<model dir>;<model bin>
+# FIXMEs: fix those ;;; values with real values
+
+declare -A fvp_models
+fvp_models=(
+[base-aemv8a-quad]=";;;"
+[base-aemv8a-revb]=";;;"
+[base-aemv8a-latest-revb]=";;;"
+[base-aemva]=";;;"
+[foundationv8]="${foundation_platform};Foundation_Platform"
+[base-aemv8a]="${fvp_base_revc_2xaemv8a};FVP_Base_RevC-2xAEMv8A"
+[cortex-a32x4]="${fvp_arm_std_library};FVP_Base_Cortex-A32x4"
+[cortex-a35x4]="${fvp_arm_std_library};FVP_Base_Cortex-A35x4"
+[cortex-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A53x4"
+[cortex-a55x4-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A55x4-A75x4"
+[cortex-a55x4-a76x2]="${fvp_arm_std_library};FVP_Base_Cortex-A55x4-A76x2"
+[cortex-a57x1-a53x1]="${fvp_arm_std_library};FVP_Base_Cortex-A57x1-A53x1"
+[cortex-a57x2-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x2-A53x4"
+[cortex-a57x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4"
+[cortex-a57x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A57x4-A53x4"
+[cortex-a65aex8]="${fvp_arm_std_library};FVP_Base_Cortex-A65AEx8"
+[cortex-a65x4]="${fvp_arm_std_library};FVP_Base_Cortex-A65x4"
+[cortex-a72x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4"
+[cortex-a72x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A72x4-A53x4"
+[cortex-a73x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4"
+[cortex-a73x4-a53x4]="${fvp_arm_std_library};FVP_Base_Cortex-A73x4-A53x4"
+[cortex-a75x4]="${fvp_arm_std_library};FVP_Base_Cortex-A75x4"
+[cortex-a76aex4]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx4"
+[cortex-a76aex2]="${fvp_arm_std_library};FVP_Base_Cortex-A76AEx2"
+[cortex-a76x4]="${fvp_arm_std_library};FVP_Base_Cortex-A76x4"
+[cortex-a77x4]="${fvp_arm_std_library};FVP_Base_Cortex-A77x4"
+[cortex-a78x4]="${fvp_arm_std_library};FVP_Base_Cortex-A78x4"
+[neoverse_e1x1]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x1"
+[neoverse_e1x2]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x2"
+[neoverse_e1x4]="${fvp_arm_std_library};FVP_Base_Neoverse-E1x4"
+[neoverse_n1]="${fvp_arm_std_library};FVP_Base_Neoverse-N1x1"
+[neoverse_n2]=";;;"
+[neoverse-v1x4]=";;;"
+[css-rdv1]=";;;"
+[css-rde1edge]=";;;"
+[css-rdn1edge]=";;;"
+[css-rdn1edgex2]=";;;"
+[css-sgi575]=";;;"
+[css-sgm775]=";;;"
+[tc0]=";;;"
+)
+
 
 # FVP Kernel URLs
 declare -A fvp_kernels
@@ -246,6 +291,8 @@
 }
 
 gen_fvp_yaml() {
+    local model="${model:?}"
+
     local yaml_template_file="$workspace/fvp_template.yaml"
     local yaml_file="$workspace/fvp.yaml"
     local yaml_job_file="$workspace/job.yaml"
@@ -256,8 +303,24 @@
 	return
     fi
 
-    # must parameters for yaml generation
-    local model="${model:?}"
+    local model_params="${fvp_models[$model]}"
+    local model_name="$(echo "${model_params}" | awk -F ';' '{print $1}')"
+    local model_dir="$(echo "${model_params}"  | awk -F ';' '{print $2}')"
+    local model_bin="$(echo "${model_params}"  | awk -F ';' '{print $3}')"
+
+    # model params are required for correct yaml creation, quit if empty
+    if [ -z "${model_name}" ]; then
+       echo "FVP model param 'model_name' variable empty, yaml not produced"
+       return
+    elif [ -z "${model_dir}" ]; then
+       echo "FVP model param 'model_dir' variable empty, yaml not produced"
+       return
+    elif [ -z "${model_bin}"  ]; then
+       echo "FVP model param 'model_bin' variable empty, yaml not produced"
+       return
+    fi
+
+    echo "FVP model params: model_name=$model_name model_dir=$model_dir model_bin=$model_bin"
 
     # FIXME: Foundation plaforms (model=foundationv8) are failing because LAVA [1]
     # should read two ports, 5000 and 5002, but LAVA does not support this
@@ -271,10 +334,7 @@
     fi
 
     # optional parameters, defaults to globals
-    local model_name="${model_name:-$default_model_name}"
     local model_dtb="${model_dtb:-$default_model_dtb}"
-    local model_dir="${model_dir:-$default_model_dir}"
-    local model_bin="${model_bin:-$default_model_bin}"
 
     # general artefacts
     bl1="$(fvp_gen_bin_url bl1.bin)"
diff --git a/run_config/fvp-aem8a.singlecluster b/run_config/fvp-aem8a.singlecluster
index 8fd95cc..c7d676f 100755
--- a/run_config/fvp-aem8a.singlecluster
+++ b/run_config/fvp-aem8a.singlecluster
@@ -6,14 +6,14 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+        model="$model" \
 	cluster_0_num_cores="4" \
 	cluster_1_num_cores="0" \
 	cluster_2_num_cores="0" \
 	cluster_3_num_cores="0" \
 	gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a b/run_config/fvp-aemv8a
index cdf2437..848171d 100644
--- a/run_config/fvp-aemv8a
+++ b/run_config/fvp-aemv8a
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
+        model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.64only b/run_config/fvp-aemv8a.64only
index 799b3ee..e51d751 100644
--- a/run_config/fvp-aemv8a.64only
+++ b/run_config/fvp-aemv8a.64only
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	aarch64_only=1 model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
+	aarch64_only=1 model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.8_3 b/run_config/fvp-aemv8a.8_3
index f57d574..56a5cef 100644
--- a/run_config/fvp-aemv8a.8_3
+++ b/run_config/fvp-aemv8a.8_3
@@ -6,11 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
-	arch_version="8.3" \
+	local model="base-aemv8a"
+	model="$model"  arch_version="8.3" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.8_4 b/run_config/fvp-aemv8a.8_4
index 4ed7337..d5068e3 100644
--- a/run_config/fvp-aemv8a.8_4
+++ b/run_config/fvp-aemv8a.8_4
@@ -6,11 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
-	arch_version="8.4" \
+	local model="base-aemv8a"
+	model="$model" arch_version="8.4" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.8_5 b/run_config/fvp-aemv8a.8_5
index 231516c..68952e5 100644
--- a/run_config/fvp-aemv8a.8_5
+++ b/run_config/fvp-aemv8a.8_5
@@ -6,11 +6,10 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+	local model="base-aemv8a"
+        model="$model" \
 	arch_version="8.5" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.8_5+mte b/run_config/fvp-aemv8a.8_5+mte
index b0e90c8..4317682 100644
--- a/run_config/fvp-aemv8a.8_5+mte
+++ b/run_config/fvp-aemv8a.8_5+mte
@@ -6,12 +6,12 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+        model="$model" \
 	arch_version="8.5" \
 	memory_tagging_support_level="3" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_RevC-2xAEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.8_5.bmcov b/run_config/fvp-aemv8a.8_5.bmcov
index f658076..a53c91a 100644
--- a/run_config/fvp-aemv8a.8_5.bmcov
+++ b/run_config/fvp-aemv8a.8_5.bmcov
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
+	local model="base-aemv8a"
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
-	model="base-aemv8a" \
+        model="$model" \
 	arch_version="8.5" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.NVM_reboot b/run_config/fvp-aemv8a.NVM_reboot
index f881e8f..21862d3 100644
--- a/run_config/fvp-aemv8a.NVM_reboot
+++ b/run_config/fvp-aemv8a.NVM_reboot
@@ -18,12 +18,14 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	uart0_log=$(echo uart-0-`date "+%H:%M:%S"`.log)
 	uart1_log=$(echo uart-1-`date "+%H:%M:%S"`.log)
 	set_run_env "uart0_file" "$uart0_log"
 	set_run_env "uart1_file" "$uart1_log"
 
-	model="base-aemv8a" retain_flash="1" secure_memory="0" \
+	model="$model" retain_flash="1" secure_memory="0" \
 	cluster_0_num_cores="1" cluster_1_num_cores="1" \
 	cache_state_modelled="0" \
 	uart0_out="$uart0_log" \
@@ -32,7 +34,5 @@
 	flashloader1_fwrite="flash1" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32 b/run_config/fvp-aemv8a.aarch32
index e92af55..3ec8ae3 100644
--- a/run_config/fvp-aemv8a.aarch32
+++ b/run_config/fvp-aemv8a.aarch32
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	aarch32="1" model="base-aemv8a" gen_model_params
+	local model="base-aemv8a"
+	aarch32="1" model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32+8_4 b/run_config/fvp-aemv8a.aarch32+8_4
index a156f0c..16906ec 100644
--- a/run_config/fvp-aemv8a.aarch32+8_4
+++ b/run_config/fvp-aemv8a.aarch32+8_4
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	aarch32="1" model="base-aemv8a" arch_version="8.4" \
+        local model="base-aemv8a"
+	aarch32="1" model="$model" arch_version="8.4" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32+bl2_el3 b/run_config/fvp-aemv8a.aarch32+bl2_el3
index 3343c59..648b107 100644
--- a/run_config/fvp-aemv8a.aarch32+bl2_el3
+++ b/run_config/fvp-aemv8a.aarch32+bl2_el3
@@ -6,14 +6,13 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
 	bl2_at_el3="1" \
 	aarch32="1" \
 	bl2_addr="0x4022000" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
 	uart="0" set_expect_variable "skip_early_boot_msgs" "1"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32+memprotect b/run_config/fvp-aemv8a.aarch32+memprotect
index b956367..aa4d176 100644
--- a/run_config/fvp-aemv8a.aarch32+memprotect
+++ b/run_config/fvp-aemv8a.aarch32+memprotect
@@ -6,6 +6,8 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	image=$(mktempfile)
 	printf '\1\0\0\0' > "$image"
 
@@ -14,9 +16,7 @@
 	cache_state_modelled="0" \
 	memprotect="$image" \
 	memprotect_addr="0xBFC0000" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32+regreset b/run_config/fvp-aemv8a.aarch32+regreset
index d56763f..9be69e4 100644
--- a/run_config/fvp-aemv8a.aarch32+regreset
+++ b/run_config/fvp-aemv8a.aarch32+regreset
@@ -6,12 +6,12 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	cluster_0_reg_reset="0xffffffff" \
 		cluster_1_reg_reset="0xffffffff" \
 		aarch32=1 \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32.8_3 b/run_config/fvp-aemv8a.aarch32.8_3
index e6a811c..55ec12c 100644
--- a/run_config/fvp-aemv8a.aarch32.8_3
+++ b/run_config/fvp-aemv8a.aarch32.8_3
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+	local model="base-aemv8a"
+        model="$model" \
 	arch_version="8.3" \
 	aarch32="1" \
 	gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32.NVM_reboot b/run_config/fvp-aemv8a.aarch32.NVM_reboot
index 57bc41a..71b7c5a 100644
--- a/run_config/fvp-aemv8a.aarch32.NVM_reboot
+++ b/run_config/fvp-aemv8a.aarch32.NVM_reboot
@@ -18,12 +18,14 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	uart0_log=$(echo uart-0-`date "+%H:%M:%S"`.log)
 	uart1_log=$(echo uart-1-`date "+%H:%M:%S"`.log)
 	set_run_env "uart0_file" "$uart0_log"
 	set_run_env "uart1_file" "$uart1_log"
 
-	aarch32="1" model="base-aemv8a" retain_flash="1" \
+	aarch32="1" model="$model" retain_flash="1" \
 	cluster_0_num_cores="1" cluster_1_num_cores="1" \
 	cache_state_modelled="0" secure_memory="0" \
 	uart0_out="$uart0_log" \
@@ -32,7 +34,5 @@
 	flashloader1_fwrite="flash1" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32.nocache b/run_config/fvp-aemv8a.aarch32.nocache
index 08b60fe..700b3fa 100644
--- a/run_config/fvp-aemv8a.aarch32.nocache
+++ b/run_config/fvp-aemv8a.aarch32.nocache
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	cache_state_modelled="0" aarch32="1" model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
+	cache_state_modelled="0" aarch32="1" model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic b/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
index 8afd6af..53339b9 100644
--- a/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
+++ b/run_config/fvp-aemv8a.aarch32.roxlattables.spmin_panic
@@ -16,11 +16,10 @@
 }
 
 post_tf_archive() {
-	aarch32="1" model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
+	aarch32="1" model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a.amu b/run_config/fvp-aemv8a.amu
index 5820aaa..9721f1d 100644
--- a/run_config/fvp-aemv8a.amu
+++ b/run_config/fvp-aemv8a.amu
@@ -1,13 +1,13 @@
 #!/usr/bin/env bash
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	arch_version="8.4" \
 	amu_present="1" \
 	cache_state_modelled="0" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.amu.aarch32 b/run_config/fvp-aemv8a.amu.aarch32
index f27725d..3d024e0 100644
--- a/run_config/fvp-aemv8a.amu.aarch32
+++ b/run_config/fvp-aemv8a.amu.aarch32
@@ -1,14 +1,14 @@
 #!/usr/bin/env bash
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	arch_version="8.4" \
 	amu_present="1" \
 	aarch32="1" \
 	cache_state_modelled="0" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.amu.bmcov b/run_config/fvp-aemv8a.amu.bmcov
index b8261cf..6bd7a88 100644
--- a/run_config/fvp-aemv8a.amu.bmcov
+++ b/run_config/fvp-aemv8a.amu.bmcov
@@ -1,14 +1,14 @@
 #!/usr/bin/env bash
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
-	model="base-aemv8a" \
+	model="$model" \
 	arch_version="8.4" \
 	amu_present="1" \
 	cache_state_modelled="0" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.assymetric b/run_config/fvp-aemv8a.assymetric
index 54d277e..6c2e9f4 100644
--- a/run_config/fvp-aemv8a.assymetric
+++ b/run_config/fvp-aemv8a.assymetric
@@ -6,6 +6,8 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	arch_version="8.3" \
 		cluster_0_reg_reset="0xffffffff" \
 		cluster_0_has_el2="0" \
@@ -13,10 +15,8 @@
 		cluster_1_has_el2="0" \
 		cluster_0_num_cores="2" \
 		cluster_1_num_cores="3" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "5"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.assymetric.bmcov b/run_config/fvp-aemv8a.assymetric.bmcov
index 9f7751d..9352282 100644
--- a/run_config/fvp-aemv8a.assymetric.bmcov
+++ b/run_config/fvp-aemv8a.assymetric.bmcov
@@ -6,6 +6,8 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
 	arch_version="8.3" \
 		cluster_0_reg_reset="0xffffffff" \
@@ -14,10 +16,8 @@
 		cluster_1_has_el2="0" \
 		cluster_0_num_cores="2" \
 		cluster_1_num_cores="3" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "5"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.bl2_el3 b/run_config/fvp-aemv8a.bl2_el3
index 4ee5f97..cb56174 100644
--- a/run_config/fvp-aemv8a.bl2_el3
+++ b/run_config/fvp-aemv8a.bl2_el3
@@ -6,13 +6,12 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
 	bl2_at_el3="1" \
 	bl2_addr="0x4022000" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
 	uart="0" set_expect_variable "skip_early_boot_msgs" "1"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.bmcov b/run_config/fvp-aemv8a.bmcov
index 3e4b476..15ea0d8 100644
--- a/run_config/fvp-aemv8a.bmcov
+++ b/run_config/fvp-aemv8a.bmcov
@@ -6,10 +6,10 @@
 #
 
 post_fetch_tf_resource() {
-	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
-        model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
+        model="$model" gen_model_params
+
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.crash b/run_config/fvp-aemv8a.crash
index 8eb9c11..60dcc55 100644
--- a/run_config/fvp-aemv8a.crash
+++ b/run_config/fvp-aemv8a.crash
@@ -13,12 +13,12 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" fault_inject="1" arch_version="8.4" \
+        local model="base-aemv8a"
+
+	model="$model" fault_inject="1" arch_version="8.4" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a.el3payload b/run_config/fvp-aemv8a.el3payload
index 9f2d68f..c353092 100644
--- a/run_config/fvp-aemv8a.el3payload
+++ b/run_config/fvp-aemv8a.el3payload
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	pctl_startup="0.0.*.0,0.1.*.0" \
 		secure_ram_fill="1" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.fi b/run_config/fvp-aemv8a.fi
index 2945882..eee8201 100644
--- a/run_config/fvp-aemv8a.fi
+++ b/run_config/fvp-aemv8a.fi
@@ -13,10 +13,10 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" fault_inject="1" arch_version="8.4" \
+        local model="base-aemv8a"
+
+	model="$model" fault_inject="1" arch_version="8.4" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.gicv3_spi b/run_config/fvp-aemv8a.gicv3_spi
index 4b40c9c..4e693dd 100644
--- a/run_config/fvp-aemv8a.gicv3_spi
+++ b/run_config/fvp-aemv8a.gicv3_spi
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	gicv3_spi_count="988" \
 	gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.gicv4 b/run_config/fvp-aemv8a.gicv4
index e5332c1..1c54833 100644
--- a/run_config/fvp-aemv8a.gicv4
+++ b/run_config/fvp-aemv8a.gicv4
@@ -6,7 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	gicd_are_fixed_one="1" \
 	gicd_ext_ppi_count="64" \
 	gicd_ext_spi_count="1024" \
@@ -17,7 +19,5 @@
 	has_gicv4_1="0" \
 	gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.invalid_nvcounter b/run_config/fvp-aemv8a.invalid_nvcounter
index 8b242aa..be925f8 100644
--- a/run_config/fvp-aemv8a.invalid_nvcounter
+++ b/run_config/fvp-aemv8a.invalid_nvcounter
@@ -6,12 +6,12 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	# The Trusted non-volatile counter is invalid. Authentication of BL2
 	# image is expected to fail.
 	uart="0" file="trusted-firmware-load-error.exp" track_expect
-	model="base-aemv8a" nvcounter_diag="4" gen_model_params
+	model="$model" nvcounter_diag="4" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.memprotect b/run_config/fvp-aemv8a.memprotect
index 4d83163..0ea827c 100644
--- a/run_config/fvp-aemv8a.memprotect
+++ b/run_config/fvp-aemv8a.memprotect
@@ -10,6 +10,8 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	image="$(mktempfile)"
 	printf '\1\0\0\0' > "$image"
 
@@ -19,9 +21,7 @@
 	cache_state_modelled="0" \
 	memprotect="$image" \
 	memprotect_addr="0xBFC0000" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.nocm b/run_config/fvp-aemv8a.nocm
index 6c74388..d7ffda5 100644
--- a/run_config/fvp-aemv8a.nocm
+++ b/run_config/fvp-aemv8a.nocm
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	cache_state_modelled="0" model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
+	cache_state_modelled="0" model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.nvcounter_v1 b/run_config/fvp-aemv8a.nvcounter_v1
index d43be22..70b3dfc 100644
--- a/run_config/fvp-aemv8a.nvcounter_v1
+++ b/run_config/fvp-aemv8a.nvcounter_v1
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	# Version 1 of the non-volatile counter may be incremented in a
 	# monotonic fashion (unlike version 0, which is fixed).
-	model="base-aemv8a" nvcounter_version="r1" nvcounter_diag="4" gen_model_params
+	model="$model" nvcounter_version="r1" nvcounter_diag="4" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.pl33 b/run_config/fvp-aemv8a.pl33
index 9c2c9a8..6647d93 100644
--- a/run_config/fvp-aemv8a.pl33
+++ b/run_config/fvp-aemv8a.pl33
@@ -11,11 +11,11 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	preload_bl33="1" \
 	preload_bl33_bin="tftf.bin" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.pl33.bmcov b/run_config/fvp-aemv8a.pl33.bmcov
index 80bd39a..f813c7a 100644
--- a/run_config/fvp-aemv8a.pl33.bmcov
+++ b/run_config/fvp-aemv8a.pl33.bmcov
@@ -11,12 +11,12 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
 	preload_bl33="1" \
 	preload_bl33_bin="tftf.bin" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.quad b/run_config/fvp-aemv8a.quad
index c457921..289f347 100644
--- a/run_config/fvp-aemv8a.quad
+++ b/run_config/fvp-aemv8a.quad
@@ -6,8 +6,13 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a-quad" \
+	local model="base-aemv8a-quad"
+
+        model="$model" \
 	ccn502_cache_size_in_kbytes="0" \
 	gen_model_params
+
 	uart="0" set_expect_variable "num_cpus" "16"
+
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.roxlattables.bl31_panic b/run_config/fvp-aemv8a.roxlattables.bl31_panic
index 9bb945d..cc4afa9 100644
--- a/run_config/fvp-aemv8a.roxlattables.bl31_panic
+++ b/run_config/fvp-aemv8a.roxlattables.bl31_panic
@@ -14,11 +14,10 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a.roxlattables.tspd_panic b/run_config/fvp-aemv8a.roxlattables.tspd_panic
index 420b4bd..71f5240 100644
--- a/run_config/fvp-aemv8a.roxlattables.tspd_panic
+++ b/run_config/fvp-aemv8a.roxlattables.tspd_panic
@@ -17,11 +17,10 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a.rst31 b/run_config/fvp-aemv8a.rst31
index 1d674c2..c977772 100644
--- a/run_config/fvp-aemv8a.rst31
+++ b/run_config/fvp-aemv8a.rst31
@@ -10,12 +10,12 @@
 }
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	preload_bl33="1" \
 	preload_bl33_bin="uboot.bin" \
 	reset_to_bl31="1" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.rstspmin b/run_config/fvp-aemv8a.rstspmin
index 28011a3..69262d1 100644
--- a/run_config/fvp-aemv8a.rstspmin
+++ b/run_config/fvp-aemv8a.rstspmin
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	reset_to_spmin="1" \
 		aarch32="1" \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.singlecore b/run_config/fvp-aemv8a.singlecore
index f65eb67..900b402 100644
--- a/run_config/fvp-aemv8a.singlecore
+++ b/run_config/fvp-aemv8a.singlecore
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" cluster_0_num_cores="1" cluster_1_num_cores="0" \
+        local model="base-aemv8a"
+
+	model="$model" cluster_0_num_cores="1" cluster_1_num_cores="0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "1"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.singlecore.bmcov b/run_config/fvp-aemv8a.singlecore.bmcov
index 1d4bbfc..69ced13 100644
--- a/run_config/fvp-aemv8a.singlecore.bmcov
+++ b/run_config/fvp-aemv8a.singlecore.bmcov
@@ -6,12 +6,12 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
-	model="base-aemv8a" cluster_0_num_cores="1" cluster_1_num_cores="0" \
+	model="$model" cluster_0_num_cores="1" cluster_1_num_cores="0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "1"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.sve b/run_config/fvp-aemv8a.sve
index fe9e9b7..d942b62 100644
--- a/run_config/fvp-aemv8a.sve
+++ b/run_config/fvp-aemv8a.sve
@@ -6,10 +6,10 @@
 #
 
 post_fetch_tf_resource() {
-	sve_plugin=1 \
-		model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	sve_plugin=1 \
+		model="$model" gen_model_params
+
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.sve.bmcov b/run_config/fvp-aemv8a.sve.bmcov
index e67009c..7d2c49a 100644
--- a/run_config/fvp-aemv8a.sve.bmcov
+++ b/run_config/fvp-aemv8a.sve.bmcov
@@ -6,11 +6,11 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a"
+
 	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
 	sve_plugin=1 \
-		model="base-aemv8a" gen_model_params
+		model="$model" gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a.tbb.disable_dyn_auth b/run_config/fvp-aemv8a.tbb.disable_dyn_auth
index 67da466..f48676e 100644
--- a/run_config/fvp-aemv8a.tbb.disable_dyn_auth
+++ b/run_config/fvp-aemv8a.tbb.disable_dyn_auth
@@ -12,11 +12,10 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a.ubsan_test b/run_config/fvp-aemv8a.ubsan_test
index 0c1b84b..f0e151f 100644
--- a/run_config/fvp-aemv8a.ubsan_test
+++ b/run_config/fvp-aemv8a.ubsan_test
@@ -11,12 +11,10 @@
 }
 
 post_tf_archive() {
-	model="base-aemv8a" \
-		gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
 
 fetch_tf_resource() {
diff --git a/run_config/fvp-aemv8a_revb b/run_config/fvp-aemv8a_revb
index 7da5c30..e038bd2 100644
--- a/run_config/fvp-aemv8a_revb
+++ b/run_config/fvp-aemv8a_revb
@@ -6,5 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a-revb" gen_model_params
+	local model="base-aemv8a-revb"
+
+        model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a_revb.aarch32 b/run_config/fvp-aemv8a_revb.aarch32
index 6283223..b7c8be3 100644
--- a/run_config/fvp-aemv8a_revb.aarch32
+++ b/run_config/fvp-aemv8a_revb.aarch32
@@ -6,5 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	aarch32="1" model="base-aemv8a-revb" gen_model_params
+        local model="base-aemv8a-revb"
+
+	aarch32="1" model="$model" gen_model_params
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a_revb.aarch32.gicv2 b/run_config/fvp-aemv8a_revb.aarch32.gicv2
index 24e3c5a..6c23fe1 100644
--- a/run_config/fvp-aemv8a_revb.aarch32.gicv2
+++ b/run_config/fvp-aemv8a_revb.aarch32.gicv2
@@ -6,5 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	gicv3_gicv2_only="1" cache_state_modelled=0 model="base-aemv8a-revb" aarch32="1" gen_model_params
+        local model="base-aemv8a-revb"
+
+	gicv3_gicv2_only="1" cache_state_modelled=0 model="$model" aarch32="1" gen_model_params
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a_revb.asymetric b/run_config/fvp-aemv8a_revb.asymetric
index 58e56e4..85731c1 100644
--- a/run_config/fvp-aemv8a_revb.asymetric
+++ b/run_config/fvp-aemv8a_revb.asymetric
@@ -6,6 +6,8 @@
 #
 
 post_fetch_tf_resource() {
+        local model="base-aemv8a-revb"
+
 	arch_version="8.3" \
 		cluster_0_reg_reset="0xffffffff" \
 		cluster_0_has_el2="0" \
@@ -13,6 +15,7 @@
 		cluster_1_has_el2="0" \
 		cluster_0_num_cores="2" \
 		cluster_1_num_cores="3" \
-		model="base-aemv8a-revb" gen_model_params
+		model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "5"
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a_revb.gicv2 b/run_config/fvp-aemv8a_revb.gicv2
index 57f8f28..f4cb06a 100644
--- a/run_config/fvp-aemv8a_revb.gicv2
+++ b/run_config/fvp-aemv8a_revb.gicv2
@@ -6,6 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	gicv3_gicv2_only="1" \
-		model="base-aemv8a-revb" gen_model_params
+        local model="base-aemv8a-revb"
+
+	gicv3_gicv2_only="1" model="$model" gen_model_params
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemv8a_revb.latest b/run_config/fvp-aemv8a_revb.latest
index 9e2a36a..605d9a1 100644
--- a/run_config/fvp-aemv8a_revb.latest
+++ b/run_config/fvp-aemv8a_revb.latest
@@ -6,5 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemv8a-latest-revb" gen_model_params
+        local model="base-aemv8a-latest-revb"
+
+	model="$model" gen_model_params
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemva b/run_config/fvp-aemva
index 3fa95da..a452bba 100644
--- a/run_config/fvp-aemva
+++ b/run_config/fvp-aemva
@@ -6,7 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemva" \
-		gen_model_params
+        local model="base-aemva"
+
+	model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemva.8_6 b/run_config/fvp-aemva.8_6
index 1f1978d..c797f09 100644
--- a/run_config/fvp-aemva.8_6
+++ b/run_config/fvp-aemva.8_6
@@ -6,8 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="base-aemva" \
-	arch_version="8.6" \
-		gen_model_params
+        local model="base-aemva"
+
+	model="$model" arch_version="8.6" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-aemva.aarch32 b/run_config/fvp-aemva.aarch32
index 339ae0b..f8d4705 100644
--- a/run_config/fvp-aemva.aarch32
+++ b/run_config/fvp-aemva.aarch32
@@ -6,5 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	aarch32="1" model="base-aemva" gen_model_params
+        local model="base-aemva"
+
+	aarch32="1" model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa32x4 b/run_config/fvp-cortexa32x4
index 358fcf7..e80aac1 100644
--- a/run_config/fvp-cortexa32x4
+++ b/run_config/fvp-cortexa32x4
@@ -6,10 +6,10 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a32x4" gen_model_params
+        local model="cortex-a32x4"
+
+	model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
 
-	model="cortex-a32x4" \
-	model_bin="FVP_Base_Cortex-A32x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa32x4.rstspmin b/run_config/fvp-cortexa32x4.rstspmin
index 5d5abed..6ffbdb5 100644
--- a/run_config/fvp-cortexa32x4.rstspmin
+++ b/run_config/fvp-cortexa32x4.rstspmin
@@ -6,11 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	reset_to_spmin="1" \
-		model="cortex-a32x4" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="cortex-a32x4"
 
-	model="cortex-a32x4" \
-	model_bin="FVP_Base_Cortex-A32x4" \
-	       gen_fvp_yaml
+	reset_to_spmin="1" model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa35x4 b/run_config/fvp-cortexa35x4
index a9d57dd..09b0bf0 100644
--- a/run_config/fvp-cortexa35x4
+++ b/run_config/fvp-cortexa35x4
@@ -7,10 +7,8 @@
 
 post_fetch_tf_resource() {
 	local model="cortex-a35x4"
+
 	model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="$model" \
-	model_bin="FVP_Base_Cortex-A35x4" \
-	gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa53x4 b/run_config/fvp-cortexa53x4
index 5e60412..6c489c8 100644
--- a/run_config/fvp-cortexa53x4
+++ b/run_config/fvp-cortexa53x4
@@ -6,11 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a53x4" gen_model_params
+        local model="cortex-a53x4"
+
+	model="$model" gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="cortex-a53x4" \
-	model_bin="FVP_Base_Cortex-A53x4" \
-	       gen_fvp_yaml
-
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa55x4 b/run_config/fvp-cortexa55x4
index dd7d305..0e0b333 100644
--- a/run_config/fvp-cortexa55x4
+++ b/run_config/fvp-cortexa55x4
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a55x4" \
-	cache_state_modelled="0" \
-	gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="cortex-a55x4"
 
-	model="cortex-a55x4" \
-	model_bin="FVP_Base_Cortex-A55x4" \
-	       gen_fvp_yaml
+	model="$model" cache_state_modelled="0" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa55x4a75x4 b/run_config/fvp-cortexa55x4a75x4
index c9e0bb8..6a92e23 100644
--- a/run_config/fvp-cortexa55x4a75x4
+++ b/run_config/fvp-cortexa55x4a75x4
@@ -6,11 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a55x4-a75x4" \
-	cache_state_modelled="0" \
-	gen_model_params
+        local model="cortex-a55x4-a75x4"
 
-	model="cortex-a55x4-a75x4" \
-	model_bin="FVP_Base_Cortex-A55x4+Cortex-A75x4" \
-	       gen_fvp_yaml
+	model="$model" cache_state_modelled="0" gen_model_params
+	model="$model"  gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa55x4a76x2 b/run_config/fvp-cortexa55x4a76x2
index 7c027ac..7195ea6 100644
--- a/run_config/fvp-cortexa55x4a76x2
+++ b/run_config/fvp-cortexa55x4a76x2
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a55x4-a76x2" \
-	cache_state_modelled="0" \
-	gen_model_params
-	uart="0" set_expect_variable "num_cpus" "6"
+        local model="cortex-a55x4-a76x2"
 
-	model="cortex-a55x4-a76x2" \
-	model_bin="FVP_Base_Cortex-A55x4+Cortex-A76x2" \
-	       gen_fvp_yaml
+	model="$model" cache_state_modelled="0" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "6"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa57x1a53x1 b/run_config/fvp-cortexa57x1a53x1
index d18edbc..9b847c1 100644
--- a/run_config/fvp-cortexa57x1a53x1
+++ b/run_config/fvp-cortexa57x1a53x1
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a57x1-a53x1" gen_model_params
-        uart="0" set_expect_variable "num_cpus" "2"
+        local model="cortex-a57x1-a53x1"
 
-	model="cortex-a57x1-a53x1" \
-	model_bin="FVP_Base_Cortex-A57x1-A53x1" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+        uart="0" set_expect_variable "num_cpus" "2"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa57x2a53x4 b/run_config/fvp-cortexa57x2a53x4
index 7d6fa3d..2fa4659 100644
--- a/run_config/fvp-cortexa57x2a53x4
+++ b/run_config/fvp-cortexa57x2a53x4
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a57x2-a53x4" gen_model_params
-        uart="0" set_expect_variable "num_cpus" "6"
+        local model="cortex-a57x2-a53x4"
 
-	model="cortex-a57x2-a53x4" \
-	model_bin="FVP_Base_Cortex-A57x2-A53x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+        uart="0" set_expect_variable "num_cpus" "6"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa57x4 b/run_config/fvp-cortexa57x4
index e9ce0df..cd7a369 100644
--- a/run_config/fvp-cortexa57x4
+++ b/run_config/fvp-cortexa57x4
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a57x4" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="cortex-a57x4"
 
-	model="cortex-a57x4" \
-	model_bin="FVP_Base_Cortex-A57x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa57x4a53x4 b/run_config/fvp-cortexa57x4a53x4
index d5f46a7..8089e3d 100644
--- a/run_config/fvp-cortexa57x4a53x4
+++ b/run_config/fvp-cortexa57x4a53x4
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a57x4-a53x4" gen_model_params
+        local model="cortex-a57x4-a53x4"
 
-	model="cortex-a57x4-a53x4" \
-	model_bin="FVP_Base_Cortex-A57x4-A53x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa57x4a53x4.rst31 b/run_config/fvp-cortexa57x4a53x4.rst31
index f6215f0..89db485 100644
--- a/run_config/fvp-cortexa57x4a53x4.rst31
+++ b/run_config/fvp-cortexa57x4a53x4.rst31
@@ -10,8 +10,11 @@
 }
 
 post_fetch_tf_resource() {
+        local model="cortex-a57x4-a53x4"
+
 	preload_bl33="1" \
 	preload_bl33_bin="uboot.bin" \
 	reset_to_bl31="1" \
-		model="cortex-a57x4-a53x4" gen_model_params
+		model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa65aex8 b/run_config/fvp-cortexa65aex8
index 3a81e59..ae60da3 100644
--- a/run_config/fvp-cortexa65aex8
+++ b/run_config/fvp-cortexa65aex8
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a65aex8" \
+        local model="cortex-a65aex8"
+
+	model="$model" \
 	data_instance="cluster0.cpu0.thread0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "16"
-
-	model="cortex-a65aex8" \
-	model_bin="FVP_Base_Cortex-A65AEx8" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa65x4 b/run_config/fvp-cortexa65x4
index bd54f0d..27a5e8c 100644
--- a/run_config/fvp-cortexa65x4
+++ b/run_config/fvp-cortexa65x4
@@ -9,12 +9,9 @@
 # parameter on the default cluster0.cpu0 instance.
 
 post_fetch_tf_resource() {
-	model="cortex-a65x4" \
-	data_instance="cluster0.cpu0.thread0" \
-		gen_model_params
-	uart="0" set_expect_variable "num_cpus" "8"
+        local model="cortex-a65x4"
 
-	model="cortex-a65x4" \
-	model_bin="FVP_Base_Cortex-A65x4" \
-	       gen_fvp_yaml
+	model="$model" data_instance="cluster0.cpu0.thread0" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "8"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa72x4 b/run_config/fvp-cortexa72x4
index 53955ee..8c59b28 100644
--- a/run_config/fvp-cortexa72x4
+++ b/run_config/fvp-cortexa72x4
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a72x4" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="cortex-a72x4"
 
-	model="cortex-a72x4" \
-	model_bin="FVP_Base_Cortex-A72x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa72x4a53x4 b/run_config/fvp-cortexa72x4a53x4
index ee5e8d5..f4fee25 100644
--- a/run_config/fvp-cortexa72x4a53x4
+++ b/run_config/fvp-cortexa72x4a53x4
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a72x4-a53x4" gen_model_params
+        local model="cortex-a72x4-a53x4"
 
-	model="cortex-a72x4-a53x4" \
-	model_bin="FVP_Base_Cortex-A72x4-A53x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa73x4 b/run_config/fvp-cortexa73x4
index 8341bf1..b593237 100644
--- a/run_config/fvp-cortexa73x4
+++ b/run_config/fvp-cortexa73x4
@@ -6,10 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a73x4" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="cortex-a73x4"
 
-	model="cortex-a73x4" \
-	model_bin="FVP_Base_Cortex-A73x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa73x4a53x4 b/run_config/fvp-cortexa73x4a53x4
index 53045f3..c4148ac 100644
--- a/run_config/fvp-cortexa73x4a53x4
+++ b/run_config/fvp-cortexa73x4a53x4
@@ -6,9 +6,8 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a73x4-a53x4" gen_model_params
+        local model="cortex-a73x4-a53x4"
 
-	model="cortex-a73x4-a53x4" \
-	model_bin="FVP_Base_Cortex-A73x4-A53x4" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa75x4 b/run_config/fvp-cortexa75x4
index e240d25..9727591 100644
--- a/run_config/fvp-cortexa75x4
+++ b/run_config/fvp-cortexa75x4
@@ -6,12 +6,12 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a75x4" \
+        local model="cortex-a75x4"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
 
-	model="cortex-a75x4" \
-	model_bin="FVP_Base_Cortex-A75x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa76aex4 b/run_config/fvp-cortexa76aex4
index 05ddf04..6e3d35e 100644
--- a/run_config/fvp-cortexa76aex4
+++ b/run_config/fvp-cortexa76aex4
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-        model="cortex-a76aex4" \
+        local model="cortex-a76aex4"
+
+        model="$model" \
         cache_state_modelled="0" \
         gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-        model="cortex-a76aex4" \
-	model_bin="FVP_Base_Cortex-A76AEx4" \
-	       gen_fvp_yaml
+        model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa76x4 b/run_config/fvp-cortexa76x4
index ada3d5f..5813b5b 100644
--- a/run_config/fvp-cortexa76x4
+++ b/run_config/fvp-cortexa76x4
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a76x4" \
+        local model="cortex-a76x4"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="cortex-a76x4" \
-	model_bin="FVP_Base_Cortex-A76x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa77x4 b/run_config/fvp-cortexa77x4
index 01d644f..8a2bc7d 100644
--- a/run_config/fvp-cortexa77x4
+++ b/run_config/fvp-cortexa77x4
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="cortex-a77x4" \
+        local model="cortex-a77x4"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="cortex-a77x4" \
-	model_bin="FVP_Base_Cortex-A77x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-cortexa78x4 b/run_config/fvp-cortexa78x4
index b59b60d..5243676 100644
--- a/run_config/fvp-cortexa78x4
+++ b/run_config/fvp-cortexa78x4
@@ -1,12 +1,11 @@
 #!/usr/bin/env bash
 
 post_fetch_tf_resource() {
-	model="cortex-a78x4" \
+        local model="cortex-a78x4"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="cortex-a78x4" \
-	model_bin="FVP_Base_Cortex-A78x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8 b/run_config/fvp-foundationv8
index 4ed1f46..cd047cc 100644
--- a/run_config/fvp-foundationv8
+++ b/run_config/fvp-foundationv8
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.8_0 b/run_config/fvp-foundationv8.8_0
index 78c6a4f..d9ec82e 100644
--- a/run_config/fvp-foundationv8.8_0
+++ b/run_config/fvp-foundationv8.8_0
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" arch_version="8.0" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.0" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.8_1 b/run_config/fvp-foundationv8.8_1
index 06609c6..caa162d 100644
--- a/run_config/fvp-foundationv8.8_1
+++ b/run_config/fvp-foundationv8.8_1
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" arch_version="8.1" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.1" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.8_2 b/run_config/fvp-foundationv8.8_2
index e07252a..ae4e58c 100644
--- a/run_config/fvp-foundationv8.8_2
+++ b/run_config/fvp-foundationv8.8_2
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" arch_version="8.2" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.2" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.8_3 b/run_config/fvp-foundationv8.8_3
index 1eadc1c..5619568 100644
--- a/run_config/fvp-foundationv8.8_3
+++ b/run_config/fvp-foundationv8.8_3
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" arch_version="8.3" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.3" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.8_4 b/run_config/fvp-foundationv8.8_4
index fa65a15..9636499 100644
--- a/run_config/fvp-foundationv8.8_4
+++ b/run_config/fvp-foundationv8.8_4
@@ -6,12 +6,9 @@
 #
 
 post_fetch_tf_resource() {
-	model="foundationv8" arch_version="8.4" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.4" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-foundationv8.bmcov b/run_config/fvp-foundationv8.bmcov
index 27ce18d..0de8553 100644
--- a/run_config/fvp-foundationv8.bmcov
+++ b/run_config/fvp-foundationv8.bmcov
@@ -6,13 +6,10 @@
 #
 
 post_fetch_tf_resource() {
-	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
-        model="foundationv8" gen_model_params
-	uart="0" set_expect_variable "num_cpus" "4"
+        local model="foundationv8"
 
-	model="foundationv8" \
-	model_name="fvp:foundation_platform_11.12_38" \
-	model_dir="/opt/model/Foundation_Platformpkg/models/Linux64_GCC-6.4" \
-	model_bin="Foundation_Platform" \
-	       gen_fvp_yaml
+	bmcov_plugin=1 bmcov_plugin_path="${coverage_trace_plugin}" \
+        model="$model" gen_model_params
+	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoverse_e1x1 b/run_config/fvp-neoverse_e1x1
index 52bd14f..ab317b9 100644
--- a/run_config/fvp-neoverse_e1x1
+++ b/run_config/fvp-neoverse_e1x1
@@ -6,13 +6,12 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse_e1x1" \
+        local model="neoverse_e1x1"
+
+	model="$model" \
 	cache_state_modelled="1" \
 	data_instance="cluster0.cpu0.thread0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "2"
-
-	model="neoverse_e1x1" \
-	model_bin="FVP_Base_Neoverse-E1x1" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoverse_e1x2 b/run_config/fvp-neoverse_e1x2
index 061c839..580873f 100644
--- a/run_config/fvp-neoverse_e1x2
+++ b/run_config/fvp-neoverse_e1x2
@@ -6,13 +6,12 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse_e1x2" \
+        local model="neoverse_e1x2"
+
+	model="$model" \
 	cache_state_modelled="1" \
 	data_instance="cluster0.cpu0.thread0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="neoverse_e1x2" \
-	model_bin="FVP_Base_Neoverse-E1x2" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoverse_e1x4 b/run_config/fvp-neoverse_e1x4
index 703b584..d8b725d 100644
--- a/run_config/fvp-neoverse_e1x4
+++ b/run_config/fvp-neoverse_e1x4
@@ -6,13 +6,12 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse_e1x4" \
+        local model="neoverse_e1x4"
+
+	model="$model" \
 	cache_state_modelled="1" \
 	data_instance="cluster0.cpu0.thread0" \
 		gen_model_params
 	uart="0" set_expect_variable "num_cpus" "8"
-
-	model="neoverse_e1x4" \
-	model_bin="FVP_Base_Neoverse-E1x4" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoverse_n1x4 b/run_config/fvp-neoverse_n1x4
index 451fcb8..cc848ae 100644
--- a/run_config/fvp-neoverse_n1x4
+++ b/run_config/fvp-neoverse_n1x4
@@ -6,12 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse_n1" \
+        local model="neoverse_n1"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
-
-	model="neoverse_n1" \
-	model_bin="FVP_Base_Neoverse-N1x1" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoverse_n2x4 b/run_config/fvp-neoverse_n2x4
index 5b60bce..de33786 100644
--- a/run_config/fvp-neoverse_n2x4
+++ b/run_config/fvp-neoverse_n2x4
@@ -6,8 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse_n2" \
+        local model="neoverse_n2"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-neoversev1x4 b/run_config/fvp-neoversev1x4
index d4e3c5e..37c5b5a 100644
--- a/run_config/fvp-neoversev1x4
+++ b/run_config/fvp-neoversev1x4
@@ -6,8 +6,11 @@
 #
 
 post_fetch_tf_resource() {
-	model="neoverse-v1x4" \
+        local model="neoverse-v1x4"
+
+	model="$model" \
 	cache_state_modelled="0" \
 	gen_model_params
 	uart="0" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-rde1edge b/run_config/fvp-rde1edge
index a86db84..40c0c57 100644
--- a/run_config/fvp-rde1edge
+++ b/run_config/fvp-rde1edge
@@ -17,6 +17,8 @@
 }
 
 post_fetch_tf_resource() {
+        local model="css-rde1edge"
+
 	model="css-rde1edge" \
 	model_version="11.9" \
 	model_build="41" \
@@ -24,4 +26,5 @@
 	set_run_env "ports_script" "$ci_root/model/css-sgi575-ports.awk"
 	set_run_env "num_uarts" "2"
 	uart="0" set_expect_variable "num_cpus" "32"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-rdn1edge b/run_config/fvp-rdn1edge
index aabe571..002457e 100644
--- a/run_config/fvp-rdn1edge
+++ b/run_config/fvp-rdn1edge
@@ -25,7 +25,10 @@
 }
 
 post_fetch_tf_resource() {
+        local model="css-rdn1edge"
+
 	model="css-rdn1edge" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/css-sgi575-ports.awk"
 	set_run_env "num_uarts" "3"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-rdn1edgex2 b/run_config/fvp-rdn1edgex2
index a89ffc6..ac5f575 100644
--- a/run_config/fvp-rdn1edgex2
+++ b/run_config/fvp-rdn1edgex2
@@ -38,8 +38,11 @@
 }
 
 post_fetch_tf_resource() {
-	model="css-rdn1edgex2" gen_model_params
+        local model="css-rdn1edgex2"
+
+	model="$model" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/css-rdinfra-ports.awk"
 	set_run_env "num_uarts" "4"
 	uart="0" set_expect_variable "num_cpus" "16"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-rdv1 b/run_config/fvp-rdv1
index 9933bd9..bd875c1 100644
--- a/run_config/fvp-rdv1
+++ b/run_config/fvp-rdv1
@@ -25,8 +25,11 @@
 }
 
 post_fetch_tf_resource() {
-	model="css-rdv1" gen_model_params
+        local model="css-rdv1"
+
+	model="$model" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/css-sgi575-ports.awk"
 	set_run_env "num_uarts" "3"
 	uart="0" set_expect_variable "num_cpus" "16"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-sgi575 b/run_config/fvp-sgi575
index 56ba556..bf35841 100644
--- a/run_config/fvp-sgi575
+++ b/run_config/fvp-sgi575
@@ -28,7 +28,10 @@
 }
 
 post_fetch_tf_resource() {
-	model="css-sgi575" gen_model_params
+        local model="css-sgi575"
+
+	model="$model" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/css-sgi575-ports.awk"
 	set_run_env "num_uarts" "3"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-sgm775 b/run_config/fvp-sgm775
index 14fc9b6..cdc5baa 100644
--- a/run_config/fvp-sgm775
+++ b/run_config/fvp-sgm775
@@ -14,7 +14,10 @@
 }
 
 post_fetch_tf_resource() {
-	model="css-sgm775" gen_model_params
+        local model="css-sgm775"
+
+	model="$model" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/css-sgi575-ports.awk"
 	set_run_env "num_uarts" "2"
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-spm b/run_config/fvp-spm
index b53774c..c84d5ea 100644
--- a/run_config/fvp-spm
+++ b/run_config/fvp-spm
@@ -16,11 +16,8 @@
 }
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
-	arch_version="8.4" \
-		gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.4" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-spm.linux b/run_config/fvp-spm.linux
index 1757515..330d060 100644
--- a/run_config/fvp-spm.linux
+++ b/run_config/fvp-spm.linux
@@ -22,13 +22,13 @@
 }
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	arch_version="8.4" \
 	initrd_bin="initrd.img" \
 	el3_payload_bin="manifest.dtb" \
 		gen_model_params
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-spm.optee b/run_config/fvp-spm.optee
index e3d5f74..898097c 100644
--- a/run_config/fvp-spm.optee
+++ b/run_config/fvp-spm.optee
@@ -20,10 +20,8 @@
 }
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
-		gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-spm.optee.sp b/run_config/fvp-spm.optee.sp
index bcf7240..6847a70 100644
--- a/run_config/fvp-spm.optee.sp
+++ b/run_config/fvp-spm.optee.sp
@@ -30,11 +30,8 @@
 }
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
-	arch_version="8.4" \
-		gen_model_params
+        local model="base-aemv8a"
 
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" arch_version="8.4" gen_model_params
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-spm.rstbl31 b/run_config/fvp-spm.rstbl31
index 9d5338f..a7d310e 100644
--- a/run_config/fvp-spm.rstbl31
+++ b/run_config/fvp-spm.rstbl31
@@ -40,7 +40,9 @@
 }
 
 post_fetch_tf_resource() {
-	model="base-aemv8a" \
+        local model="base-aemv8a"
+
+	model="$model" \
 	arch_version="8.4" \
 	reset_to_bl31="1" \
 	preload_bl33="1" \
@@ -53,8 +55,5 @@
 	initrd_bin="initrd.img" \
 	el3_payload_bin="manifest.dtb" \
 		gen_model_params
-
-	model="base-aemv8a" \
-	model_bin="FVP_Base_AEMv8A-AEMv8A" \
-	       gen_fvp_yaml
+	model="$model" gen_fvp_yaml
 }
diff --git a/run_config/fvp-tc0 b/run_config/fvp-tc0
index 7cd0555..9238d0f 100644
--- a/run_config/fvp-tc0
+++ b/run_config/fvp-tc0
@@ -17,8 +17,11 @@
 }
 
 post_fetch_tf_resource() {
-	model="tc0" gen_model_params
+        local model="tc0"
+
+	model="$model" gen_model_params
 	set_run_env "ports_script" "$ci_root/model/tc0-ports.awk"
 	set_run_env "num_uarts" "2"
 	uart="1" set_expect_variable "num_cpus" "4"
+	model="$model" gen_fvp_yaml
 }