Best Practice for Modeling W1S and W1C Access to Same Bits #270
-
Hi team, I'm trying to model a hardware register where software can: Set bit using Write-1-to-Set (W1S) Clear bit using Write-1-to-Clear (W1C) Read back the current value of the bit All of these operations should target the same hardware bit. Appreciate any clarification or best practices for this use case. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It is not clear to me how this is possible. If software writes 1 to a bit, what would the effect be if the same bit would clear and set if written with a 1? |
Beta Was this translation helpful? Give feedback.
-
Hi. Here is the detailed explanation. Register name Access type Action clock_enable_set w1s Write 1 to set clock_enable clock_enable_clr w1c Write 1 to clear clock_enable Both registers map to the same underlying hardware field clock_enable, but from a software point of view, they are separate registers with distinct access semantics. |
Beta Was this translation helpful? Give feedback.
Ah i see what you mean. This is possible by creating separate trigger bits using a combination of the singlepulse, hwset, and hwclr properties.
See below: