1
0
mirror of git://projects.qi-hardware.com/xue.git synced 2025-04-21 12:27:27 +03:00

unzipped 2 files

This commit is contained in:
Wolfgang Spraul
2010-12-19 01:38:43 +00:00
parent 12e7b3eabc
commit 29e7ceda7c
21 changed files with 7629 additions and 0 deletions

View File

@@ -0,0 +1,167 @@
/****************************************************************************************
*
* 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 2005 Micron Technology, Inc. All rights reserved.
*
*
* Revisions: baaab - 06/20/06 - tMRD was set to 2.0 ns but should be 2 * tCK. Fixed.
* Added ROW_BITS & BA_BITS for compatibility w/our system.
* Removed part size parameter.
*
****************************************************************************************/
// Parameters current with 1024Mb datasheet rev C (10/02/07)
// 04.17.08 - Consolidated 1024Mb and T48M designs; Updated to rev E (03/08)
// 12.10.08 - Updated to datasheet rev G (07/08)
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg5 // Timing Parameters for -5 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.40; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 40.0; // tRAS ns Active to Precharge command time
parameter tRC = 55.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 15.0; // tRCD ns Active to Read/Write command time
parameter tRP = 15.0; // tRP ns Precharge command period
parameter tRRD = 10.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 10.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
`else `ifdef sg54 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 58.2; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 16.2; // tRCD ns Active to Read/Write command time
parameter tRP = 16.2; // tRP ns Precharge command period
parameter tRRD = 10.8; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 10.8; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
`else `ifdef sg6 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.5; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 18.0; // tRCD ns Active to Read/Write command time
parameter tRP = 18.0; // tRP ns Precharge command period
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 12.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
`else `define sg75 // Timing Parameters for -75 (CL = 3)
parameter tAC3_max = 6.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.60; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 6.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 45.0; // tRAS ns Active to Precharge command time
parameter tRC = 75.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 22.5; // tRCD ns Active to Read/Write command time
parameter tRP = 22.5; // tRP ns Precharge command period
parameter tRRD = 15.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 15.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
`endif `endif `endif
parameter tAC2_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC3_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tLZ = 1.0; // tLZ ns Data-out low Z window from CK/CK#
parameter tMRD = 2.0; // tMRD tCK Load Mode Register command cycle time
parameter tRFC = 110.0; // tRFC ns Refresh to Refresh Command interval time
parameter tSRC = 1.0; // tSRC tCK SRR READ command to first valid command Note: model adds CL to this value
parameter tSRR = 2.0; // tSRR tCK SRR command to SRR READ command
parameter tWR = 15.0; // tWR ns Write recovery time
parameter tCH_MAX = 0.55; // Clk high level width
parameter tCH_MIN = 0.45; // Clk high level width
parameter tCL_MAX = 0.55; // Clk low level width
parameter tCL_MIN = 0.45; // Clk low level width
parameter tCKE = 1.0 ; // Minimum tCKE High/Low time (in tCK's)
parameter CL_MAX = 3 ; // Maximum CAS Latency
parameter BL_MAX = 16 ;
// Size Parameters based on Part Width
`ifdef x16
parameter ADDR_BITS = 14; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 14; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Set this parameter to control how many Bank bits are used
`else `define x32
`ifdef RP // reduced page mode
parameter ADDR_BITS = 14; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 14; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 13; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`endif
`endif
// For use with the Multi Chip Package
`ifdef DUAL_RANK
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 2; // Set this parameter to control how many Ranks on the mcp are used
`else
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 1; // Set this parameter to control how many Ranks on the mcp are used
`endif
parameter full_mem_bits = BA_BITS+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
parameter part_mem_bits = 10; // Set this parameter to control how many unique addresses are used
parameter part_size = 1024; // Set this parameter to indicate part size(1024Mb, 512Mb, 256Mb, 128Mb)

View File

@@ -0,0 +1,153 @@
/****************************************************************************************
*
* 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 2005 - 2006 Micron Technology, Inc. All rights reserved.
*
*
* Revisions: baaab - 06/20/06 - tMRD was set to 2.0 ns but should be 2 * tCK - fixed.
* Added ROW_BITS & BA_BITS for compatibility w/our system.
* Also changed Col bits from 10 to 9 per spec.
* Removed x32 option and part size parameter.
*
****************************************************************************************/
// Parameters current with 128Mb datasheet rev J (11/05)
// 04.17.08 - Parameters current with 128Mb Data sheet rev A (04/08)
// Timing parameters based on Speed Grade
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg5 // Timing Parameters for -5 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.40; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 40.0; // tRAS ns Active to Precharge command time
parameter tRC = 55.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 15.0; // tRCD ns Active to Read/Write command time
parameter tRP = 15.0; // tRP ns Precharge command period
parameter tRRD = 10.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 5.0; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `ifdef sg54 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 58.2; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 16.2; // tRCD ns Active to Read/Write command time
parameter tRP = 16.2; // tRP ns Precharge command period
parameter tRRD = 10.8; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 5.4; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `ifdef sg6 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.5; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.50; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 18.0; // tRCD ns Active to Read/Write command time
parameter tRP = 18.0; // tRP ns Precharge command period
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `define sg75 // Timing Parameters for -75 (CL = 3)
parameter tAC3_max = 6.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.60; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 6.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 45.0; // tRAS ns Active to Precharge command time
parameter tRC = 75.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 22.5; // tRCD ns Active to Read/Write command time
parameter tRP = 22.5; // tRP ns Precharge command period
parameter tRRD = 15.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 7.5; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`endif `endif `endif
parameter tAC2_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC3_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tLZ = 1.0; // tLZ ns Data-out low Z window from CK/CK#
parameter tMRD = 2.0; // tMRD tCK Load Mode Register command cycle time
parameter tRFC = 80.0; // tRFC ns Refresh to Refresh Command interval time
parameter tSRC = 1.0; // tSRC tCK SRR READ command to first valid command (Not Applicable for 128Mb, 256Mb Parts)
parameter tSRR = 2.0; // tSRR tCK SRR command to SRR READ command (Not Applicable for 128Mb, 256Mb Parts)
parameter tWR = 15.0; // tWR ns Write recovery time
// Size Parameters based on Part Width
`ifdef x16
parameter ADDR_BITS = 12; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 12; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else `define x32
parameter ADDR_BITS = 12; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 12; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 8; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`endif
// For use with the Multi Chip Package
`ifdef DUAL_RANK
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 2; // Set this parameter to control how many Ranks on the mcp are used
`else
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 1; // Set this parameter to control how many Ranks on the mcp are used
`endif
parameter full_mem_bits = BA_BITS+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
parameter part_mem_bits = 10; // Set this parameter to control how many unique addresses are used
parameter part_size = 128; // Set this parameter to indicate part size(512Mb, 256Mb, 128Mb)
parameter tCH_MAX = 0.55; // Clk high level width
parameter tCH_MIN = 0.45; // Clk high level width
parameter tCL_MAX = 0.55; // Clk low level width
parameter tCL_MIN = 0.45; // Clk low level width
parameter tCKE = 2.0; // Minimum tCKE High/Low time (in tCK's)
parameter CL_MAX = 3; // Maximum CAS Latency
parameter BL_MAX = 16 ;

