You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to register callback functions that are triggered on reads and/or writes of specific registers. The most common use cases are:
After a write is performed, copy or transform data written into one or more fields from the register model to another part of the reference model.
After a write is performed, trigger an action elsewhere in the reference model such as a FIFO push.
When a read is performed, modify the state of one or more fields in the register model before returning data to the caller.
After a read is performed, modify the state of a register such as clearing interrupt status bits.
After a read is performed, trigger an action elsewhere in the reference model such as a FIFO pop.
I propose 4 callback hooks: pre_write, post_write, pre_read, post_read.
post_write: use case 1) & 2)
pre_read: use case 3)
post_read: use case 4) & 5)
I cannot think of a use case for pre_write, but I think it should be added for consistency.
I plan to extend ordt_addr_elem so that callbacks may be registered with any ordt_reg or ordt_regset derived class. I don't have any need to register a callback on a field.
I'll submit a PR when the first draft is done.
The text was updated successfully, but these errors were encountered:
My work in progress is in fork Cerebras/open-register-design-tool, branch jeff/cppmod-callbacks. I will use the new callback interfaces for a while to see if anything needs to be added or changed. Feedback is welcome.
From open-register-design-tool created by ebertland: Juniper#36
We need to register callback functions that are triggered on reads and/or writes of specific registers. The most common use cases are:
I propose 4 callback hooks: pre_write, post_write, pre_read, post_read.
post_write: use case 1) & 2)
pre_read: use case 3)
post_read: use case 4) & 5)
I cannot think of a use case for pre_write, but I think it should be added for consistency.
I plan to extend ordt_addr_elem so that callbacks may be registered with any ordt_reg or ordt_regset derived class. I don't have any need to register a callback on a field.
I'll submit a PR when the first draft is done.
The text was updated successfully, but these errors were encountered: