📄 retry_count.v
字号:
// --------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------
// Copyright (c) 2001 by Lattice Semiconductor Corporation
// --------------------------------------------------------------------
//
// Permission:
//
// Lattice Semiconductor grants permission to use this code for use
// in synthesis for any Lattice programmable logic product. Other
// use of this code, including the selling or duplication of any
// portion is strictly prohibited.
//
// Disclaimer:
//
// This VHDL or Verilog source code is intended as a design reference
// which illustrates how these types of functions can be implemented.
// It is the user's responsibility to verify their design for
// consistency and functionality through the use of formal
// verification methods. Lattice Semiconductor provides no warranty
// regarding the use or functionality of this code.
//
// --------------------------------------------------------------------
//
// Lattice Semiconductor Corporation
// 5555 NE Moore Court
// Hillsboro, OR 97214
// U.S.A
//
// TEL: 1-800-Lattice (USA and Canada)
// 408-826-6000 (other locations)
//
// web: http://www.latticesemi.com/
// email: techsupport@latticesemi.com
//
// --------------------------------------------------------------------
// Revision History :
// --------------------------------------------------------------------
// Ver :| Author :| Mod. Date :| Changes Made:
// v1.0 :| D.S. :| 1/20/98 :| Initial Creation
//
// --------------------------------------------------------------------
//
// Module retry_count
/*
This modules is the data retry counter. Ifs the PCI Target responds with
a retry it must be done during the first data phase of a transaction.
The target has up to 16 clock tics to respond with the first data phase
or it must issue a retry. This counter is enabled and reset from the
statemachine block. Once the target is ready to cycle data to the
bkend device it will assert base_region0_l or base_region1_l.
The bkend device must respond by asserting ready_l within 10 clock tics
or else this counter block will assert the retry_l signal.
*/
//
module retry_count (pci_clk, count_rst_l, count_en_l, retry_l);
output retry_l;
input pci_clk, count_rst_l, count_en_l;
reg [3:0] count;
assign retry_l = (count >= 4'h9) ? 0 : 1;
always @ (posedge pci_clk or negedge count_rst_l)
begin
if (count_rst_l == 1'b0) begin
count = 4'h0;
end
else if (count_en_l == 1'b0) begin
count = count +1;
end
else begin
count = count;
end
end
endmodule //of pargen
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -