| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //////////////////////////////////////////////////////////////////////////////////
- // Company: TAIR
- // Engineer:
- //
- // Create Date: 10/30/2023 11:24:31 AM
- // Design Name:
- // Module Name: TxFifoPtrSync
- // Project Name: S5443_V3_FPGA3
- // Target Devices: BOARD: BY5443v3. FPGA: xc7s25csga225-2
- // Tool Versions:
- // Description:
- //
- // Dependencies:
- //
- // Revision:
- // Revision 1.0 - File Created
- // Additional Comments:
- //
- //////////////////////////////////////////////////////////////////////////////////
- module TxFifoPtrSync #(
- parameter WIDTH = 8,
- parameter STAGES = 3
- )
- (
- input ClkFast_i,
- input ClkSlow_i,
- input [WIDTH-1:0] TxFifoWrPtr_i,
- output [WIDTH-1:0] TxFifoWrPtr_o
- );
- //================================================================================
- // REG/WIRE
- //================================================================================
- //lauch registers
- reg [WIDTH-1:0] txFifoWrPtrReg;
- // capture registers
- (* ASYNC_REG = "TRUE" *) reg [STAGES*WIDTH-1:0] txFifoWrPtrReg_c;
- //================================================================================
- // ASSIGNMENTS
- //================================================================================
- assign TxFifoWrPtr_o = txFifoWrPtrReg_c[STAGES*WIDTH-1:(STAGES-1)*WIDTH];
- //================================================================================
- // LOCALPARAMS
- //================================================================================
- //================================================================================
- // CODING
- //================================================================================
- always @(posedge ClkFast_i) begin
- txFifoWrPtrReg <= TxFifoWrPtr_i;
- end
- always @(posedge ClkSlow_i) begin
- txFifoWrPtrReg_c <= {txFifoWrPtrReg_c[(STAGES-1)*WIDTH-1:0], txFifoWrPtrReg};
- end
- endmodule
|