I have recently modeled registers as simple unions to represent bitfields, for example:
which facilitates the access to either the complete word or a bitfield.
The interesting part comes when I try to check if the register value has changed, is there a more elegant way of doing this than polling in if or while statements for each register's value? I need to do this for a lot of them so I was wondering if modeling this using sc_bv provides a built-in event I could use in a SC_METHOD sensitivity list?
and then do something like:
sensitive << Reg.b.ENABLE;
Any pointers or ideas are greatly appreciated