mtkcpu icon indicating copy to clipboard operation
mtkcpu copied to clipboard

DM: explicitely state register fields types in code, and generate HDL based on that, offline.

Open bieganski opened this issue 2 years ago • 0 comments

currently for Debug Module registers fields, like cmderr field of abstractcs, that due to Debug Specs is W1C (write 1 clears the corresponding bit) we need to explicitely write corresponding logic in HandlerDMI subclass:

comb += self.controller.command_finished.eq(1)
sync += self.reg_abstractcs.cmderr.eq(
        self.reg_abstractcs.cmderr & (~write_value.cmderr)
 )

Such logic could however be generated automatically for each field of W1C type, bassed on data.Struct fields annotated with field-type metadata.

bieganski avatar Jul 07 '23 20:07 bieganski