|CS552 Course Wiki: Spring 2017||Main »
Aligned Single Cycle Memory
Aligned Single-Cycle Memory Specification
Before building your cache, you should use this memory to update and test your processor's interface to properly handle unaligned accesses. Many processors (e.g., MIPS) are byte addressable, but require that all accesses be aligned to their natural size (i.e., byte loads and stores can access any individual byte, but word loads and stores must access aligned words). Since your processor only has word loads and stores, this is pretty simple (to support byte stores, the memory would need byte write enable signals; to support byte loads, either the memory or the processor needs a mux to select the right byte). Notice that the memory always returns aligned data even on a misaligned load.
The verilog source (memory2c_align.v) and synthesizable version (memory2c_align.syn.v) were included in the project tar.
Since your single-cycle design must fetch instructions as well as read or write data in the same cycle, you will want to use two instances of this memory -- one for data, and one for instructions.
During each cycle, the "enable" and "wr" inputs determine what function the memory will perform. On a unaligned access err is set.
|Page last modified on February 18, 2016, visited 272 times|