1 //-----------------------------------------------------------------------------
2 // Copyright 2017 Damien Pretet ThotIP
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //-----------------------------------------------------------------------------
17 `timescale 1 ns / 1 ps
25 parameter FALLTHROUGH = "TRUE" // First word fall-through
30 input wire [DSIZE-1:0] wdata,
36 output wire [DSIZE-1:0] rdata,
39 output wire [ASIZE :0] rclk_rptr,
40 output wire [ASIZE :0] rclk_wptr,
41 output wire [ASIZE :0] wclk_rptr,
42 output wire [ASIZE :0] wclk_wptr
45 wire [ ASIZE:0] wptr, rptr, wq2_rptr, rq2_wptr;
46 wire [ASIZE-1:0] wclk_wptr_internal, rclk_rptr_internal;
48 assign wclk_wptr = {1'b0, wclk_wptr_internal};
49 assign rclk_rptr = {1'b0, rclk_rptr_internal};
51 // The module synchronizing the read point
52 // from read to write domain
62 // The module synchronizing the write point
63 // from write to read domain
73 // The module handling the write requests
79 .waddr (wclk_wptr_internal),
85 .wq2_rptr_binary (wclk_rptr)
90 #(DSIZE, ASIZE, FALLTHROUGH)
96 .waddr (wclk_wptr_internal),
97 .raddr (rclk_rptr_internal),
103 // The module handling read requests
109 .raddr (rclk_rptr_internal),
111 .rq2_wptr (rq2_wptr),
115 .rq2_wptr_binary (rclk_wptr)