
Each word in a ROM is broken into one or more fields. Fields may contain many different types of data, some examples of which are data, rom addresses, control signal values, and so forth. Each field must be declared using a statement similar to the following.
new_addr: field width=12,position=15
This statement declares a field named new_addr which has a width of 12 bits and begins at bit 15 of the ROM word. The bits of each word are numbered from the left starting with zero. Each field in the ROM word must be declared, even if it is never used. The order of the field statements is not important, since each statement has both a width and position associated with it. If the width specification is omitted, a width of one is assumed. If the position specification is omitted, a position of zero is assumed. Fields may not overlap.
fldb: field width=4,position=3,default=abc+def
fldc: field width=7,position=7,default=0x7f
If no default value is specified for a field, the field is assumed to have a default value of zero.
A shorthand notation, consisting of just the field name, can be used to assign the value 1 to a field of width 1. (This is normally considered to be activating a control signal.) For example, if abc is a one-bit field, the word-statement operand 1->abc is used to activate the signal abc. The shorthand specification abc will produce the same result.
With this declaration, the operands 15->xyz and xyz will produce the same result. There is no default value for the true parameter, so multi-bit fields with no true parameter must have values explicitly assigned to them, or must be allowed take their default value.
def field position=15,active=high
To reduce the confusion that active-high and active-low fields may cause, the constants %t and %f can be used to assign values to one-bit fields. The constant %t will turn a signal on, while %f will turn the signal off, regardless of whether it is active-high or active-low. When used in an expression, %t acts like a 1 and %f acts like a zero. These constants may be used wherever numbers are acceptable.