Académique Documents
Professionnel Documents
Culture Documents
by
The main purpose of this project is to design and test a DDR4 Controller and interface
using System Verilog constructs. The project is developed using the lecture on TLM as
an example. The project is broken into three major blocks: the synthesizable interface,
which provides the methods to translate the commands, data into pin signal levels used
by the DDR Controller and Memory DDR4 DIMM. The second block is DDR Controller,
which is built as a behavior model and iteratively converts to synthesizable block as the
example in TLM lecture. The last block is the DIMM model and other parts, which are
used in the test bench to verify the DDR Interface.
2. Definitions
DIMM Model
Test Bench
Monitor
Concurrent
Assertion
Clock
4.2 DDR Interface (ddr_interface.sv)
The module implements the System Verilog (SV) interface construct for all signals
connect between DIMM and DDR Controller as well as methods to translate the DDR
Controller commands into pin signal transactions, strobe data pins DQS, write data pins
and read data pins. There needs separate methods for write and read data because
DIMM requires write data as center-aligned to strobe signal while read data as edge-
aligned to strobe signals. But both DIMM and DDR Controller share the strobe data pins
method. The interfaces does not completed implements all DIMM commands but
adequate for setup, read/write operation, refresh such as MRS, ZQCL, ACT, CAS Read,
CAS Write, PreCharge, Refresh, DES, and NOP. The SV constructs of packed array,
structure, and user typedef enable the design to implement only one method for all the
commands.
DDR Config
DDR
Controller DDR Burst
Controller Interface
ACT
DDR Burst
CAS
DDR Burst
Data
DDR Burst
R/W
In this module, there are instances of the following modules:
The module implements the FSM below to control between initialization, read/write,
refresh, and update. The state machine starts to INIT state during the reset. The INIT
state will initiate a sequence of Mode Register Set to setup the DDR operation. Then it
stays in RW for burst read/write operation. The module implements a timer to keep
track tREF. When the timer is close to expire, the FSM will asserts dev_busy to
Memory Manager Unit (MMU) or in this case, the stimulus generator, to stop send
request and completed all read or write operation. The controller asserts the Refresh
command to DIMM and return to RW state after tRC delay.
The Controller also provides a way for MMU to switch Burst Length for 8 bytes to 4
bytes and vice versa. The Controller signals to stop receiving any requests and finishes
all current operation before start to set DIMM to new Burst Length via command MR0
o ne INIT
i td
In
Reset
IDLE
Refre
sh R
eq
RW
R/W idle
Re
fre
s hR
Re
dy
fre
s
hd
on
e
Refresh
IDLE
NOTE 1
WAIT
STATE
NOTE 3
NO
E2 T
PRECHARGE
RDY
ACT
WAIT STATE NOTE
1
NEXT ACT
EXTRA WAIT
CAS CMD
RW IDLE
RW DATA
WAIT STATE
5. Test Results
The test bench is simulated under QuestaSim with 500 test cases. All the test cases
are PASS.