2008-11-22 22:40:25 +01:00
|
|
|
// File: ram_1.v
|
2010-07-02 13:24:04 +02:00
|
|
|
// Generated by MyHDL 0.7dev
|
2010-10-09 11:35:58 +02:00
|
|
|
// Date: Fri Oct 8 21:53:32 2010
|
2010-07-02 13:24:04 +02:00
|
|
|
|
2008-11-22 22:40:25 +01:00
|
|
|
|
|
|
|
`timescale 1ns/10ps
|
|
|
|
|
|
|
|
module ram_1 (
|
|
|
|
dout,
|
|
|
|
din,
|
|
|
|
addr,
|
|
|
|
we,
|
|
|
|
clk
|
|
|
|
);
|
2010-07-02 13:24:04 +02:00
|
|
|
// Ram model
|
2008-11-22 22:40:25 +01:00
|
|
|
|
|
|
|
output [7:0] dout;
|
|
|
|
wire [7:0] dout;
|
|
|
|
input [7:0] din;
|
|
|
|
input [6:0] addr;
|
|
|
|
input we;
|
|
|
|
input clk;
|
|
|
|
|
|
|
|
|
|
|
|
reg [7:0] mem [0:128-1];
|
|
|
|
|
|
|
|
|
2010-07-02 13:24:04 +02:00
|
|
|
|
|
|
|
|
2008-11-22 22:40:25 +01:00
|
|
|
always @(posedge clk) begin: RAM_1_WRITE
|
|
|
|
if (we) begin
|
|
|
|
mem[addr] <= din;
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
2010-07-02 13:24:04 +02:00
|
|
|
|
2008-11-22 22:40:25 +01:00
|
|
|
assign dout = mem[addr];
|
|
|
|
|
|
|
|
endmodule
|