View File

@@ -0,0 +1,179 @@
/****************************************************************************************
*
* 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 2005 Micron Technology, Inc. All rights reserved.
*
*
* Revisions: baaab - 06/20/06 - tMRD was set to 2.0 ns but should be 2 * tCK. Fixed.
* Added ROW_BITS & BA_BITS for compatibility w/our system.
* Removed part size parameter.
*
****************************************************************************************/
// Parameters current with 2048Mb LPDDR SDRAM
// 04.26.10 - Based on Rev 0.7 04/09EN (DDS)
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg5 // Timing Parameters for -5 (CL = 3)
parameter tAC3_max = 4.8; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 4.8; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 4.8; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.40; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 4.8; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 40.0; // tRAS ns Active to Precharge command time
parameter tRC = 55.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 14.4; // tRCD ns Active to Read/Write command time
parameter tRP = 14.4; // tRP ns Precharge command period
parameter tRRD = 10.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
parameter tWR = 14.4; // tWR ns Write recovery time
`else `ifdef sg54 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 41.8; // tRAS ns Active to Precharge command time
parameter tRC = 58.2; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 16.2; // tRCD ns Active to Read/Write command time
parameter tRP = 16.2; // tRP ns Precharge command period
parameter tRRD = 10.8; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
parameter tWR = 15.0; // tWR ns Write recovery time
`else `ifdef sg6 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.5; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 41.8; // tRAS ns Active to Precharge command time
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 18.0; // tRCD ns Active to Read/Write command time
parameter tRP = 18.0; // tRP ns Precharge command period
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
parameter tWR = 15.0; // tWR ns Write recovery time
`else `define sg75 // Timing Parameters for -75 (CL = 3)
parameter tAC3_max = 6.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.60; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 6.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 45.0; // tRAS ns Active to Precharge command time
parameter tRC = 67.5; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 22.5; // tRCD ns Active to Read/Write command time
parameter tRP = 22.5; // tRP ns Precharge command period
parameter tRRD = 15.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 7.50; // tXP ns Exit power-down to first valid cmd Note: spec'd as 2 * tCK
parameter tWR = 15.0; // tWR ns Write recovery time
`endif `endif `endif
parameter tAC2_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC3_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tLZ = 1.0; // tLZ ns Data-out low Z window from CK/CK#
parameter tMRD = 2.0; // tMRD tCK Load Mode Register command cycle time
parameter tRFC = 72.0; // tRFC ns Refresh to Refresh Command interval time
parameter tSRC = 1.0; // tSRC tCK SRR READ command to first valid command Note: model adds CL to this value
parameter tSRR = 2.0; // tSRR tCK SRR command to SRR READ command
parameter tCH_MAX = 0.55; // Clk high level width
parameter tCH_MIN = 0.45; // Clk high level width
parameter tCL_MAX = 0.55; // Clk low level width
parameter tCL_MIN = 0.45; // Clk low level width
parameter tCKE = 1.0 ; // Minimum tCKE High/Low time (in tCK's)
parameter CL_MAX = 3 ; // Maximum CAS Latency
parameter BL_MAX = 16 ;
// Size Parameters based on Part Width
`ifdef x16
`ifdef RP
parameter ADDR_BITS = 15; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 15; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Set this parameter to control how many Bank bits are used
`else
parameter ADDR_BITS = 14; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 14; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 11; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Set this parameter to control how many Bank bits are used
`endif
`else `define x32
`ifdef RP // reduced page mode
parameter ADDR_BITS = 15; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 15; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else
parameter ADDR_BITS = 14; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 14; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`endif
`endif
// For use with the Multi Chip Package
`ifdef DUAL_RANK
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 2; // Set this parameter to control how many Ranks on the mcp are used
`else
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 1; // Set this parameter to control how many Ranks on the mcp are used
`endif
parameter full_mem_bits = BA_BITS+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
parameter part_mem_bits = 10; // Set this parameter to control how many unique addresses are used
parameter part_size = 2048; // Set this parameter to indicate part size(1024Mb, 512Mb, 256Mb, 128Mb)

View File

@@ -0,0 +1,134 @@
/****************************************************************************************
*
* 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 2005 Micron Technology, Inc. All rights reserved.
*
*
* Revisions: baaab - 06/20/06 - tMRD was set to 2.0 ns but should be 2 * tCK. Fixed.
* Added ROW_BITS & BA_BITS for compatibility w/our system.
* Also changed x16 Col bits from 8 to 9 per spec.
* Removed part size parameter.
*
****************************************************************************************/
// Parameters current with 256Mb datasheet rev E (05/07)
// 04.17.08 - Parameters current with 256Mb Data sheet rev H (03/08)
// Timing parameters based on Speed Grade
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg6 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.50; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 18.0; // tRCD ns Active to Read/Write command time
parameter tRP = 18.0; // tRP ns Precharge command period
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
parameter tWR = 12.0; // tWR ns Write recovery time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd
`else `define sg75 // Timing Parameters for -75 (CL = 3)
parameter tAC3_max = 6.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.60; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 6.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 45.0; // tRAS ns Active to Precharge command time
parameter tRC = 75.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 22.5; // tRCD ns Active to Read/Write command time
parameter tRP = 22.5; // tRP ns Precharge command period
parameter tRRD = 15.0; // tRRD ns Active bank a to Active bank b command time
parameter tWR = 15.0; // tWR ns Write recovery time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 7.5; // tXP ns Exit power-down to first valid cmd
`endif
parameter tAC2_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC3_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tLZ = 1.0; // tLZ ns Data-out low Z window from CK/CK#
parameter tMRD = 2.0; // tMRD tCK Load Mode Register command cycle time
parameter tRFC = 70.0; // tRFC ns Refresh to Refresh Command interval time
parameter tSRC = 1.0; // tSRC tCK SRR READ command to first valid command (Not Applicable for 128Mb, 256Mb, and 512Mb Parts)
parameter tSRR = 2.0; // tSRR tCK SRR command to SRR READ command (Not Applicable for 128Mb, 256Mb, and 512Mb Parts)
// Size Parameters based on Part Width
`ifdef x16
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 13; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else `define x32
`ifdef RP
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 13; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 8; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else
parameter ADDR_BITS = 12; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 12; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`endif
`endif
// For use with the Multi Chip Package
`ifdef DUAL_RANK
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 2; // Set this parameter to control how many Ranks on the mcp are used
`else
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 1; // Set this parameter to control how many Ranks on the mcp are used
`endif
parameter full_mem_bits = BA_BITS+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
parameter part_mem_bits = 10; // For fast sim load
parameter part_size = 256; // Set this parameter to indicate part size(512Mb, 256Mb, 128Mb)
parameter tCH_MAX = 0.55; // Clk high level width
parameter tCH_MIN = 0.45; // Clk high level width
parameter tCL_MAX = 0.55; // Clk low level width
parameter tCL_MIN = 0.45; // Clk low level width
parameter tCKE = 2.0; // Minimum tCKE High/Low time (in tCK's)
parameter CL_MAX = 3; // Maximum CAS Latency
parameter BL_MAX = 16;

