Open redxeth opened 4 years ago
Not sure about this one, its getting into the realm of modelling the external effects of register changes which is generally beyond the scope of what Origen can do - obviously there's a million and one other ways that writing a given register can cause changes in another register that we don't model.
This could be handled in the application's main write_register
method. Where it would be on the lookout for writes to one of these special registers and then update the data value of the 3rd party register as required.
However, we could also make an exception and handle this in Origen if it is viewed as generally useful. My main question then would be how do you think we should express this linkage in Origen?
IP-XACT has no way to express something like this btw.
I get that. Just had direct experience on another project with this and thought would bring it up for discussion. Would like to know @chrisnappi 's thoughts.
Here's the current reg definition API:
# This is the reg description
with Reg("adc_ctrl", 0x0024, size=16):
# This is the COCO description
Field("coco", offset=7, access="ro")
Field("aien", offset=6)
Field("diff", offset=5)
Field("adch", offset=0, width=5, reset=0x1F, enums={
# A simple enum
"val1": 3,
# A more complex enum, all fields except for value are optional, it will probably
# eventually support assigning the description from this comment
"val2": { "value": 5, "usage": "w", "description": "The value of something"},
})
How would we expand that to describe this behavioral linkage between registers?
On many SOCs there are these convenience SET, CLR, INV registers that server to help modify individual bits of another 'real' register. Often times these are clearly defined in the XML (or other source) already but the issue was that in Origen(1) the register don't work as intended.
i.e.
How do we support these in O2?