Description
Description
Reggen generates a helpful enum in reg_pkg.sv.tpl with numeric identifiers for the various registers (even though they'll probably be addressed by name within reg2hw and hw2reg):
// Register index
typedef enum int {
MYMODULE_CFG,
MYMODULE_STATUS,
MYMODULE_INTERRUPTS
} mymodule_id_e;
It would also be useful that the same were done for windows, especially since they have to be referenced by index (there's no fancy struct definition with one member per window as it is the case for registers):
// Window index
typedef enum int {
MYMODULE_INPUTDATA,
MYMODULE_OUTPUTDATA
} mymodule_win_id_e;
Right now, there's no way to figure out which index corresponds to which window other than by counting window entries in the hjson file.
(And, on a partially related note, do you think it would make sense to add a dummy MYMODULE_NUMBER_OF_REGS
/MYMODULE_NUMBER_OF_WINS
entry at the end of both enums, to know how many elements are in each enum, so that they can be used for array dimensions and the like? For example, reg_req_t [MYMODULE_NUMBER_OF_WINS-1:0] reg_req_win_o;
)