-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MMSlaveFactory #352
base: dev
Are you sure you want to change the base?
MMSlaveFactory #352
Conversation
Hi, Cool :) About addField, is seems there is no explicit way to specify where it should be in the word ? ex add field at bit 8 of the word ? |
There is no explicit way. You can use But I think I can add a function that allows explicitly adding fields to a position. Simply adding an index to the Field class and then sorting the Field objects in a ascending order when mapping to the register. |
You mean a fields to explicitly set the bit position ? or the field index ? |
There is now a functions to add a field for a word with a parameter to explicitly set the bit position of the field within the word. |
Hi, Sorry for the delay, i'm too busy those weeks :/ So, one question :
Is it possible to controle per field if you can Read / Write it ? (having a mixed Reg) |
No problem, same here :)
I'm afraid that's not possible. Access type is determined by the |
To me, it seem it is too limitating, isn't it ? |
At least limiting when it comes to a dense packing of the registers :D I struggled a lot with the different kinds of fields and was not sure how to handle it correctly. I'm sure I can easily move all the access handling from the entries to the fields and just keep the address decoding and event generation on entry level. |
hmm so the design and API is realy different from https://github.com/SpinalHDL/SpinalHDL/tree/dev/lib/src/main/scala/spinal/lib/bus/regif
Do not bother about this kind of mixes, it should never be done i would say. |
I'd say in case somebody is trying to describe unreasonable/unsupported field combinations in one register, just complain and bail out. |
Ok, so I leave this to the caller and may do some checks if the combination has weird consequences.
At the moment its different. But with the changes I will go back closer to the regif API. One function to create a register word. And several functions to add different fields, e.g. fieldRO, fieldRW, fieldClear. |
RegIf and MMSlaveFactory both do a good job. regIf or MMSlaveFactory, which is the preferred way forward? I am planning to use such a mechanism in my design. I can either try to complete Axi4 support for RegIf or wait for the completion of MMSlaveFactory, but of course it is possible to contribute to this extension. |
Half a year ago we discussed merging RegIf and BusSlaveFactory into a single thing. This is the current state of my work.
Currently, there are implementations for Axi4Lite and APB3. It supports Read-Only-Regs, Read Stream, Write Stream, Clear Regs. It generates C Header files, JSON files and HTML description for the interface.
It works well in my current project. Thus I think is mature enough to share.