VLSI Cache Project
VLSI Cache Project
Description:
BUSY
CA[0]
CLK
Output Enable
CA[1]
Register
Register
CA[2]
RESET
Mux
MD[7]
Decoder
CA [3]
State Machine
MD[6]
1 3
CA [4]
CA [5]
8
8
Number of bits
8
blocks
MD[4]
Cache
CA [6]
Valid Tag
CA [7]
MD[3]
4 words/ block
MD[2]
Hit/Miss
RD/WR
MD[5]
MD[1]
Output Enable
MD[0]
START
Input
Output
Core GND
Core VDD
Corner
Chip interface
A cache usually needs two address and data interfaces, one to the upper level cache/processor and
another to lower level cache/memory. In your design, you have both these interfaces, 8-bit address
and data connections to both the CPU and the memory.
CPU Address (CA):8-bit address input from the CPU for both read and write requests. Address
will be provided by the CPU on the rising edge of clock along with the start signal
CPU Data (CD): 8-bit input/output data bus. Used as input for write requests and output for read
requests. Data will be provided on the rising edge of clock for write requests along with the start
signal
Start: Handshaking signal indicating the start of a read/write request from the CPU, goes high on
a positive edge. (Internally your chip works on the negative edge. The address, start, read_write
control and data, will be setup half a clock cycle before you start operating on the negative edge)
Busy: Handshaking signal indicating to the CPU that your chip is processing the previous request.
Read_Write (RD/WR): If signal is high CPU is requesting a read operation, if low a write operation
Reset: Master reset to the chip. A high on reset should invalidate all the entries in the cache and
reset your state machine to its reset state. Reset any other registers as required.
Clock (clk): Clock input to the chip. The CPU inputs/outputs and the memory inputs/outputs will
be synchronized with this clock signal also.
Memory Address (MA): Address output to the memory in case of read miss. The last two bits of
the address should always be 00 i.e. you provide the address for the last word in the block. The
memory controller will automatically increment the address four times and provide you data for
the whole block (4 bytes).
Memory Data (MD): Data input from the memory. It takes the memory 8 clock cycles after getting the enable signal to provide the first byte of data. It will sequentially provide four bytes of
data required for the whole block. The first data byte will become valid on the 8th negative edge
after asserting enable and will stay stable for 2 clock cycles. The next byte will be provided on the
Operations
The cache has 8 blocks, with four bytes per block. Therefore, you need 3 bits to select one of the
8 blocks and 2 bits to select the correct byte from the block. The remaining 3 bits in the address
are used as a tag.
3
Tag
3
Block
Offset
2
Byte
Offset
The start signal from the CPU marks the beginning of a operation. The CPU provides the address
for read operations and the address as well as data for write operations. All these signals are provided on the rising edge of clock. Your chip internally works at the falling edge of clock so the
signals are stable before you need to latch them thus avoiding setup time violations. The signals
will be removed by the CPU on the next rising edge of clock. The busy signal triggers the removal
of these signals. Busy is an output that should go high on the negative edge after receiving the
start signal from the CPU.
Read Hit
For a read operation, the CPU turns start high, provides the address and turns read_write signal
high on the positive edge of clock. On the negative edge you need to latch all these required signals and turn on the busy signal. The inputs will be removed by the CPU on the positive edge
once it receives a busy signal. You determine whether the data being referenced is in the cache, by
comparing the tag bits of the address with the tag bits stored in the block given by the block offset
in the address. Also you need to check that the block is valid. Simultaneously you need to read the
correct byte from the cache. If the tag and valid checking operation signals a hit, output enable
should go high on the next negative edge, the data should be latched in the output register so that
it stays stable for one whole clock cycle and the busy signal should be turned off. The CPU will
read the data off the data bus on the positive edge. The next operation could be requested on any
subsequent clock cycle.
Write Hit
CPU signals follow the same timing as the read, but read_write is set to low and the data to be
written is provided. The required inputs should be latched on the negative edge, busy should be
turned on and tag/valid compare should be performed. If the result is a hit, on the next negative
edge the data should be written to the correct byte in the selected block, busy should still stay
high. On the second negative edge after receiving the write request busy should go low signalling
the end of the write operation. The CPU will provide a new input on any subsequent clock cycle.
Cache Cell
Usually SRAMs and CAM (content access memory) cells are used for caches. However, extensive simulations need to be performed to evaluate the effect of loads on these designs. To avoid
such situations use the following cell for your cache, which provides, simultaneous read and write
capability at the expense of extra area.
Write Data
Write Enable
Positive level
sensitive
Latch
Tx
Gate
Read Enable
Read Enable
Read Data
Chip Waveforms
The chip timing waveforms explaining the above operations are provided as a separate document.