Revision 10,
1.1 KB
checked in by pntsvt00, 14 years ago
(diff) |
versione sintetizzabile
|
Rev | Line | |
---|
[10] | 1 | `timescale 1ns / 1ps |
---|
| 2 | ////////////////////////////////////////////////////////////////////////////////// |
---|
| 3 | // Company: |
---|
| 4 | // Engineer: |
---|
| 5 | // |
---|
| 6 | // Create Date: 12:52:07 03/14/2011 |
---|
| 7 | // Design Name: |
---|
| 8 | // Module Name: cachedir |
---|
| 9 | // Project Name: |
---|
| 10 | // Target Devices: |
---|
| 11 | // Tool versions: |
---|
| 12 | // Description: |
---|
| 13 | // |
---|
| 14 | // Dependencies: |
---|
| 15 | // |
---|
| 16 | // Revision: |
---|
| 17 | // Revision 0.01 - File Created |
---|
| 18 | // Additional Comments: |
---|
| 19 | // |
---|
| 20 | ////////////////////////////////////////////////////////////////////////////////// |
---|
| 21 | module cachedir( |
---|
| 22 | input clock, |
---|
| 23 | input enable, |
---|
| 24 | input wren_a, |
---|
| 25 | input [ 7:0] address_a, |
---|
| 26 | input [28:0] data_a, |
---|
| 27 | output [ 28:0] q_a, |
---|
| 28 | input wren_b, |
---|
| 29 | input [ 7:0] address_b, |
---|
| 30 | input [28:0] data_b, |
---|
| 31 | output [28:0] q_b |
---|
| 32 | ); |
---|
| 33 | |
---|
| 34 | reg [28:0] mem1 [(2**7)-1:0]; |
---|
| 35 | reg [28:0] mem2 [(2**7)-1:0]; |
---|
| 36 | |
---|
| 37 | always @(posedge clock) |
---|
| 38 | begin |
---|
| 39 | if (enable) |
---|
| 40 | if (wren_a) |
---|
| 41 | mem1[address_a] <= data_a; |
---|
| 42 | end |
---|
| 43 | |
---|
| 44 | assign q_a = mem1[address_a]; |
---|
| 45 | |
---|
| 46 | always @(posedge clock) |
---|
| 47 | begin |
---|
| 48 | if (enable) |
---|
| 49 | if (wren_b) |
---|
| 50 | mem2[address_b] <= data_b; |
---|
| 51 | end |
---|
| 52 | assign q_b = mem2[address_b]; |
---|
| 53 | endmodule |
---|
Note: See
TracBrowser
for help on using the repository browser.