From 17c496cb973568dfa3ca4427067724a1ebda8525 Mon Sep 17 00:00:00 2001 From: Thorsten de Buhr Date: Fri, 21 Jun 2024 15:27:33 +0200 Subject: [PATCH 1/5] Fixed: Message on check against sau num regions = 0 --- tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp | 2 +- tools/svdconv/SVDModel/src/SvdCpu.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp index 59336673f..a67a45462 100644 --- a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp +++ b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp @@ -204,7 +204,7 @@ const MsgTable SvdConv::msgTable = { { "M384", { MsgLevel::LEVEL_ERROR, CRLF_B, "Number of PMU Event Counters (found val: '%NUM%') not set or outside range [2..31]. Ignoring PMU entry."} }, // 14.02.2020 { "M385", { MsgLevel::LEVEL_ERROR, CRLF_B, "PMU not supported for CPU '%NAME%'" } }, // 14.02.2020 { "M386", { MsgLevel::LEVEL_ERROR, CRLF_B, "Name not C compliant: '%NAME%' : Brackets [] found" } }, - { "M387", { MsgLevel::LEVEL_ERROR, CRLF_B, "" } }, + { "M387", { MsgLevel::LEVEL_ERROR, CRLF_B, "CPU: set to null but regions are configured." } }, { "M388", { MsgLevel::LEVEL_ERROR, CRLF_B, "MVE Floating-Point support is set but MVE is not set" } }, { "M389", { MsgLevel::LEVEL_ERROR, CRLF_B, "Specified : '%NUM%' greater or equal '%NAME%': '%NUM2%'."} }, // 05.05.2020 { "M390", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Checking IRQ '%NAME%': CPU unknown (see ). Assuming a maximum of %NUM% external Interrupts."} }, // 13.05.2020 diff --git a/tools/svdconv/SVDModel/src/SvdCpu.cpp b/tools/svdconv/SVDModel/src/SvdCpu.cpp index 35493c5a1..a516570de 100644 --- a/tools/svdconv/SVDModel/src/SvdCpu.cpp +++ b/tools/svdconv/SVDModel/src/SvdCpu.cpp @@ -336,10 +336,14 @@ bool SvdCpu::CheckItem() LogMsg("M363", lineNo); m_sauRegionsConfig->Invalidate(); } + else if(m_sauNumRegions == 0) { + LogMsg("M387", lineNo); + m_sauRegionsConfig->Invalidate(); + } } if(m_sauNumRegions != SvdItem::VALUE32_NOT_INIT) { - if(m_sauNumRegions == 0 || m_sauNumRegions > MAXNUM_SAU_REGIONS) { + if(m_sauNumRegions > MAXNUM_SAU_REGIONS) { LogMsg("M364", NUM(m_sauNumRegions), NUM2(MAXNUM_SAU_REGIONS), lineNo); m_sauNumRegions = SvdItem::VALUE32_NOT_INIT; if(m_sauRegionsConfig) { From 9bea1e9bd38879f2a44f2cb3444c38ad55361f40 Mon Sep 17 00:00:00 2001 From: Thorsten de Buhr Date: Tue, 25 Jun 2024 09:21:00 +0200 Subject: [PATCH 2/5] added check num regions against configured regions --- tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp | 1 + tools/svdconv/SVDModel/src/SvdCpu.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp index a67a45462..06a50a755 100644 --- a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp +++ b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp @@ -208,6 +208,7 @@ const MsgTable SvdConv::msgTable = { { "M388", { MsgLevel::LEVEL_ERROR, CRLF_B, "MVE Floating-Point support is set but MVE is not set" } }, { "M389", { MsgLevel::LEVEL_ERROR, CRLF_B, "Specified : '%NUM%' greater or equal '%NAME%': '%NUM2%'."} }, // 05.05.2020 { "M390", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Checking IRQ '%NAME%': CPU unknown (see ). Assuming a maximum of %NUM% external Interrupts."} }, // 13.05.2020 + { "M391", { MsgLevel::LEVEL_WARNING, CRLF_B, "CPU: configured num of SAU regions '%NUM%' greater than value: %NUM2%" } }, // 500... SfrCC2 related Data modification Errors { "M500", { MsgLevel::LEVEL_ERROR, CRLF_B, "" } }, diff --git a/tools/svdconv/SVDModel/src/SvdCpu.cpp b/tools/svdconv/SVDModel/src/SvdCpu.cpp index a516570de..31105fcd8 100644 --- a/tools/svdconv/SVDModel/src/SvdCpu.cpp +++ b/tools/svdconv/SVDModel/src/SvdCpu.cpp @@ -350,6 +350,9 @@ bool SvdCpu::CheckItem() m_sauRegionsConfig->Invalidate(); } } + else if(m_sauNumRegions < m_sauRegionsConfig->GetChildCount()) { + LogMsg("M391", NUM(m_sauRegionsConfig->GetChildCount()), NUM2(m_sauNumRegions),lineNo); + } } if(m_pmuPresent) { From b13d1ab07b17a76df4ade652346567832081b744 Mon Sep 17 00:00:00 2001 From: Thorsten de Buhr Date: Tue, 25 Jun 2024 09:31:15 +0200 Subject: [PATCH 3/5] fixed pointer access --- tools/svdconv/SVDModel/src/SvdCpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/svdconv/SVDModel/src/SvdCpu.cpp b/tools/svdconv/SVDModel/src/SvdCpu.cpp index 31105fcd8..ba5351185 100644 --- a/tools/svdconv/SVDModel/src/SvdCpu.cpp +++ b/tools/svdconv/SVDModel/src/SvdCpu.cpp @@ -350,7 +350,7 @@ bool SvdCpu::CheckItem() m_sauRegionsConfig->Invalidate(); } } - else if(m_sauNumRegions < m_sauRegionsConfig->GetChildCount()) { + else if(m_sauRegionsConfig && m_sauNumRegions < m_sauRegionsConfig->GetChildCount()) { LogMsg("M391", NUM(m_sauRegionsConfig->GetChildCount()), NUM2(m_sauNumRegions),lineNo); } } From f7a1fbe0f25b6ac0900e512a9d92115e1679339a Mon Sep 17 00:00:00 2001 From: Thorsten de Buhr Date: Tue, 25 Jun 2024 11:32:31 +0200 Subject: [PATCH 4/5] changed message text --- tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp index 06a50a755..7283ef661 100644 --- a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp +++ b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp @@ -204,7 +204,7 @@ const MsgTable SvdConv::msgTable = { { "M384", { MsgLevel::LEVEL_ERROR, CRLF_B, "Number of PMU Event Counters (found val: '%NUM%') not set or outside range [2..31]. Ignoring PMU entry."} }, // 14.02.2020 { "M385", { MsgLevel::LEVEL_ERROR, CRLF_B, "PMU not supported for CPU '%NAME%'" } }, // 14.02.2020 { "M386", { MsgLevel::LEVEL_ERROR, CRLF_B, "Name not C compliant: '%NAME%' : Brackets [] found" } }, - { "M387", { MsgLevel::LEVEL_ERROR, CRLF_B, "CPU: set to null but regions are configured." } }, + { "M387", { MsgLevel::LEVEL_ERROR, CRLF_B, "CPU: set to 0 but regions are configured." } }, { "M388", { MsgLevel::LEVEL_ERROR, CRLF_B, "MVE Floating-Point support is set but MVE is not set" } }, { "M389", { MsgLevel::LEVEL_ERROR, CRLF_B, "Specified : '%NUM%' greater or equal '%NAME%': '%NUM2%'."} }, // 05.05.2020 { "M390", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Checking IRQ '%NAME%': CPU unknown (see ). Assuming a maximum of %NUM% external Interrupts."} }, // 13.05.2020 From 384117ab6858048df363fc410eadc2d2b4486e03 Mon Sep 17 00:00:00 2001 From: Thorsten de Buhr Date: Tue, 25 Jun 2024 11:55:32 +0200 Subject: [PATCH 5/5] fixed messages --- tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp index 7283ef661..e44c775b6 100644 --- a/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp +++ b/tools/svdconv/SVDConv/src/SVDConv_Msgs.cpp @@ -208,7 +208,7 @@ const MsgTable SvdConv::msgTable = { { "M388", { MsgLevel::LEVEL_ERROR, CRLF_B, "MVE Floating-Point support is set but MVE is not set" } }, { "M389", { MsgLevel::LEVEL_ERROR, CRLF_B, "Specified : '%NUM%' greater or equal '%NAME%': '%NUM2%'."} }, // 05.05.2020 { "M390", { MsgLevel::LEVEL_WARNING3, CRLF_B, "Checking IRQ '%NAME%': CPU unknown (see ). Assuming a maximum of %NUM% external Interrupts."} }, // 13.05.2020 - { "M391", { MsgLevel::LEVEL_WARNING, CRLF_B, "CPU: configured num of SAU regions '%NUM%' greater than value: %NUM2%" } }, + { "M391", { MsgLevel::LEVEL_WARNING, CRLF_B, "CPU: configured number of SAU regions '%NUM%' greater than value: '%NUM2%'" } }, // 500... SfrCC2 related Data modification Errors { "M500", { MsgLevel::LEVEL_ERROR, CRLF_B, "" } },