1 |
2 |
simont |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// 8051 data ram ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of the 8051 cores project ////
|
6 |
|
|
//// http://www.opencores.org/cores/8051/ ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Description ////
|
9 |
|
|
//// data ram for virtex ////
|
10 |
|
|
//// ////
|
11 |
|
|
//// To Do: ////
|
12 |
|
|
//// nothing ////
|
13 |
|
|
//// ////
|
14 |
|
|
//// Author(s): ////
|
15 |
|
|
//// - Simon Teran, simont@opencores.org ////
|
16 |
|
|
//// ////
|
17 |
|
|
//////////////////////////////////////////////////////////////////////
|
18 |
|
|
//// ////
|
19 |
|
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
20 |
|
|
//// ////
|
21 |
|
|
//// This source file may be used and distributed without ////
|
22 |
|
|
//// restriction provided that this copyright statement is not ////
|
23 |
|
|
//// removed from the file and that any derivative work contains ////
|
24 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
25 |
|
|
//// ////
|
26 |
|
|
//// This source file is free software; you can redistribute it ////
|
27 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
28 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
29 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
30 |
|
|
//// later version. ////
|
31 |
|
|
//// ////
|
32 |
|
|
//// This source is distributed in the hope that it will be ////
|
33 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
34 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
35 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
36 |
|
|
//// details. ////
|
37 |
|
|
//// ////
|
38 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
39 |
|
|
//// Public License along with this source; if not, download it ////
|
40 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
41 |
|
|
//// ////
|
42 |
|
|
//////////////////////////////////////////////////////////////////////
|
43 |
|
|
//
|
44 |
|
|
// ver: 1
|
45 |
|
|
//
|
46 |
|
|
|
47 |
|
|
// synopsys translate_off
|
48 |
|
|
`include "oc8051_timescale.v"
|
49 |
|
|
// synopsys translate_on
|
50 |
|
|
|
51 |
|
|
module oc8051_ram (clk, rst, rd_addr, rd_data, wr_addr, wr_data, wr);
|
52 |
|
|
// clk clock
|
53 |
|
|
// rd_addr read addres
|
54 |
|
|
// rd_data read data
|
55 |
|
|
// wr_addr write addres
|
56 |
|
|
// wr_data write data
|
57 |
|
|
// wr write
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
input clk, wr, rst;
|
61 |
|
|
input [7:0] rd_addr, wr_addr, wr_data;
|
62 |
|
|
output [7:0] rd_data;
|
63 |
|
|
|
64 |
|
|
wire [7:0] dob;
|
65 |
|
|
RAMB4_S8_S8 ram1(.DOA(rd_data), .DOB(dob), .ADDRA({1'b0, rd_addr}), .DIA(8'h00), .ENA(1'b1), .CLKA(clk), .WEA(1'b0),
|
66 |
|
|
.RSTA(rst), .ADDRB({1'b0, wr_addr}), .DIB(wr_data), .ENB(1'b1), .CLKB(clk), .WEB(wr), .RSTB(rst));
|
67 |
|
|
|
68 |
|
|
|
69 |
|
|
endmodule
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
module RAMB4_S8_S8(DOA, DOB, ADDRA, DIA, ENA, CLKA, WEA, RSTA, ADDRB, DIB, ENB, CLKB, WEB, RSTB); // synthesis syn_black_box
|
74 |
|
|
output [7:0] DOA;
|
75 |
|
|
output [7:0] DOB;
|
76 |
|
|
input [8:0] ADDRA;
|
77 |
|
|
input [7:0] DIA;
|
78 |
|
|
input ENA;
|
79 |
|
|
input CLKA;
|
80 |
|
|
input WEA;
|
81 |
|
|
input RSTA;
|
82 |
|
|
input [8:0] ADDRB;
|
83 |
|
|
input [7:0] DIB;
|
84 |
|
|
input ENB;
|
85 |
|
|
input CLKB;
|
86 |
|
|
input WEB;
|
87 |
|
|
input RSTB;
|
88 |
|
|
endmodule
|