Origen-SDK / o2

MIT License
4 stars 0 forks source link

Develop an API for the register model to permit post-import updates #76

Open redxeth opened 4 years ago

redxeth commented 4 years ago

Often the register models generates from importing registers XML (or other) source are not complete for the needs of test. It could be that a register is used both in user mode and test mode, but is defined in XML only in test mode, or the format of a pin changes, or there is data or value tables missing that need to be added.

Work done on this before has been very 'hack-ey' in nature, or you overwrite the already-imported register as needed.

redxeth commented 4 years ago

Enumerated values in registers per https://github.com/Origen-SDK/o2/issues/31 I suspect will be one of those things not always in the source-- so should be something that can be added after import.

ginty commented 4 years ago

or you overwrite the already-imported register as needed.

How else are you thinking we should handle this?

redxeth commented 4 years ago

Some way to modify only part of the register instead of having to overwrite the reg.

Examples used on exisiting projects (mind the ruby)

myreg.named_bits do |name, bit|
  bit.writable((1 << bit.length) - 1)
end

which could be due to the fact that now we're in test mode. This is a very hack-ey way to change the bitfield writable flag.

But I had another case where there was a typo in the XML so had to add the entire register again with the correction, can't find it just now.