Hi,
I have to implement control interface in an FPGA connected to the bus with certain width of data bus (let's assume, that it is 32 bits wide). In the c ontrol interface I have to implement some 32-bit registers, and this is not a problem. However additionally I have to implement some bit fields with d ifferent widths (e.g 5 bits, 9 bits and so on).
As description of the FPGA system is still evolving, to avoid continuous ma nual adjustments, I'd like to prepare an algorithm, which could automatical ly find the optimal distribution of those bit fields, so that they fit in t he minimal number of registers.
Of course later on there will be generated VHDL code and address table for the software.
In the first version the above is the only requirement. Later on I consider adding certain constraints, like: "fields A and B should be if possible in the same register", "fields C and D should NOT be in the same register" et c.
Thank you in advance, Best regards, Wojtek