View File

@@ -0,0 +1,162 @@
/****************************************************************************************
*
* 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 2005 Micron Technology, Inc. All rights reserved.
*
*
* Revisions: baaab - 06/20/06 - tMRD was set to 2.0 ns but should be 2 * tCK. Fixed.
* Added ROW_BITS & BA_BITS for compatibility w/our system.
* Removed part size parameter.
*
****************************************************************************************/
// Parameters current with T47M datasheet rev M (07/07)
// 04.17.08 - Paramters current with 512Mb Data sheet rev C (03/08)
// Timing parameters based on Speed Grade
// SYMBOL UNITS DESCRIPTION
// ------ ----- -----------
`ifdef sg5 // Timing Parameters for -5 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.40; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 40.0; // tRAS ns Active to Precharge command time
parameter tRC = 55.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 15.0; // tRCD ns Active to Read/Write command time
parameter tRP = 15.0; // tRP ns Precharge command period
parameter tRRD = 10.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 10.0; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `ifdef sg54 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 5.4; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.45; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 59.4; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 16.2; // tRCD ns Active to Read/Write command time
parameter tRP = 16.2; // tRP ns Precharge command period
parameter tRRD = 10.8; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 10.8; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `ifdef sg6 // Timing Parameters for -6 (CL = 3)
parameter tAC3_max = 5.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 6.0; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.50; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 5.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 42.0; // tRAS ns Active to Precharge command time
parameter tRC = 60.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 18.0; // tRCD ns Active to Read/Write command time
parameter tRP = 18.0; // tRP ns Precharge command period
parameter tRRD = 12.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 2.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 6.0; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`else `define sg75 // Timing Parameters for -75 (CL = 3)
parameter tAC3_max = 6.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC2_max = 6.5; // tAC ns Access window of DQ from CK/CK#
parameter tCK = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK3_min = 7.5; // tCK ns Nominal Clock Cycle Time
parameter tCK2_min = 12.0; // tCK ns Nominal Clock Cycle Time
parameter tDQSQ = 0.60; // tDQSQ ns DQS-DQ skew, DQS to last DQ valid, per group, per access
parameter tHZ3_max = 6.0; // tHZ ns Data-out high Z window from CK/CK#
parameter tHZ2_max = 6.5; // tHZ ns Data-out high Z window from CK/CK#
parameter tRAS = 45.0; // tRAS ns Active to Precharge command time
parameter tRC = 75.0; // tRC ns Active to Active/Auto Refresh command time
parameter tRCD = 22.5; // tRCD ns Active to Read/Write command time
parameter tRP = 22.5; // tRP ns Precharge command period
parameter tRRD = 15.0; // tRRD ns Active bank a to Active bank b command time
parameter tWTR = 1.0; // tWTR tCK Internal Write-to-Read command delay
parameter tXP = 7.5; // tXP ns Exit power-down to first valid cmd *note: In data sheet this is specified as one clk, but min tck fails before tXP on the actual part
`endif `endif `endif
parameter tAC2_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tAC3_min = 2.0; // tAC ns Access window of DQ from CK/CK#
parameter tLZ = 1.0; // tLZ ns Data-out low Z window from CK/CK#
parameter tMRD = 2.0; // tMRD tCK Load Mode Register command cycle time
parameter tRFC = 97.5; // tRFC ns Refresh to Refresh Command interval time
parameter tSRC = 1.0; // tSRC tCK SRR READ command to first valid command (Not Applicable for 128Mb, 256Mb Parts)
parameter tSRR = 2.0; // tSRR tCK SRR command to SRR READ command (Not Applicable for 128Mb, 256Mb Parts)
parameter tWR = 15.0; // tWR ns Write recovery time
// Size Parameters based on Part Width
`ifdef x16
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 13; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 16; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 2; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 2; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 10; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else `define x32
`ifdef RP
parameter ADDR_BITS = 14; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 14; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 8; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`else
parameter ADDR_BITS = 13; // Set this parameter to control how many Address bits are used
parameter ROW_BITS = 13; // Set this parameter to control how many Row bits are used
parameter DQ_BITS = 32; // Set this parameter to control how many Data bits are used
parameter DQS_BITS = 4; // Set this parameter to control how many DQS bits are used
parameter DM_BITS = 4; // Set this parameter to control how many DM bits are used
parameter COL_BITS = 9; // Set this parameter to control how many Column bits are used
parameter BA_BITS = 2; // Bank bits
`endif
`endif
// For use with the Multi Chip Package
`ifdef DUAL_RANK
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 2; // Set this parameter to control how many Ranks on the mcp are used
`else
parameter CS_BITS = 2; // Set this parameter to control how many Chip Select bits are used
parameter RANKS = 1; // Set this parameter to control how many Ranks on the mcp are used
`endif
parameter full_mem_bits = BA_BITS+ADDR_BITS+COL_BITS; // Set this parameter to control how many unique addresses are used
parameter part_mem_bits = 10; // Set this parameter to control how many unique addresses are used
parameter part_size = 512; // Set this parameter to indicate part size(512Mb, 256Mb, 128Mb)
parameter tCH_MAX = 0.55; // Clk high level width
parameter tCH_MIN = 0.45; // Clk high level width
parameter tCL_MAX = 0.55; // Clk low level width
parameter tCL_MIN = 0.45; // Clk low level width
parameter tCKE = 1.0; // Minimum tCKE High/Low time (in tCK's)
parameter CL_MAX = 3; // Maximum CAS Latency
parameter BL_MAX = 16 ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,84 @@
/****************************************************************************************
*
* File Name: mobile_ddr_mcp.v
*
* Dependencies: mobile_ddr.v, mobile_ddr_parameters.vh
*
* Description: Micron MOBILE DDR SDRAM multi-chip package model
*
* 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 2008 Micron Technology, Inc. All rights reserved.
*
****************************************************************************************/
`timescale 1ns / 1ps
module mobile_ddr_mcp (
Clk ,
Clk_n ,
Cke ,
Cs_n ,
Ras_n ,
Cas_n ,
We_n ,
Addr ,
Ba ,
Dq ,
Dqs ,
Dm
);
`include "mobile_ddr_parameters.vh"
// Declare Ports
input Clk ;
input Clk_n ;
input [CS_BITS - 1 : 0] Cke ;
input [CS_BITS - 1 : 0] Cs_n ;
input Ras_n ;
input Cas_n ;
input We_n ;
input [ADDR_BITS - 1 : 0] Addr ;
input [1 : 0] Ba ;
inout [DQ_BITS - 1 : 0] Dq ;
inout [DQS_BITS - 1 : 0] Dqs ;
input [DM_BITS - 1 : 0] Dm ;
wire [RANKS - 1 : 0] Cke_mcp = Cke ;
wire [RANKS - 1 : 0] Cs_n_mcp = Cs_n ;
mobile_ddr rank [RANKS - 1:0] (
.Clk ( Clk ) ,
.Clk_n ( Clk_n ) ,
.Cke ( Cke_mcp ) ,
.Cs_n ( Cs_n_mcp ) ,
.Ras_n ( Ras_n ) ,
.Cas_n ( Cas_n ) ,
.We_n ( We_n ) ,
.Addr ( Addr ) ,
.Ba ( Ba ) ,
.Dq ( Dq ) ,
.Dqs ( Dqs ) ,
.Dm ( Dm )
);
endmodule

View File

@@ -0,0 +1,167 @@
Disclaimer of Warranty:
-----------------------
This software code and all associated documentation, comments or other
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 2008 Micron Technology, Inc. All rights reserved.
Getting Started:
----------------
Unzip the included files to a folder.
Compile mobile_ddr.v and tb.v using a verilog simulator.
Simulate the top level test bench tb.
Or, if you are using the ModelSim simulator, type "do tb.do" at the prompt.
File Descriptions:
------------------
mobile_ddr.v --mobile ddr model
mobile_ddr_mcp.v --structural wrapper for mobile_ddr multi-chip package model
128Mb_mobile_ddr_parameters.vh --File that contains all parameters used by the model
256Mb_mobile_ddr_parameters.vh --File that contains all parameters used by the model
512Mb_mobile_ddr_parameters.vh --File that contains all parameters used by the model
1024Mb_mobile_ddr_parameters.vh --File that contains all parameters used by the model
2048Mb_mobile_ddr_parameters.vh --File that contains all parameters used by the model
readme.txt --This file
tb.v --Test bench
tb.do --File that compiles and runs the above files
Defining the Density (part size):
-------------------------
The verilog compiler directive "`define" may be used to choose between on of the
densities supported by the mobile ddr model. Allowable densities are listed in
the *.vh file. The density is used to select a set of bank, row, column, and timing
parameters for the mobile ddr model. The following are examples of defining
the density.
simulator command line
--------- ------------
ModelSim vlog +define+den512Mb mobile_ddr.v
VCS vcs +define+den512Mb mobile_ddr.v
NC-Verilog ncverilog +define+den512Mb mobile_ddr.v
Defining the Speed Grade:
-------------------------
The verilog compiler directive "`define" may be used to choose between
multiple speed grades supported by the mobile ddr model. Allowable speed
grades are listed in the mobile_ddr_parameters.vh file and begin with the
letters "sg". The speed grade is used to select a set of timing
parameters for the mobile ddr model. The following are examples of defining
the speed grade.
simulator command line
--------- ------------
ModelSim vlog +define+sg75 mobile_ddr.v
VCS vcs +define+sg75 mobile_ddr.v
NC-Verilog ncverilog +define+sg75 mobile_ddr.v
Defining the Organization:
--------------------------
The verilog compiler directive "`define" may be used to choose between
multiple organizations supported by the mobile ddr model. Valid
organizations include "x16" and "x32", and are listed in the
mobile_ddr_parameters.vh file. The organization is used to select the amount
of memory and the port sizes of the mobile ddr model. The following are
examples of defining the organization.
vlog +define+x16 mobile_ddr.v
simulator command line
--------- ------------
ModelSim vlog +define+x16 mobile_ddr.v
VCS vcs +define+x16 mobile_ddr.v
NC-Verilog ncverilog +define+x16 mobile_ddr.v
All combinations of speed grade and organization are considered valid
by the mobile ddr model even though a Micron part may not exist for every
combination.
Allocating Memory:
------------------
An associative array has been implemented to reduce the amount of
static memory allocated by the mobile ddr model. The number of
entries in the associative array is controlled by the part_mem_bits
parameter, and is equal to 2^part_mem_bits. For example, if the
part_mem_bits parameter is equal to 10, the associative array will be
large enough to store 1024 write data transfers to unique addresses.
The following are examples of setting the MEM_BITS parameter to 8.
simulator command line
--------- ------------
ModelSim vsim -Gpart_mem_bits=8 mobile_ddr
VCS vcs -pvalue+part_mem_bits=8 mobile_ddr.v
NC-Verilog ncverilog +defparam+mobile_ddr.part_mem_bits=8 mobile_ddr.v
It is possible to allocate memory for every address supported by the
mobile ddr model by using the verilog compiler directive "`define FULL_MEM".
This procedure will improve simulation performance at the expense of
system memory. The following are examples of allocating memory for
every address.
Simulator command line
--------- ------------
ModelSim vlog +define+FULL_MEM mobile_ddr.v
VCS vcs +define+FULL_MEM mobile_ddr.v
NC-Verilog ncverilog +define+FULL_MEM mobile_ddr.v
Reduced Page Mode:
------------------
Mobile DDR 256Mb, 512Mb, and 1024Mb part may be built with the reduced page size
architecture. This part is accessed with the +define+RP designator. RP
parts have one extra row bit and one less column bit effectively cutting
the page size in half but doubling the number of rows keeping total part
size the same.
Part Size Valid RP Designators
--------- --------------------
256Mb +define+RP
512Mb +define+RP
1024Mb +define+RP
Simulator command line
--------- ------------
ModelSim vlog +define+RP mobile_ddr.v
VCS vcs +define+RP mobile_ddr.v
NC-Verilog ncverilog +define+RP mobile_ddr.v
Multi-Chip Package Model:
-------------------------
The 1024Mb model can be supported in a Multi Chip Package, that allows
multiple die models in one structural package. The number of ranks and
chip selects of the mcp can be configured by using the `DUAL_RANK define
on the simulator call line. The currently supported configurations are
listed below:
Package Configuration Valid MCP Designator
--------------------- --------------------
2 Chip Selects, 2 Die +define+DUAL_RANK
2 Chip Selects, 1 Die (default)
The single rank mcp is the default. In order to simulate the DUAL_RANK
model, the define needs to be added:
Simulator command line
--------- ------------
ModelSim vlog +define+DUAL_RANK mobile_ddr.v mobile_ddr_mcp.v
VCS vcs +define+DUAL_RANK mobile_ddr.v mobile_ddr_mcp.v
NC-Verilog ncverilog +define+DUAL_RANK mobile_ddr.v mobile_ddr_mcp.v

View File

@@ -0,0 +1,32 @@
initial begin:test
//ck <= 1'b0;
cke <= 1'b0;
cs_n <= 1'bz;
ras_n <= 1'bz;
cas_n <= 1'bz;
we_n <= 1'bz;
a <= {ADDR_BITS{1'bz}};
ba <= {BA_BITS{1'bz}};
dq_en <= 1'b0;
dqs_en <= 1'b0;
power_up;
nop (10); // wait 10 clocks intead of 200 us for simulation purposes
precharge('h00000000, 1);
nop(trp);
refresh;
nop(trfc);
refresh;
nop(trfc);
load_mode('h0, 'h00000032);
nop(tmrd);
load_mode('h2, 'h00004000);
nop(tmrd);
activate('h00000000, 'h00000000);
nop(trcd-1);
write('h00000000, 'h00000000, 0, { {DM_BITS{1'b0}}, {DM_BITS{1'b0}}, {DM_BITS{1'b0}}, {DM_BITS{1'b0}}}, { 16'h3000, 16'h2000, 16'h1000, 16'h0});
nop(bl/2+twr);
read('h00000000, 'h00000000, 1);
nop(bl/2-1);
nop('h00000014);
test_done;
end

View File

@@ -0,0 +1,39 @@
#########################################################################################
#
# 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 2005 Micron Technology, Inc. All rights reserved.
#
#########################################################################################
vlib work
vlog +define+den512Mb +define+sg75 +define+x16 mobile_ddr.v tb.v
vsim tb
add wave -p mobile_ddr/*
run -a
# For Reduced Page Parts run the following and comment out the lines above :
#vlog +define+den512Mb +define+sg75 +define+x32 mobile_ddr.v tb.v
#vsim tb
#add wave -p mobile_ddr/*
#run -a

View File

@@ -0,0 +1,587 @@
/****************************************************************************************
*
* File Name: tb.v
* Version: 6.00
* Model: BUS Functional
*
* Dependencies: mobile_ddr.v, mobile_ddr_parameters.vh, subtest.vh
*
* Description: Micron SDRAM DDR (Double Data Rate) test bench
*
* 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
* --- ------ ---------- ---------------------------------------
* 4.1 JMK 01/14/2001 -Grouped specify parameters by speed grade
* -Fixed mem_sizes parameter
* 2.1 SPH 03/19/2002 -Second Release
* -Fix tWR and several incompatability
* between different simulators
* 3.0 TFK 02/18/2003 -Added tDSS and tDSH timing checks.
* -Added tDQSH and tDQSL timing checks.
* 3.1 CAH 05/28/2003 -update all models to release version 3.1
* (no changes to this model)
* 3.2 JMK 06/16/2003 -updated all DDR400 models to support CAS Latency 3
* 3.3 JMK 09/11/2003 -Added initialization sequence checks.
* 4.0 JMK 12/01/2003 -Grouped parameters into "ddr_parameters.v"
* -Fixed tWTR check
* 4.2 JMK 03/19/2004 -Fixed pulse width checking on dqs
* 4.3 JMK 04/27/2004 -Changed bl wire size in tb module
* -Changed Dq_buf size to [15:0]
* 5.0 JMK 06/16/2004 -Added read to write checking.
* -Added read with precharge truncation to write checking.
* -Added associative memory array to reduce memory consumption.
* -Added checking for required DQS edges during write.
* 6.0 DMR 12/03/2004 -new density
* 6.01 BAAB 05/18/2006 -assimilating into Minneapolis site organization
* 3.11 BAS 10/18/2006 -added read_verify
* 3.35 bas 02/28/07 -mobile_ddr.v file uses tAC correctly to calculate strobe/data launch
* 3.36 bas 03/05/07 -fixed error messages for different banks interrupting
reads/writes w/autoprecharge
* 3.37 bas 03/21/07 -added T47M part for 512Mb in parameters file,
modified tXP check to measure in tCLK for T47M
* 3.60 clk 09/19/07 -fixed dm/dq verification fifo's
* 3.60 clk 09/19/07 -fixed dqrx module delay statement
* 3.80 clk 10/29/07 - Support for 1024Mb T48M
* 4.00 clk 12/30/07 - Fixed Read terminated by precharge testcase
* 4.70 clk 03/30/08 - Fixed typo in SRR code
* 4.80 clk 04/03/08 - Disable clk checking during initialization
* 4.90 clk 04/16/08 - Fixed tInit, added mpc support, updated t35m timing
* 5.00 clk 05/14/08 - Fixed back to back auto precharge commands
* 5.20 clk 05/21/08 - Fixed read interrupt by pre (BL8), fixed 1024Mb parameter file
* 5.30 clk 05/22/08 - Fixed DM signal which cause false tWTR errors
05/27/08 - Rewrote write and read pipelins, strobes
* 5.40 clk 05/28/08 - Fixed Addressing problem in Burst Order logic
* 5.50 clk 07/25/08 - Added T36N part type
* 5.60 clk 09/05/08 - Fixed tXP in 256Mb part type
* 5.70 clk 09/17/08 - Fixed burst term check for write w/ all DM active
* 5.80 clk 11/18/08 - Fixed internally latched dq & mask widths
* 5.90 clk 12/10/08 - Updated T36N parameters to latest datasheet
* 6.00 clk 03/05/09 - Fixed DQS problem w/ CL = 2
****************************************************************************************/
`timescale 1ns / 1ps
module tb;
`ifdef den128Mb
`include "128Mb_mobile_ddr_parameters.vh"
`elsif den256Mb
`include "256Mb_mobile_ddr_parameters.vh"
`elsif den512Mb
`include "512Mb_mobile_ddr_parameters.vh"
`elsif den1024Mb
`include "1024Mb_mobile_ddr_parameters.vh"
`elsif den2048Mb
`include "2048Mb_mobile_ddr_parameters.vh"
`else
// NOTE: Intentionally cause a compile fail here to force the users
// to select the correct component density before continuing
ERROR: You must specify component density with +define+den____Mb.
`endif
reg ck_tb ;
reg ck_enable = 1'b1 ;
// ports
wire ck;
wire ck_n = ~ck;
reg cke = 1'b0;
reg cs_n;
reg ras_n;
reg cas_n;
reg we_n;
reg [BA_BITS-1:0] ba;
reg [ADDR_BITS-1:0] a;
wire [DM_BITS-1:0] dm;
wire [DQ_BITS-1:0] dq;
wire [DQS_BITS-1:0] dqs;
// mode registers
reg [ADDR_BITS-1:0] mode_reg0; //Mode Register
reg [ADDR_BITS-1:0] mode_reg1; //Extended Mode Register
wire [2:0] cl = mode_reg0[6:4]; //CAS Latency
wire bo = mode_reg0[3]; //Burst Order
wire [7:0] bl = (1<<mode_reg0[2:0]); //Burst Length
wire wl = 1; //Write Latency
// dq transmit
reg dq_en;
reg [DM_BITS-1:0] dm_out;
reg [DQ_BITS-1:0] dq_out;
reg dqs_en;
reg [DQS_BITS-1:0] dqs_out;
assign dm = dq_en ? dm_out : {DM_BITS{1'b0}};
assign dq = dq_en ? dq_out : {DQ_BITS{1'bz}};
assign dqs = dqs_en ? dqs_out : {DQS_BITS{1'bz}};
// dq receive
reg [DM_BITS-1:0] dm_fifo [2*CL_MAX+16:0];
reg [DQ_BITS-1:0] dq_fifo [2*CL_MAX+16:0];
wire [DQ_BITS-1:0] q0, q1, q2, q3;
reg ptr_rst_n;
reg [1:0] burst_cntr;
// timing definition in tCK units
real tck;
wire [11:0] trc = tRC;
wire [11:0] trrd = ceil(tRRD/tck);
wire [11:0] trcd = ceil(tRCD/tck);
wire [11:0] tras = ceil(tRAS/tck);
wire [11:0] twr = ceil(tWR/tck);
wire [11:0] trp = ceil(tRP/tck);
wire [11:0] tmrd = tMRD;
wire [11:0] trfc = ceil(tRFC/tck);
wire [11:0] tsrr = ceil(tSRR);
wire [11:0] tsrc = ceil(tSRC);
wire [11:0] tdqsq = tDQSQ;
wire [11:0] twtr = tWTR;
initial begin
$timeformat (-9, 1, " ns", 1);
`ifdef period
tck <= `period;
`else
tck <= tCK;
`endif
ck_tb <= 1'b1;
dq_en <= 1'b0;
dqs_en <= 1'b0;
end
// component instantiation
mobile_ddr mobile_ddr (
.Clk ( ck ) ,
.Clk_n ( ck_n ) ,
.Cke ( cke ) ,
.Cs_n ( cs_n ) ,
.Ras_n ( ras_n ) ,
.Cas_n ( cas_n ) ,
.We_n ( we_n ) ,
.Addr ( a ) ,
.Ba ( ba ) ,
.Dq ( dq ) ,
.Dqs ( dqs ) ,
.Dm ( dm )
);
// clock generator
assign ck = ck_enable & ck_tb ;
always @(posedge ck_tb) begin
ck_tb <= #(tck/2) 1'b0;
ck_tb <= #(tck) 1'b1;
end
function integer ceil;
input number;
real number;
if (number > $rtoi(number))
ceil = $rtoi(number) + 1;
else
ceil = number;
endfunction
function integer max;
input arg1;
input arg2;
integer arg1;
integer arg2;
if (arg1 > arg2)
max = arg1;
else
max = arg2;
endfunction
function [8*DQ_BITS-1:0] burst_order;
input [8-1:0] col;
input [8*DQ_BITS-1:0] dq;
reg [3:0] i;
reg [2:0] j;
integer k;
begin
burst_order = dq;
for (i=0; i<bl; i=i+1) begin
j = ((col%bl) ^ i);
if (!bo)
j[1:0] = (col + i);
for (k=0; k<DQ_BITS; k=k+1) begin
burst_order[i*DQ_BITS + k] = dq[j*DQ_BITS + k];
end
end
end
endfunction
task power_up;
begin
cke <= 1'b0;
cs_n <= 1'b1;
ras_n <= 1'b1;
cas_n <= 1'b1;
we_n <= 1'b1;
ba <= {BA_BITS{1'b0}};
a <= {ADDR_BITS{1'b0}};
repeat(10) @(negedge ck_tb);
@ (negedge ck_tb) cke <= 1'b1;
$display ("%m at time %t TB: A 200 us delay is required after cke is brought high.", $time);
end
endtask
task stop_clock_enter ;
begin
@ (negedge ck_tb);
ck_enable = 1'b0 ;
end
endtask
task stop_clock_exit ;
begin
@ (negedge ck_tb);
ck_enable = 1'b1 ;
end
endtask
task load_mode;
input [BA_BITS-1:0] bank;
input [ROW_BITS-1:0] row;
begin
case (bank)
0: mode_reg0 = row;
1: mode_reg1 = row;
endcase
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b0;
cas_n <= 1'b0;
we_n <= 1'b0;
ba <= bank;
a <= row;
@(negedge ck_tb);
end
endtask
task refresh;
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b0;
cas_n <= 1'b0;
we_n <= 1'b1;
@(negedge ck_tb);
end
endtask
task precharge;
input [BA_BITS-1:0] bank;
input ap; //precharge all
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b0;
cas_n <= 1'b1;
we_n <= 1'b0;
ba <= bank;
a <= (ap<<10);
@(negedge ck_tb);
end
endtask
task activate;
input [BA_BITS-1:0] bank;
input [ROW_BITS-1:0] row;
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b0;
cas_n <= 1'b1;
we_n <= 1'b1;
ba <= bank;
a <= row;
@(negedge ck_tb);
end
endtask
//write task supports burst lengths <= 8
task write;
input [BA_BITS-1:0] bank;
input [COL_BITS-1:0] col;
input ap; //Auto Precharge
input [16*DM_BITS-1:0] dm;
input [16*DQ_BITS-1:0] dq;
reg [ADDR_BITS-1:0] atemp [1:0];
integer i;
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b1;
cas_n <= 1'b0;
we_n <= 1'b0;
ba <= bank;
atemp[0] = col & 10'h3ff; //addr[ 9: 0] = COL[ 9: 0]
atemp[1] = (col>>10)<<11; //addr[ N:11] = COL[ N:10]
a <= atemp[0] | atemp[1] | (ap<<10);
for (i=0; i<=bl; i=i+1) begin
dqs_en <= #(wl*tck + i*tck/2) 1'b1;
if (i%2 == 0) begin
dqs_out <= #(wl*tck + i*tck/2) {DQS_BITS{1'b0}};
end else begin
dqs_out <= #(wl*tck + i*tck/2) {DQS_BITS{1'b1}};
end
dq_en <= #(wl*tck + i*tck/2 + tck/4) 1'b1;
dm_out <= #(wl*tck + i*tck/2 + tck/4) dm>>i*DM_BITS;
dq_out <= #(wl*tck + i*tck/2 + tck/4) dq>>i*DQ_BITS;
end
dqs_en <= #(wl*tck + bl*tck/2 + tck/2) 1'b0;
dq_en <= #(wl*tck + bl*tck/2 + tck/4) 1'b0;
@(negedge ck_tb);
end
endtask
// read without data verification
task read;
input [BA_BITS-1:0] bank;
input [COL_BITS-1:0] col;
input ap; //Auto Precharge
reg [ADDR_BITS-1:0] atemp [1:0];
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b1;
cas_n <= 1'b0;
we_n <= 1'b1;
ba <= bank;
atemp[0] = col & 10'h3ff; //addr[ 9: 0] = COL[ 9: 0]
atemp[1] = (col>>10)<<11; //addr[ N:11] = COL[ N:10]
a <= atemp[0] | atemp[1] | (ap<<10);
@(negedge ck_tb);
end
endtask
task burst_term;
integer i;
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b1;
cas_n <= 1'b1;
we_n <= 1'b0;
@(negedge ck_tb);
for (i=0; i<bl; i=i+1) begin
dm_fifo[2*cl + i] <= {DM_BITS{1'bx}};
dq_fifo[2*cl + i] <= {DQ_BITS{1'bx}};
end
end
endtask
task nop;
input [31:0] count;
begin
cke <= 1'b1;
cs_n <= 1'b0;
ras_n <= 1'b1;
cas_n <= 1'b1;
we_n <= 1'b1;
repeat(count) @(negedge ck_tb);
end
endtask
task deselect;
input [31:0] count;
begin
cke <= 1'b1;
cs_n <= 1'b1;
// ras_n <= 1'b1;
// cas_n <= 1'b1;
// we_n <= 1'b1;
repeat(count) @(negedge ck_tb);
end
endtask
task power_down;
input [31:0] count;
begin
cke <= 1'b0;
cs_n <= 1'b1;
ras_n <= 1'b1;
cas_n <= 1'b1;
we_n <= 1'b1;
repeat(count) @(negedge ck_tb);
end
endtask
task deep_power_down;
input [31:0] count;
begin
cke <= 1'b0;
cs_n <= 1'b0;
ras_n <= 1'b1;
cas_n <= 1'b1;
we_n <= 1'b0;
repeat(count) @(negedge ck_tb);
end
endtask
task self_refresh;
input [31:0] count;
begin
cke <= 1'b0;
cs_n <= 1'b0;
ras_n <= 1'b0;
cas_n <= 1'b0;
we_n <= 1'b1;
repeat(count) @(negedge ck_tb);
end
endtask
// read with data verification
task read_verify;
input [BA_BITS-1:0] bank;
input [COL_BITS-1:0] col;
input ap; //Auto Precharge
input [16*DM_BITS-1:0] dm; //Expected Data Mask
input [16*DQ_BITS-1:0] dq; //Expected Data
integer i;
begin
read (bank, col, ap);
for (i=0; i<bl; i=i+1) begin
dm_fifo[2*cl + i] <= dm>>(i*DM_BITS);
dq_fifo[2*cl + i] <= dq>>(i*DQ_BITS);
end
end
endtask
// receiver(s) for data_verify process
dqrx dqrx[DQS_BITS-1:0] (ptr_rst_n, dqs, dq, q0, q1, q2, q3);
// perform data verification as a result of read_verify task call
reg [DQ_BITS-1:0] bit_mask;
reg [DM_BITS-1:0] dm_temp;
reg [DQ_BITS-1:0] dq_temp;
always @(ck) begin:data_verify
integer i;
integer j;
for (i=!ck; (i<2/(2.0 - !ck)); i=i+1) begin
if (dm_fifo[i] === {DM_BITS{1'bx}}) begin
burst_cntr = 0;
end else begin
dm_temp = dm_fifo[i];
for (j=0; j<DQ_BITS; j=j+1) begin
bit_mask[j] = !dm_temp[j/(DQ_BITS/DM_BITS)];
end
case (burst_cntr)
0: dq_temp = q0;
1: dq_temp = q1;
2: dq_temp = q2;
3: dq_temp = q3;
endcase
//if ( ((dq_temp & bit_mask) === (dq_fifo[i] & bit_mask)))
// $display ("%m at time %t: INFO: Successful read data compare. Expected = %h, Actual = %h, Mask = %h, i = %d", $time, dq_fifo[i], dq_temp, bit_mask, burst_cntr);
if ((dq_temp & bit_mask) !== (dq_fifo[i] & bit_mask))
$display ("%m at time %t: ERROR: Read data miscompare. Expected = %h, Actual = %h, Mask = %h, i = %d", $time, dq_fifo[i], dq_temp, bit_mask, burst_cntr);
burst_cntr = burst_cntr + 1;
end
end
if (ck_tb) begin
ptr_rst_n <= (dm_fifo[4] !== {DM_BITS{1'bx}});
end else begin
//ptr_rst_n <= ptr_rst_n & (dm_fifo[6] !== {DM_BITS{1'bx}});
for (i=0; i<=2*CL_MAX+16; i=i+1) begin
dm_fifo[i] = dm_fifo[i+2];
dq_fifo[i] = dq_fifo[i+2];
end
end
end
// End-of-test triggered in 'subtest.vh'
task test_done;
begin
$display ("%m at time %t: INFO: Simulation is Complete", $time);
$stop(0);
end
endtask
// Test included from external file
`include "subtest.vh"
endmodule
module dqrx (
ptr_rst_n, dqs, dq, q0, q1, q2, q3
);
`ifdef den128Mb
`include "128Mb_mobile_ddr_parameters.vh"
`elsif den256Mb
`include "256Mb_mobile_ddr_parameters.vh"
`elsif den512Mb
`include "512Mb_mobile_ddr_parameters.vh"
`elsif den1024Mb
`include "1024Mb_mobile_ddr_parameters.vh"
`elsif den2048Mb
`include "2048Mb_mobile_ddr_parameters.vh"
`else
// NOTE: Intentionally cause a compile fail here to force the users
// to select the correct component density before continuing
ERROR: You must specify component density with +define+den____Mb.
`endif
input ptr_rst_n;
input dqs;
input [DQ_BITS/DQS_BITS-1:0] dq;
output [DQ_BITS/DQS_BITS-1:0] q0;
output [DQ_BITS/DQS_BITS-1:0] q1;
output [DQ_BITS/DQS_BITS-1:0] q2;
output [DQ_BITS/DQS_BITS-1:0] q3;
reg [1:0] ptr;
reg [DQ_BITS/DQS_BITS-1:0] q [3:0];
reg ptr_rst_dly_n;
always @(posedge ptr_rst_n) ptr_rst_dly_n <= #(tAC2_min + tDQSQ) ptr_rst_n;
always @(negedge ptr_rst_n) ptr_rst_dly_n <= #(tAC2_max + tDQSQ + 0.002) ptr_rst_n;
reg dqs_dly;
always @(dqs) dqs_dly <= #(tDQSQ + 0.001) dqs;
always @(negedge ptr_rst_dly_n or posedge dqs_dly or negedge dqs_dly) begin
if (!ptr_rst_dly_n) begin
ptr <= 0;
end else if (dqs_dly || ptr) begin
q[ptr] <= dq;
ptr <= ptr + 1;
end
end
assign q0 = q[0];
assign q1 = q[1];
assign q2 = q[2];
assign q3 = q[3];
endmodule