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

modifiedWriteValues ignored in patches #156

Closed
kossnikita opened this issue Sep 21, 2023 · 9 comments · Fixed by #191
Closed

modifiedWriteValues ignored in patches #156

kossnikita opened this issue Sep 21, 2023 · 9 comments · Fixed by #191

Comments

@kossnikita
Copy link
Contributor

#106 added support for modifiedWriteValues but this ignored in patches

  SCR:
    _modify:
      IOSB0:
        access: write-only
        modifiedWriteValues: oneToClear
            <field>
              <name>IOSB0</name>
              <description>Set bit 0</description>
              <bitOffset>0</bitOffset>
              <bitWidth>1</bitWidth>
              <access>write-only</access> << it works
            </field>
@kossnikita
Copy link
Contributor Author

Yes, I do it like in this example. Why doesn't this patch work? Doesn't this provide an advantage when used with svd2rust?

@burrbull
Copy link
Member

How looks your patch? Have you added _W1C?

@kossnikita
Copy link
Contributor Author

kossnikita commented Sep 21, 2023

Oh. Thank you. This is not at all the behavior I expected.

    RLDF:
      _read:
        NotReached: [0, "Downcounter doesn't reached 0x40"]
        Reached: [1, "Downcounter reached 0x40"]
      _W0C:
        Clear: [0, "Clear flag"]
<modifiedWriteValues>zeroToClear</modifiedWriteValues>
<enumeratedValues>
  <name>RLDFR</name>
  <usage>read</usage>
  <enumeratedValue>
    <name>NotReached</name>
    <description>Downcounter doesn't reached 0x40</description>
    <value>0</value>
  </enumeratedValue>
  <enumeratedValue>
    <name>Reached</name>
    <description>Downcounter reached 0x40</description>
    <value>1</value>
  </enumeratedValue>
</enumeratedValues>
<enumeratedValues>
  <name>RLDFW</name>
  <usage>write</usage>
  <enumeratedValue>
    <name>Clear</name>
    <description>Clear flag</description>
    <value>0</value>
  </enumeratedValue>
</enumeratedValues>

@burrbull
Copy link
Member

oneToClear is _W1C. Not _W0C

@kossnikita
Copy link
Contributor Author

I get it. In this case, I need W0C.

@burrbull
Copy link
Member

Can we close this, or there still an issue?

@kossnikita
Copy link
Contributor Author

I'm not sure. On the one hand, there is a functionality implements this. By the way, it's undocumented #5 . On the other hand, this behavior seems unintuitive.
I would like to add the possibility of such a patch as in my original example.

@burrbull
Copy link
Member

I would like to add the possibility of such a patch as in my original example.

Reasonable. Could you make PR?

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

Successfully merging a pull request may close this issue.

2 participants