⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cal_top.v

📁 XILINX memory interface generator. XILINX的外部存储器接口。
💻 V
字号:
//*****************************************************************************************
//**
//**  www.xilinx.com               Copyright (c) 1984-2004 Xilinx, Inc. All rights reserved
//** 
//**  QDR(tm)-II SRAM Virtex(tm)-II Interface                         Verilog instanciation
//**
//*****************************************************************************************
//**
//**  Disclaimer: LIMITED WARRANTY AND DISCLAMER. These designs are 
//**              provided to you \"as is\". Xilinx and its licensors make and you 
//**              receive no warranties or conditions, express, implied, statutory 
//**              or otherwise, and Xilinx specifically disclaims any implied 
//**              warranties of merchantability, non-infringement, or fitness for a 
//**              particular purpose. Xilinx does not warrant that the functions 
//**              contained in these designs will meet your requirements, or that the
//**              operation of these designs will be uninterrupted or error free, or 
//**              that defects in the Designs will be corrected. Furthermore, Xilinx 
//**              does not warrant or make any representations regarding use or the 
//**              results of the use of the designs in terms of correctness, accuracy, 
//**              reliability, or otherwise. 
//**
//**              LIMITATION OF LIABILITY. In no event will Xilinx or its licensors be 
//**              liable for any loss of data, lost profits, cost or procurement of 
//**              substitute goods or services, or for any special, incidental, 
//**              consequential, or indirect damages arising from the use or operation 
//**              of the designs or accompanying documentation, however caused and on 
//**              any theory of liability. This limitation will apply even if Xilinx 
//**              has been advised of the possibility of such damage. This limitation 
//**              shall apply not-withstanding the failure of the essential purpose of 
//**              any limited remedies herein. 
//**
//*****************************************************************************************

// Top level for calibration circuit.
//  - instantiate DCM, calib control, and ckt to calibrate

`timescale 1ns/100ps

`define noMuxF5 1'b1


module cal_top(
	       clk,
	       clk0,
	       clk0dcmlock,
	       reset,
	       okToSelTap,
	       tapForDqs
               );
               
   input          clk;
   input          clk0;
   input 	  clk0dcmlock;
   input 	  reset;
   input 	  okToSelTap;
   
   output [4:0]   tapForDqs;
   
   wire 	  reset;
   wire 	  phShftClk;
   wire 	  phShftClkDcm;
   wire 	  psInc;
   wire 	  psEn;
   wire 	  dcmlocked;
   wire 	  psDone;
   wire 	  hexClk;
   wire 	  clkDiv2/* synthesis syn_keep = 1 */;
   wire 	  phClkDiv2/* synthesis syn_keep = 1 */;
   wire       suClkDiv2/* synthesis syn_keep = 1 */;
   wire       suPhClkDiv2/* synthesis syn_keep = 1 */;


   wire [4:0] 	  selTap;
   wire [4:0] 	  tapForDqs;
   wire [3:0] 	  state;
   wire 	  locReset;
   wire 	  hxSamp1;
   
   wire 	  clk0;//signals added for additional dcm

   reg 	  fpga_rst;//
   
   
   // synopsys translate_off
   // Attributes for RTL simulation
   defparam cal_dcm.CLKOUT_PHASE_SHIFT = "VARIABLE" ;
   //defparam cal_dcm.PHASE_SHIFT = 0 ;
   // defparam cal_dcm.CLKDV_DIVIDE = 4.0 ;
   defparam cal_dcm.DLL_FREQUENCY_MODE = "LOW" ;
   // defparam cal_dcm.CLKIN_DIVIDE_BY_2 = "FALSE" ;
   // synopsys translate_on
   
   DCM cal_dcm (
		.CLKIN(clk),                     // input clock
		.CLKFB(phShftClk),               // output clock
		.DSSEN(1'b0),
		.PSINCDEC(psInc),
		.PSEN(psEn),
		.PSCLK(clk0),
		.RST(reset), 
		.CLK0(phShftClkDcm),
		.CLK90(),
		.CLK180(),
		.CLK270(),
		.CLK2X(),
		.CLK2X180(),
		.CLKDV(),
		.CLKFX(),
		.CLKFX180(),
		.LOCKED(dcmlocked),
		.PSDONE(psDone),
		.STATUS())

   
   /*synthesis DUTY_CYCLE_CORRECTION = "TRUE"
    CLKOUT_PHASE_SHIFT = "VARIABLE" 
    PHASE_SHIFT = 0
    DLL_FREQUENCY_MODE = "LOW" */

   // Synplicity attributes
   ;

always @ (posedge clk0)
begin
  fpga_rst <= ~(reset & dcmlocked & clk0dcmlock);
end

   
   BUFG phclk_bufg (.I(phShftClkDcm),
		    .O(phShftClk)
		    );
   
   cal_ctl cal_ctl0(
		    .clk (clk0),
		    .psDone(psDone),
		    .reset(fpga_rst),//changed from reset
		    .okToSelTap(okToSelTap),
		    .locReset(locReset),
		    .hxSamp1(hxSamp1),
		    .phSamp1(phSamp1),
		    .selTap(selTap[4:0]),
		    .psEn(psEn),
		    .psInc(psInc),
		    .dcmlocked(dcmlocked),
		    .tapForDqs(tapForDqs[4:0])
		    );

   wire     divRst;
   assign   divRst = ~(dcmlocked && clk0dcmlock);
   
   
   cal_div2 cal_clkd2(
		      .reset (divRst),
		      .iclk(clk0),
		      .oclk(clkDiv2)
		      )/* synthesis syn_noprune=1 */;


   cal_div2 cal_phClkd2(
			.reset (divRst),
			.iclk(phShftClk),
			.oclk(phClkDiv2)
			)/* synthesis syn_noprune=1 */;

   
   
   cal_reg hxSampReg0(
		      .reset (fpga_rst), //changed from reset
		      .clk(hexClk),
		      .dInp(clkDiv2),
		      .iReg(hxSamp0),
		      .dReg(hxSamp1)
		      )/* synthesis syn_noprune=1 */;


   cal_div2 cal_suClkd2(
			.reset (divRst),
			.iclk(clk0),
			.oclk(suClkDiv2)
			)/* synthesis syn_noprune=1 */;


   
   cal_div2 cal_suPhClkd2(
			  .reset (divRst),
			  .iclk(phShftClk),
			  .oclk(suPhClkDiv2)
			  )/* synthesis syn_noprune=1 */;
   
      
   cal_reg phSampReg0(
		      .reset (fpga_rst), //changed from reset
		      .clk(suPhClkDiv2),
		      .dInp(suClkDiv2),
		      .iReg(phSamp0),
		      .dReg(phSamp1)
		      )/* synthesis syn_noprune=1 */;

   

     
   cq_delay  ckt_to_cal 
     //cq_dly_sim ckt_to_cal
     (
      .clk_in (phClkDiv2),
      .sel_in(selTap[4:0]),
      .clk_out(hexClk)
      )/* synthesis syn_noprune=1 */;


  
endmodule // cal_top


   

   



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -