JSS Device MemoryW8D32
This device simulates a memory with word size 8-bits and data bus connection 32-bits. This type of memory can be used in 32-bit architectures, when specifying a memory address will read/write 2 bytes. Internally, data is stored as bytes. Since the word size is 8, an address specifies a byte location. The data is formed by using the specified address as the lower byte in the result.
Options
- initialization_policy - Decides how this memory is initialized. Values:
- ZERO - All locations are initialized with zero.
- RANDOM - Locations are initialized with random values.
- FIXED - Locations are initialized with a fixed value, set by the "fixed_value" option.
- VALUES - Individual values are specified in the "initialization_values" option.
- fixed_value - Value used to initialize memory when the "initialization_policy" is set to "FIXED".
- initialization_values - List of values used to initialize the memory, separated by space or comma. Only the number of values present in the list are used (some memory locations may remain uninitialized if the list has less values than the memory size).
- load_hex - Specifies a HEX file that will be read in the memory.
- load_hex_offset - This value is subtracted from the address specified in the HEX file.
- load_bin - Specifies a BINARY file that will be read in the memory.
- load_bin_offset - Specifies the starting address for the BINARY file. Its use differs from the HEX file, since the BINARY file does not have any address specified internally.
- invert_nibbles - When loading either a HEX file or a BINARY file, it will invert the nibbles. This may be useful with 4-bit memory if the values were stored in the HEX file in reverse order.
Implementation
https://github.com/ComputingMongoose/JavaSystemSimulator/blob/main/src/jss/devices/memory/impl/MemoryW8D32.javaExample configuration
{
"name":"RAM",
"type":"MemoryW8D32",
"configuration":[
{"key":"size", "value":14336},
{"key":"initialization_policy", "value":"ZERO"}
]
}