Skip to contentSkip to conversation

tools: zynqmp: Fix regex expression around XPm_ConfigObject.

PATCH New Adrian Fiergolski 3 participants 3 messages Nov 24, 2020 – Nov 25, 2020 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools: zynqmp: Fix regex expression around XPm_ConfigObject.

The XPm_ConfigObject array definition generated by Vitis 2020.1 differs from previous Vivado versions (before 2019.2).

-const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = { +const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = +#elif defined (__ICCARM__)
+#pragma location = ".sys_cfg_data"
+__root const u32 XPm_ConfigObject[] =
+#endif
+{

Change the matching regex to handle both cases.

---
Changes in v2:
Fix the patch tile.

 tools/zynqmp_pm_cfg_obj_convert.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/zynqmp_pm_cfg_obj_convert.py +1 -1
index dd27f47921..0a44710e1e 100755
@@ -289,7 +289,7 @@ code = in_file.read()
 code = re.sub('//.*?\n|/\*.*?\*/', '', code, flags=re.DOTALL)
 
 # remove everything outside the XPm_ConfigObject array definition
-code = re.search('const u32 XPm_ConfigObject.*= {\n(.*)};',
+code = re.search('const u32 XPm_ConfigObject.*=.*{\n(.*)};',
                  code, flags=re.DOTALL).group(1)
 
 # Process each comma-separated array item
Signature · 1 line
2.29.2
#1 lore raw

PATCH v2 1/1 tools: zynqmp: Fix regex expression around XPm_ConfigObject.

Hi,

Quoted 25 lines · Adrian Fiergolski

The XPm_ConfigObject array definition generated by Vitis 2020.1 differs from previous Vivado versions (before 2019.2).

(quoted diff) +6 -1
-const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = {
+const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) =
+#elif defined (__ICCARM__)
+#pragma location = ".sys_cfg_data"
+__root const u32 XPm_ConfigObject[] =
+#endif
+{

Change the matching regex to handle both cases.

---
Changes in v2:
Fix the patch tile.

 tools/zynqmp_pm_cfg_obj_convert.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/zynqmp_pm_cfg_obj_convert.py +0 -0
index dd27f47921..0a44710e1e 100755

tools/zynqmp_pm_cfg_obj_convert.py code = in_file.read() · line 293

Quoted 6 lines
tools/zynqmp_pm_cfg_obj_convert.py +1 -1
@@ -289,7 +289,7 @@ code = in_file.read()
 code = re.sub('//.*?\n|/\*.*?\*/', '', code, flags=re.DOTALL)
 
 # remove everything outside the XPm_ConfigObject array definition
-code = re.search('const u32 XPm_ConfigObject.*= {\n(.*)};',
+code = re.search('const u32 XPm_ConfigObject.*=.*{\n(.*)};',
                  code, flags=re.DOTALL).group(1)

Looks good, thanks.

Signature · 1 line
Luca
#2 lore raw

PATCH v2 1/1 tools: zynqmp: Fix regex expression around XPm_ConfigObject.

In reply to Adrian Fiergolski
Quoted 26 lines · Adrian Fiergolski

The XPm_ConfigObject array definition generated by Vitis 2020.1 differs from previous Vivado versions (before 2019.2).

(quoted diff) +6 -1
-const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) = {
+const u32 XPm_ConfigObject[] __attribute__((used, section(".sys_cfg_data"))) =
+#elif defined (__ICCARM__)
+#pragma location = ".sys_cfg_data"
+__root const u32 XPm_ConfigObject[] =
+#endif
+{

Change the matching regex to handle both cases.

---
Changes in v2:
Fix the patch tile.

 tools/zynqmp_pm_cfg_obj_convert.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/zynqmp_pm_cfg_obj_convert.py +0 -0
index dd27f47921..0a44710e1e 100755

tools/zynqmp_pm_cfg_obj_convert.py code = in_file.read() · line 295

Quoted 8 lines
tools/zynqmp_pm_cfg_obj_convert.py +1 -1
@@ -289,7 +289,7 @@ code = in_file.read()
 code = re.sub('//.*?\n|/\*.*?\*/', '', code, flags=re.DOTALL)
 
 # remove everything outside the XPm_ConfigObject array definition
-code = re.search('const u32 XPm_ConfigObject.*= {\n(.*)};',
+code = re.search('const u32 XPm_ConfigObject.*=.*{\n(.*)};',
                  code, flags=re.DOTALL).group(1)
 
 # Process each comma-separated array item

Applied for next with two style fixes in commit message.

Thanks,
Michal