element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Forum 在FPGA内手动做Delay
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 0 replies
  • Subscribers 535 subscribers
  • Views 1024 views
  • Users 0 members are here
  • 延时链
  • shift
  • delay
Related

在FPGA内手动做Delay

Flush
Flush over 14 years ago

1. 确定要delay的信号是时钟信号还是数据信号。
如果是free running的时钟信号,频率在DCM操作范围之内,要记得使用DCM做Phase Shift。
2. 如果是V5,可以用ODELAY
3. 如果有一个快速的时钟,而要做一个大于一个时钟的delay,那么可以用shift register。SRL16可以将一个LUT当16个Shift register使。
4. 如果以上条件都不满足,就只好用LUT搭延时链了。
如果不要求动态改变延时长度,那么就多次使用这样的LUT:
引用
  LUT4 delay( .I0(1'b1), .I1(1'b1), .I2(1'b1), .I3(clk_in), .O(delay1) );                                  
  defparam    delay.INIT = 16'hff00;            
  // synthesis attribute INIT of delay is "ff00";  
引用
  LUT4_u0 : LUT4
  generic map (
     INIT => X"ff00")
  port map (
     O => delay_out,   -- LUT general output
     I0 => '0', -- LUT input
     I1 => '0', -- LUT input
     I2 => '0', -- LUT input
     I3 => delay_in  -- LUT input
  );

 

//*****************************************************************************************
//**
//**  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.
//**
//*****************************************************************************************
// Preparation for data to be sent to the memory

`timescale 1 ns/1 ps

module cq_delay(clk_in,sel_in,clk_out);                                                                   
                                                                                                           
   input       clk_in ;                                                                                    
   input[4:0]  sel_in;                                                                                     
   output      clk_out;                                                                                    
                                                                                                              
   wire        clk_in ;                                                                                    
   wire [4:0]  sel_in;                                                                                     
   wire        clk_out1, clk_out2;
   wire        clk_out;
                                                                                                     
                                                                                                     
wire delay1 /* synthesis syn_keep = 1 */;                                                                                   
wire delay2 /* synthesis syn_keep = 1 */;                                                                                   
wire delay3 /* synthesis syn_keep = 1 */;                                                                                   
wire delay4 /* synthesis syn_keep = 1 */;                                                                                   
wire delay5 /* synthesis syn_keep = 1 */;                                                                                   
                                                                                        
   LUT4 one( .I0(1'b1), .I1(sel_in[4]), .I2(delay5), .I3(clk_in), .O(clk_out));                            
   // synthesis attribute INIT of one is "f3c0";
   defparam    one.INIT = 16'hf3c0;                                                                        
                                                                                                              
   LUT4 two( .I0(clk_in), .I1(sel_in[2]), .I2(1'b1), .I3(delay3), .O(delay4));                             
   defparam    two.INIT = 16'hee22;                                                                        
   // synthesis attribute INIT of two is "ee22";
                                                                                                           
   LUT4 three( .I0(clk_in), .I1(sel_in[0]), .I2(delay1), .I3(1'b1), .O(delay2) );                          
   defparam    three.INIT = 16'he2e2;                                                                      
   // synthesis attribute INIT of three is "e2e2";
                                                                                                           
   LUT4 four( .I0(1'b1), .I1(1'b1), .I2(1'b1), .I3(clk_in), .O(delay1) );                                  
   defparam    four.INIT = 16'hff00;            
   // synthesis attribute INIT of four is "ff00";                                                         
                                                                                                           
   LUT4 five( .I0(1'b1), .I1(sel_in[3]), .I2(delay4), .I3(clk_in), .O(delay5) );                           
   defparam    five.INIT = 16'hf3c0;            
   // synthesis attribute INIT of five is "f3c0";                                                         
                                                                                                           
   LUT4 six( .I0(clk_in), .I1(sel_in[1]), .I2(delay2), .I3(1'b1), .O(delay3) );                            
   defparam    six.INIT = 16'he2e2;                                                                        
   // synthesis attribute INIT of six is "e2e2";                                                         
//   assign #1   clk_out2 = clk_out1;
//   assign      clk_out = clk_out2;
 
                                                                                                          
endmodule                

  • Sign in to reply
  • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube