/**************************************************************************************** * * File Name: subtest.vh * * Description: Micron SDRAM DDR3 (Double Data Rate 3) * This file is included by tb.v * * 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. * ****************************************************************************************/ initial begin : test parameter [31:0] REP = DQ_BITS/8.0; reg [BA_BITS-1:0] r_bank; reg [ROW_BITS-1:0] r_row; reg [COL_BITS-1:0] r_col; reg [BL_MAX*DQ_BITS-1:0] r_data; integer r_i, r_j; real original_tck; reg [8*DQ_BITS-1:0] d0, d1, d2, d3; d0 = { {REP{8'h07}}, {REP{8'h06}}, {REP{8'h05}}, {REP{8'h04}}, {REP{8'h03}}, {REP{8'h02}}, {REP{8'h01}}, {REP{8'h00}} }; d1 = { {REP{8'h17}}, {REP{8'h16}}, {REP{8'h15}}, {REP{8'h14}}, {REP{8'h13}}, {REP{8'h12}}, {REP{8'h11}}, {REP{8'h10}} }; d2 = { {REP{8'h27}}, {REP{8'h26}}, {REP{8'h25}}, {REP{8'h24}}, {REP{8'h23}}, {REP{8'h22}}, {REP{8'h21}}, {REP{8'h20}} }; d3 = { {REP{8'h37}}, {REP{8'h36}}, {REP{8'h35}}, {REP{8'h34}}, {REP{8'h33}}, {REP{8'h32}}, {REP{8'h31}}, {REP{8'h30}} }; rst_n <= 1'b0; cke <= 1'b0; cs_n <= 1'b1; ras_n <= 1'b1; cas_n <= 1'b1; we_n <= 1'b1; ba <= {BA_BITS{1'bz}}; a <= {ADDR_BITS{1'bz}}; odt_out <= 1'b0; dq_en <= 1'b0; dqs_en <= 1'b0; // POWERUP SECTION power_up; // INITIALIZE SECTION zq_calibration (1); // perform Long ZQ Calibration load_mode (3, 14'b00000000000000); // Extended Mode Register (3) nop (tmrd-1); load_mode (2, {14'b00001000_000_000} | mr_cwl<<3); // Extended Mode Register 2 with DCC Disable nop (tmrd-1); load_mode (1, 14'b0000010110); // Extended Mode Register with DLL Enable, AL=CL-1 nop (tmrd-1); load_mode (0, {14'b0_0_000_1_0_000_1_0_00} | mr_wr<<9 | mr_cl<<2); // Mode Register with DLL Reset nop (max(TDLLK,TZQINIT)); odt_out <= 1; // turn on odt nop (10); // Random Act -> Write -> Read -> Precharge for (r_i = 0; r_i < 2048; r_i = r_i + 1) begin r_bank = $urandom_range (8); r_row = $urandom_range (1<