| 1 |
2 |
tobil |
/*******************************************************************************
|
| 2 |
|
|
* This file is owned and controlled by Xilinx and must be used *
|
| 3 |
|
|
* solely for design, simulation, implementation and creation of *
|
| 4 |
|
|
* design files limited to Xilinx devices or technologies. Use *
|
| 5 |
|
|
* with non-Xilinx devices or technologies is expressly prohibited *
|
| 6 |
|
|
* and immediately terminates your license. *
|
| 7 |
|
|
* *
|
| 8 |
|
|
* XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" *
|
| 9 |
|
|
* SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR *
|
| 10 |
|
|
* XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION *
|
| 11 |
|
|
* AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION *
|
| 12 |
|
|
* OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS *
|
| 13 |
|
|
* IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT, *
|
| 14 |
|
|
* AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE *
|
| 15 |
|
|
* FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY *
|
| 16 |
|
|
* WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE *
|
| 17 |
|
|
* IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR *
|
| 18 |
|
|
* REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF *
|
| 19 |
|
|
* INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
|
| 20 |
|
|
* FOR A PARTICULAR PURPOSE. *
|
| 21 |
|
|
* *
|
| 22 |
|
|
* Xilinx products are not intended for use in life support *
|
| 23 |
|
|
* appliances, devices, or systems. Use in such applications are *
|
| 24 |
|
|
* expressly prohibited. *
|
| 25 |
|
|
* *
|
| 26 |
|
|
* (c) Copyright 1995-2009 Xilinx, Inc. *
|
| 27 |
|
|
* All rights reserved. *
|
| 28 |
|
|
*******************************************************************************/
|
| 29 |
|
|
// The synthesis directives "translate_off/translate_on" specified below are
|
| 30 |
|
|
// supported by Xilinx, Mentor Graphics and Synplicity synthesis
|
| 31 |
|
|
// tools. Ensure they are correct for your synthesis tool(s).
|
| 32 |
|
|
|
| 33 |
|
|
// You must compile the wrapper file rf_dist.v when simulating
|
| 34 |
|
|
// the core, rf_dist. When compiling the wrapper file, be sure to
|
| 35 |
|
|
// reference the XilinxCoreLib Verilog simulation library. For detailed
|
| 36 |
|
|
// instructions, please refer to the "CORE Generator Help".
|
| 37 |
|
|
|
| 38 |
|
|
// synopsys translate_off
|
| 39 |
|
|
`include "timescale.v"
|
| 40 |
|
|
// synopsys translate_on
|
| 41 |
|
|
|
| 42 |
|
|
module rf_dist(
|
| 43 |
|
|
a,
|
| 44 |
|
|
d,
|
| 45 |
|
|
dpra,
|
| 46 |
|
|
clk,
|
| 47 |
|
|
we,
|
| 48 |
|
|
spo,
|
| 49 |
|
|
dpo);
|
| 50 |
|
|
|
| 51 |
|
|
|
| 52 |
|
|
input [4 : 0] a;
|
| 53 |
|
|
input [31 : 0] d;
|
| 54 |
|
|
input [4 : 0] dpra;
|
| 55 |
|
|
input clk;
|
| 56 |
|
|
input we;
|
| 57 |
|
|
output [31 : 0] spo;
|
| 58 |
|
|
output [31 : 0] dpo;
|
| 59 |
|
|
|
| 60 |
|
|
reg [31:0] mem [31:0];
|
| 61 |
|
|
|
| 62 |
|
|
integer i;
|
| 63 |
|
|
initial begin
|
| 64 |
|
|
for (i = 0; i < 32; i = i + 1) begin
|
| 65 |
|
|
mem[i] <= 32'h0;
|
| 66 |
|
|
end
|
| 67 |
|
|
end
|
| 68 |
|
|
|
| 69 |
|
|
//
|
| 70 |
|
|
// Write port
|
| 71 |
|
|
//
|
| 72 |
|
|
always @(posedge clk)
|
| 73 |
|
|
if (we) mem[a] <= #1 d;
|
| 74 |
|
|
|
| 75 |
|
|
//
|
| 76 |
|
|
// Read port A
|
| 77 |
|
|
//
|
| 78 |
|
|
|
| 79 |
|
|
assign spo = mem[a];
|
| 80 |
|
|
assign dpo = mem[dpra];
|
| 81 |
|
|
|
| 82 |
|
|
endmodule
|
| 83 |
|
|
|