AdaCore / AdaCore/svd2ada

SVD file with identifiers containing "two consecutive underscores"

Open
#103 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ada
Stars
71
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Howdy!

I'm pretty new to all of this, so I'm not entirely certain where the fault here lies.

I have an SVD file for the SK32344 with which I'm attempting to build for this board: https://nxp.gitbook.io/mr-canhubk344/getting-started

I have built svd2ada, run it, things appear to be generated correctly. But when I try to build it with alr build I get an error in a particular file:

[chipc@sknkwrks s32k344_hal]$ alr build
ⓘ Building s32k344_hal/s32k344_hal.gpr...
Compile
   [Ada]          s32k344_svd-mu.ads
   [Ada]          s32k344_svd-flash.ads
   [Ada]          s32k344_svd-pmc.ads
   [Ada]          s32k344_svd-pll.ads
   [Ada]          s32k344_svd-mc_me.ads
   [Ada]          s32k344_svd-mc_cgm.ads
   [Ada]          s32k344_svd-fxosc.ads
   [Ada]          s32k344_svd-firc.ads
   [Ada]          s32k344_svd-sxosc.ads
   [Ada]          s32k344_svd-sirc.ads
   [Ada]          s32k344_svd-tspc.ads
   [Ada]          s32k344_svd-cmu_fm.ads
   [Ada]          s32k344_svd-cmu_fc.ads
   [Ada]          s32k344_svd-wkpu.ads
   [Ada]          s32k344_svd-dcm_gpr.ads
   [Ada]          s32k344_svd-dcm.ads
   [Ada]          s32k344_svd-virt_wrapper.ads
   [Ada]          s32k344_svd-siul2.ads
   [Ada]          s32k344_svd-mc_rgm.ads
   [Ada]          s32k344_svd-rtc.ads
s32k344_svd-mu.ads:729:35: error: two consecutive underlines not permitted
s32k344_svd-mu.ads:733:35: error: two consecutive underlines not permitted

   compilation of s32k344_svd-mu.ads failed

gprbuild: *** compilation phase failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/chipc/workspaces/kvs/external/libraries/NXP_S32K344/ada/s32k344_hal/s32k344_hal.gpr"] exited with code 4
error: Compilation failed.

The offending identifiers are:

   --  MUB
   MU_0_MUB_Periph : aliased MU_Peripheral
     with Import, Address => MU_0__MUB_Base;

   --  MUB
   MU_1_MUB_Periph : aliased MU_Peripheral
     with Import, Address => MU_1__MUB_Base;

In the SVD I have these lines:

[chipc@sknkwrks s32k344_hal]$ rg MU_.__MUB ~/workspaces/kvs/external/libraries/NXP_S32K344/S32K344_M7.svd
265619:      <name>MU_0__MUB</name>
269473:    <peripheral derivedFrom="MU_0__MUB">
269474:      <name>MU_1__MUB</name>

So, my question is whether the double underscores is something I can edit in the SVD file safely, or instead is there a flag I should be setting in the gpr project?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure using S32K344_M7.svd and the generated s32k344_svd-mu.ads, then inspect svd2ada's handling of SVD identifiers such as MU_0__MUB and MU_1__MUB. Run alr build to verify the generated Ada sources no longer produce consecutive-underscore errors.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.