Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to define in the XML files a register that is duplicated N times and defines several fields? #328

Open
chevillotn opened this issue Jan 8, 2025 · 2 comments

Comments

@chevillotn
Copy link

chevillotn commented Jan 8, 2025

Hi I would like to have a 32 bit register defined as:

  • mask: 0xFFFF0000 => id='field1'
  • mask: 0x0000FFFF => id='field2'

duplicated N times (say N=10)

The current solution i use is the following:

  <node id="test_reg_0" address="0x00000000" module="file://test_reg.xml" description="test reg"/>
...
  <node id="test_reg_9" address="0x00000009" module="file://test_reg.xml" description="test reg"/>

with test_reg.xml as:

<?xml version="1.0" ?>
<node id="top">
  <node id="field1" permission="r" mask="0xffff0000" description="field1"/>
  <node id="field2" permission="r" mask="0x0000ffff" description="field2"/>
</node>

Would there be a more compact way of doing this? I have tried:

  <node id="test_reg" address="0x00000000" permission="r" description="test reg" size="10" mode="incremental">
    <node id="field1" permission="r" description="field1" mask="0xffff0000"/>
    <node id="field2" permission="r" description="field2" mask="0x0000ffff"/>
  </node>

but this gives me an overlap warning message, even if size is set to 1.

Thanks

@tswilliams
Copy link
Collaborator

Hi!

Your current solution is the most compact way of doing this - i.e:

  <node id="test_reg_0" address="0x00000000" module="file://test_reg.xml" description="test reg"/>
...
  <node id="test_reg_9" address="0x00000009" module="file://test_reg.xml" description="test reg"/>

... with the test_reg.xml file that you mentioned.

Cheers,
Tom

@chevillotn
Copy link
Author

Hi Tom,
Wouldn't it be an improvment to be able to use size in the register definition?
That would allow to keep the original name of the register and not have artifically added suffix like _0, and also would allow to use the readBlockOffset function or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants