1 |
2 |
alfik |
/*
|
2 |
|
|
* Copyright (c) 2014, Aleksander Osman
|
3 |
|
|
* All rights reserved.
|
4 |
|
|
*
|
5 |
|
|
* Redistribution and use in source and binary forms, with or without
|
6 |
|
|
* modification, are permitted provided that the following conditions are met:
|
7 |
|
|
*
|
8 |
|
|
* * Redistributions of source code must retain the above copyright notice, this
|
9 |
|
|
* list of conditions and the following disclaimer.
|
10 |
|
|
*
|
11 |
|
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
12 |
|
|
* this list of conditions and the following disclaimer in the documentation
|
13 |
|
|
* and/or other materials provided with the distribution.
|
14 |
|
|
*
|
15 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16 |
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17 |
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
18 |
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
19 |
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
20 |
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
21 |
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
22 |
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
23 |
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
24 |
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
25 |
|
|
*/
|
26 |
|
|
|
27 |
|
|
`include "defines.v"
|
28 |
|
|
|
29 |
|
|
module dcache_to_icache_fifo(
|
30 |
|
|
input clk,
|
31 |
|
|
input rst_n,
|
32 |
|
|
|
33 |
|
|
//RESP:
|
34 |
|
|
input dcachetoicache_write_do,
|
35 |
|
|
input [31:0] dcachetoicache_write_address,
|
36 |
|
|
//END
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
//RESP:
|
40 |
|
|
input dcachetoicache_accept_do,
|
41 |
|
|
output [31:0] dcachetoicache_accept_address,
|
42 |
|
|
output dcachetoicache_accept_empty
|
43 |
|
|
//END
|
44 |
|
|
);
|
45 |
|
|
|
46 |
|
|
//------------------------------------------------------------------------------
|
47 |
|
|
|
48 |
|
|
wire [27:0] q;
|
49 |
|
|
|
50 |
|
|
simple_fifo #(
|
51 |
|
|
.width (28),
|
52 |
|
|
.widthu (5)
|
53 |
|
|
)
|
54 |
|
|
dcache_to_icache_fifo_inst (
|
55 |
|
|
.clk (clk), //input
|
56 |
|
|
.rst_n (rst_n), //input
|
57 |
|
|
.sclr (1'b0), //input
|
58 |
|
|
|
59 |
|
|
.rdreq (dcachetoicache_accept_do), //input
|
60 |
|
|
.wrreq (dcachetoicache_write_do), //input
|
61 |
|
|
.data (dcachetoicache_write_address[31:4]), //input [27:0]
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
.empty (dcachetoicache_accept_empty), //output
|
65 |
|
|
.q (q), //output [27:0]
|
66 |
|
|
|
67 |
|
|
/* verilator lint_off PINNOCONNECT */
|
68 |
|
|
.full (), //output not used
|
69 |
|
|
.usedw () //output [4:0] not used
|
70 |
|
|
/* verilator lint_on PINNOCONNECT */
|
71 |
|
|
);
|
72 |
|
|
|
73 |
|
|
//------------------------------------------------------------------------------
|
74 |
|
|
|
75 |
|
|
assign dcachetoicache_accept_address = { q, 4'd0 };
|
76 |
|
|
|
77 |
|
|
//------------------------------------------------------------------------------
|
78 |
|
|
|
79 |
|
|
//------------------------------------------------------------------------------
|
80 |
|
|
|
81 |
|
|
// synthesis translate_off
|
82 |
|
|
wire _unused_ok = &{ 1'b0, dcachetoicache_write_address[3:0], 1'b0 };
|
83 |
|
|
// synthesis translate_on
|
84 |
|
|
|
85 |
|
|
//------------------------------------------------------------------------------
|
86 |
|
|
|
87 |
|
|
//------------------------------------------------------------------------------
|
88 |
|
|
|
89 |
|
|
|
90 |
|
|
endmodule
|