📄 ddr2.v
字号:
/****************************************************************************************** File Name: ddr2.v* Version: 5.20* Model: BUS Functional** Dependencies: ddr2_parameters.vh** Description: Micron SDRAM DDR2 (Double Data Rate 2)** Limitation: - doesn't check for average refresh timings* - positive ck and ck_n edges are used to form internal clock* - positive dqs and dqs_n edges are used to latch data* - test mode is not modeled** Note: - Set simulator resolution to "ps" accuracy* - Set Debug = 0 to disable $display messages** Disclaimer This software code and all associated documentation, comments or other * of Warranty: information (collectively "Software") is provided "AS IS" without * warranty of any kind. MICRON TECHNOLOGY, INC. ("MTI") EXPRESSLY * DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED * TO, NONINFRINGEMENT OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES * OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. MTI DOES NOT * WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE * OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE. * FURTHERMORE, MTI DOES NOT MAKE ANY REPRESENTATIONS REGARDING THE USE OR * THE RESULTS OF THE USE OF THE SOFTWARE IN TERMS OF ITS CORRECTNESS, * ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE * OR PERFORMANCE OF THE SOFTWARE REMAINS WITH YOU. IN NO EVENT SHALL MTI, * ITS AFFILIATED COMPANIES OR THEIR SUPPLIERS BE LIABLE FOR ANY DIRECT, * INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES (INCLUDING, * WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, * OR LOSS OF INFORMATION) ARISING OUT OF YOUR USE OF OR INABILITY TO USE * THE SOFTWARE, EVEN IF MTI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH * DAMAGES. Because some jurisdictions prohibit the exclusion or * limitation of liability for consequential or incidental damages, the * above limitation may not apply to you.** Copyright 2003 Micron Technology, Inc. All rights reserved.** Rev Author Date Changes* ---------------------------------------------------------------------------------------* 1.00 JMK 07/29/03 Initial Release* 1.10 JMK 08/09/03 Timing Parameter updates to tIS, tIH, tDS, tDH* 2.20 JMK 08/07/03 General cleanup* 2.30 JMK 11/26/03 Added CL_MIN, CL_MAX, wl_min and wl_max parameters.* Added AL_MIN and AL_MAX parameters.* Removed support for OCD.* 2.40 JMK 01/15/04 Removed verilog 2001 constructs.* 2.50 JMK 01/29/04 Removed tRP checks during Precharge command.* 2.60 JMK 04/20/04 Fixed tWTR check.* 2.70 JMK 04/30/04 Added tRFC maximum check.* Combined Self Refresh and Power Down always blocks.* Added Reset Function (CKE LOW Anytime).* 2.80 JMK 08/19/04 Precharge is treated as NOP when bank is not active. * Added checks for tRAS, tWR, tRTP to any bank during Pre-All.* tRFC maximum violation will only display one time.* 2.90 JMK 11/05/04 Fixed DQS checking during write.* Fixed false tRFC max assertion during power up and self ref.* Added warning for 200us CKE low time during initialization.* Added -3, -3E, and -37V speed grades to ddr2_parameters.v* 3.00 JMK 04/22/05 Removed ODT off requirement during power down.* Added tAOND, tAOFD, tANPD, tAXPD, tAONPD, and tAOFPD parameters.* Added ODT status messages.* Updated the initialization sequence.* Disable ODT and CLK pins during self refresh.* Disable cmd and addr pins during power down and self refresh.* 3.10 JMK 06/07/05 Disable trpa checking if the part does not have 8 banks.* Changed tAXPD message from error to a warning.* Added tDSS checking.* Removed tDQSL checking during tWPRE and tWPST.* Fixed a burst order error during writes.* Renamed parameters file with .vh extension.* 3.20 JMK 07/18/05 Removed 14 tCK requirement from LMR to READ.* 3.30 JMK 08/03/05 Added check for interrupting a burst with auto precharge.* 4.00 JMK 11/21/05 Parameter names all UPPERCASE, signal names all lowercase.* Clock jitter can be tolerated within specification range.* Clock frequency is sampled from the CK pin.* Scaleable up to 64 DQ and 16 DQS bits.* Read data can be randomly skewed using RANDOM_OUT_DELAY.* Parameterized read and write DQS, and read DQ.* Initialization can be bypassed using initialize task.* 4.10 JMK 11/30/05 Fixed compile errors when `MAX_MEM was defined.* 4.20 JMK 12/09/05 Fixed memory addressing error when `MAX_MEM was defined.* 4.30 JMK 02/15/06 Added dummy write to initialization sequence.* Removed tWPST maximum checking.* Rising dqs_n edge latches data when enabled in EMR.* Fixed a sign error in the tJIT(cc) calculation.* 4.40 JMK 02/16/06 Fixed dummy write when`MAX_MEM was defined.* 4.50 JMK 02/27/06 Fixed extra tDQSS assertions.* Fixed tRCD and tWTR checking.* Errors entering Power Down or Self Refresh will cause reset.* Ignore dqs_n when disabled in EMR.* 5.00 JMK 04/24/06 Test stimulus now included from external file (subtest.vh)* Fixed tRFC max assertion during self refresh.* Fixed tANPD checking during Power Down.* Removed dummy write from initialization sequence.* 5.01 JMK 04/28/06 Fixed Auto Precharge to Load Mode, Refresh and Self Refresh.* Removed Auto Precharge error message during Power Down Enter.* 5.10 JMK 07/26/06 Created internal clock using ck and ck_n.* RDQS can only be enabled in EMR for x8 configurations.* CAS latency is checked vs frequency when DLL locks.* tMOD changed from tCK units to ns units.* Added 50 Ohm setting for Rtt in EMR.* Improved checking of DQS during writes.* 5.20 JMK 10/02/06 Fixed DQS checking for interrupting write to write and x16.****************************************************************************************/// DO NOT CHANGE THE TIMESCALE// MAKE SURE YOUR SIMULATOR USES "PS" RESOLUTION`timescale 1ps / 1psmodule ddr2 ( ck, ck_n, cke, cs_n, ras_n, cas_n, we_n, dm_rdqs, ba, addr, dq, dqs, dqs_n, rdqs_n, odt);// `include "ddr2_parameters.vh"/****************************************************************************************
*
* Disclaimer This software code and all associated documentation, comments or other
* of Warranty: information (collectively "Software") is provided "AS IS" without
* warranty of any kind. MICRON TECHNOLOGY, INC. ("MTI") EXPRESSLY
* DISCLAIMS ALL WARRANTIES EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO, NONINFRINGEMENT OF THIRD PARTY RIGHTS, AND ANY IMPLIED WARRANTIES
* OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. MTI DOES NOT
* WARRANT THAT THE SOFTWARE WILL MEET YOUR REQUIREMENTS, OR THAT THE
* OPERATION OF THE SOFTWARE WILL BE UNINTERRUPTED OR ERROR-FREE.
* FURTHERMORE, MTI DOES NOT MAKE ANY REPRESENTATIONS REGARDING THE USE OR
* THE RESULTS OF THE USE OF THE SOFTWARE IN TERMS OF ITS CORRECTNESS,
* ACCURACY, RELIABILITY, OR OTHERWISE. THE ENTIRE RISK ARISING OUT OF USE
* OR PERFORMANCE OF THE SOFTWARE REMAINS WITH YOU. IN NO EVENT SHALL MTI,
* ITS AFFILIATED COMPANIES OR THEIR SUPPLIERS BE LIABLE FOR ANY DIRECT,
* INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES (INCLUDING,
* WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION,
* OR LOSS OF INFORMATION) ARISING OUT OF YOUR USE OF OR INABILITY TO USE
* THE SOFTWARE, EVEN IF MTI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGES. Because some jurisdictions prohibit the exclusion or
* limitation of liability for consequential or incidental damages, the
* above limitation may not apply to you.
*
* Copyright 2003 Micron Technology, Inc. All rights reserved.
*
****************************************************************************************/
// Timing parameters based on Speed Grade
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg25E parameter TCK_MIN = 2500; // tCK ps Minimum Clock Cycle Time parameter TJIT_PER = 100; // tJIT(per) ps Period JItter parameter TJIT_DUTY = 100; // tJIT(duty) ps Half Period Jitter parameter TJIT_CC = 200; // tJIT(cc) ps Cycle to Cycle jitter parameter TERR_2PER = 150; // tERR(nper) ps Accumulated Error (2-cycle) parameter TERR_3PER = 175; // tERR(nper) ps Accumulated Error (3-cycle) parameter TERR_4PER = 200; // tERR(nper) ps Accumulated Error (4-cycle) parameter TERR_5PER = 200; // tERR(nper) ps Accumulated Error (5-cycle) parameter TERR_N1PER = 300; // tERR(nper) ps Accumulated Error (6-10-cycle) parameter TERR_N2PER = 450; // tERR(nper) ps Accumulated Error (11-50-cycle) parameter TQHS = 300; // tQHS ps Data hold skew factor parameter TAC = 400; // tAC ps DQ output access time from CK/CK# parameter TDS = 50; // tDS ps DQ and DM input setup time relative to DQS parameter TDH = 125; // tDH ps DQ and DM input hold time relative to DQS parameter TDQSCK = 350; // tDQSCK ps DQS output access time from CK/CK# parameter TDQSQ = 200; // tDQSQ ps DQS-DQ skew, DQS to last DQ valid, per group, per access parameter TWPRE = 0.35; // tWPRE tCK DQS Write Preamble parameter TIS = 200; // tIS ps Input Setup Time parameter TIH = 275; // tIH ps Input Hold Time parameter TRC = 55000; // tRC ps Active to Active/Auto Refresh command time parameter TRCD = 12000; // tRCD ps Active to Read/Write command time parameter TWTR = 7500; // tWTR ps Write to Read command delay parameter TRP = 12500; // tRP ps Precharge command period parameter TXARDS = 8; // tXARDS tCK Exit low power active power down to a read command parameter CL_TIME = 12500; // CL ps Minimum CAS Latency`else `ifdef sg25 parameter TCK_MIN = 2500; // tCK ps Minimum Clock Cycle Time parameter TJIT_PER = 100; // tJIT(per) ps Period JItter parameter TJIT_DUTY = 100; // tJIT(duty) ps Half Period Jitter parameter TJIT_CC = 200; // tJIT(cc) ps Cycle to Cycle jitter parameter TERR_2PER = 150; // tERR(nper) ps Accumulated Error (2-cycle) parameter TERR_3PER = 175; // tERR(nper) ps Accumulated Error (3-cycle) parameter TERR_4PER = 200; // tERR(nper) ps Accumulated Error (4-cycle) parameter TERR_5PER = 200; // tERR(nper) ps Accumulated Error (5-cycle) parameter TERR_N1PER = 300; // tERR(nper) ps Accumulated Error (6-10-cycle) parameter TERR_N2PER = 450; // tERR(nper) ps Accumulated Error (11-50-cycle) parameter TQHS = 300; // tQHS ps Data hold skew factor parameter TAC = 400; // tAC ps DQ output access time from CK/CK# parameter TDS = 50; // tDS ps DQ and DM input setup time relative to DQS parameter TDH = 125; // tDH ps DQ and DM input hold time relative to DQS parameter TDQSCK = 350; // tDQSCK ps DQS output access time from CK/CK# parameter TDQSQ = 200; // tDQSQ ps DQS-DQ skew, DQS to last DQ valid, per group, per access parameter TWPRE = 0.35; // tWPRE tCK DQS Write Preamble parameter TIS = 200; // tIS ps Input Setup Time parameter TIH = 275; // tIH ps Input Hold Time parameter TRC = 55000; // tRC ps Active to Active/Auto Refresh command time parameter TRCD = 15000; // tRCD ps Active to Read/Write command time
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -