Performance: Add support for split build

Rename the SPE and NSPE source root directories.

Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I5891a47ab00078e7f0c6429d28925786094bd149
diff --git a/build_helper/build_helper_config_maps.py b/build_helper/build_helper_config_maps.py
index be4f767..3f18400 100644
--- a/build_helper/build_helper_config_maps.py
+++ b/build_helper/build_helper_config_maps.py
@@ -96,7 +96,7 @@
     "TEST_CBOR"    : "-DTEST_NS_QCBOR=ON ",
 
     # Profiling test
-    "PROF"         : "-DCONFIG_TFM_ENALBE_PROFILING=ON -DTFM_TOOLS_PATH=%(codebase_root_dir)s/../tf-m-tools ",
+    "PROF"         : ("-DTFM_EXTRA_CONFIG_PATH=%(codebase_root_dir)s/../tf-m-tools/profiling/profiling_cases/prof_psa_client_api/partitions/config_spe.cmake "),
 
     # tf-m-extras example support
     "EXAMPLE_VAD"             : ("-DNS_EVALUATION_APP_PATH=%(codebase_root_dir)s/../tf-m-extras/examples/vad_an552/ns_side "
diff --git a/build_helper/build_helper_configs.py b/build_helper/build_helper_configs.py
index 0c44808..1eafdfb 100755
--- a/build_helper/build_helper_configs.py
+++ b/build_helper/build_helper_configs.py
@@ -46,7 +46,7 @@
     # provided in the seed dictionary.
 
     "spe_config_template": "cmake -G Ninja " + \
-        "-S %(tfm_tests_root_dir)s/%(test_root_dir)s/spe " + \
+        "-S %(spe_root_dir)s " + \
         "-B %(ci_build_root_dir)s/spe " + \
         "-DTFM_PLATFORM=%(tfm_platform)s " + \
         "-DTFM_TOOLCHAIN_FILE=%(codebase_root_dir)s/%(s_compiler)s " + \
@@ -65,7 +65,7 @@
         "-DTFM_EXTRAS_REPO_PATH=%(codebase_root_dir)s/../tf-m-extras ",
 
     "nspe_config_template": "cmake -G Ninja " + \
-        "-S %(tfm_tests_root_dir)s/%(test_root_dir)s " + \
+        "-S %(nspe_root_dir)s " + \
         "-B %(ci_build_root_dir)s/nspe " + \
         "-DCONFIG_SPE_PATH=%(ci_build_root_dir)s/spe/api_ns " + \
         "-DTFM_TOOLCHAIN_FILE=%(ci_build_root_dir)s/spe/api_ns/cmake/%(ns_compiler)s " + \
diff --git a/performance.py b/performance.py
index 3fa96b4..97c6554 100755
--- a/performance.py
+++ b/performance.py
@@ -44,7 +44,7 @@
     '''
     This function uses fromelf of ARMCLANG to get the sizes of a file in the build binary directory of TF-M
     '''
-    f_path = os.path.join(os.getenv('WORKSPACE'), 'trusted-firmware-m', 'build', 'bin', filename)
+    f_path = os.path.join(os.getenv('WORKSPACE'), 'ci_build', 'spe', 'bin', filename)
     if os.path.exists(f_path) :
         data_fromelf = utils.fromelf(f_path)
         print(data_fromelf[1])  # Output of fromelf
diff --git a/tfm_ci_pylib/tfm_build_manager.py b/tfm_ci_pylib/tfm_build_manager.py
index 75a2cd8..b4df071 100644
--- a/tfm_ci_pylib/tfm_build_manager.py
+++ b/tfm_ci_pylib/tfm_build_manager.py
@@ -383,7 +383,8 @@
 
         # Overwrite parameters of build configs
         overwrite_params = {"codebase_root_dir":   build_cfg["codebase_root_dir"],
-                            "tfm_tests_root_dir":  build_cfg["codebase_root_dir"] + "/../tf-m-tests",
+                            "spe_root_dir":  build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_reg/spe",
+                            "nspe_root_dir":  build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_reg",
                             "ci_build_root_dir":  build_cfg["codebase_root_dir"] + "/../ci_build",
                             "tfm_platform": i.tfm_platform,
                             "s_compiler": self.choose_toolchain(i.compiler, s_build = True),
@@ -407,9 +408,11 @@
 
         # Test root dir
         if i.test_psa_api != "OFF":
-            overwrite_params["test_root_dir"] = "tests_psa_arch"
-        else:
-            overwrite_params["test_root_dir"] = "tests_reg"
+            overwrite_params["spe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_psa_arch/spe"
+            overwrite_params["nspe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-tests/tests_psa_arch"
+        elif "PROF" in i.extra_params:
+            overwrite_params["spe_root_dir"] = build_cfg["codebase_root_dir"]
+            overwrite_params["nspe_root_dir"] = build_cfg["codebase_root_dir"] + "/../tf-m-tools/profiling/profiling_cases/tfm_profiling"
 
         # Overwrite commands for building TF-M image
         build_cfg["spe_config_template"] %= overwrite_params