Closed wzab closed 3 years ago
With introduction of new "fixed" registers it should be decided if they should be still manually added in all target address maps, as it is done now:
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1590
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1674
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1742
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1853
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1925
https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1999
Maybe it would be better to implement a list of such "fixed" registers and handle them automatically in target address maps generators? With 4 registers used in TEST DEVICE we can survive with manual implementation, but if there are more to come, maybe we should change it?
The required functionality is implemented with commit https://github.com/wzab/agwb/commit/081e8403b6779a27dc202caf206492bdb692bce2 and initially tested in commit https://github.com/wzab/agwb/commit/8ae93f4acd2dff89c6a0af9ad32de8e89481aee2
Many thanks to Walter F.J. Müller @wfjm for suggesting that functionality.
The target code generators, however, are becoming complex, and difficult to maintain. Maybe it is time to rethink how to separate them and clean them up, as suggested by @m-kru in #43 ?
That functionality has been requested by @wfjm as the result of usage of AGWB for preparation of the CBM firmware. The idea is that at well known positions the following registers should be located:
The implementation may be relatively simple and requires just simple extension of the code generation template: https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L176
The feature should be optional (so an additional attribute, e.g.
testdev_ena="1"
should be added). Depending on it, the address of the first free register should be adjusted in: https://github.com/wzab/agwb/blob/c35cde4f73a2fee4b715908942afc4082426e13a/src/wb_block.py#L1244