Here’s a link to the wikipedia article, which covers horizontal and vertical microcode. In horizontal microcode the control word is a set of (usually) fixed-width fields, each of which controls a different functional block in a processor, e.g. ALU operations, status flag control, operand selection and so on. For design and debugging it’s preferable to express these operations in a human readable form (see below), which can then be compiled into the memory contents. If each field is specified using an enumerated type this should help detect errors.
However, once the control word is read from the memory, it would then be helpful to unpack the enumerations for use in each separate block.
Perhaps I’m arguing myself into modelling each line of the ROM as a list of enums, or as an object with particular enum elements, and then maybe using something else to generate a binary output for synthesis.
def microcode(addr, dout):
data = (
mc(ABUS_REG_A, BBUS_MDR, ALU_OP_ADD, Z_FLAG_ALU...)
dout.next = data[int(addr)]