Basically what the title says. I want to avoid a read-modify-write when I'm writing to fields. The basic idea is to keep track of current value of the neighboring fields (a shadow copy) and encode the values accordingly.
The challenge: Hardware writable fields
- Hardware could have written to a field since the last time the shadow copy was updated.
- Currently there is a branch to check if the reg is read-write or write-only. An additional check may be needed to tell if there are hardware-writable fields in the reg
- Technically, current read-modify-write solution also has a race-condition wrt hardware-writable fields
Possible solutions:
- Keep a shadow copy and read-from that when appropriate for read-modify-writes
- Offload this to the callback. Then the callback needs to know that a given read was a part of a read-modify-write sequence. I'm personally not a fan of this. The callback will not have enough information to do the hardware-writable fields check
Workaround:
User keeps two instances of the top-level reg_model. One for writing and the other for reading. Then, in the writing reg_model, all reads happen from a shadow copy
Basically what the title says. I want to avoid a read-modify-write when I'm writing to fields. The basic idea is to keep track of current value of the neighboring fields (a shadow copy) and encode the values accordingly.
The challenge: Hardware writable fields
Possible solutions:
Workaround:
User keeps two instances of the top-level reg_model. One for writing and the other for reading. Then, in the writing reg_model, all reads happen from a shadow copy