OpenCores
URL https://opencores.org/ocsvn/aes_highthroughput_lowarea/aes_highthroughput_lowarea/trunk

Subversion Repositories aes_highthroughput_lowarea

[/] [aes_highthroughput_lowarea/] [trunk/] [verilog/] [rtl/] [ram_16x64.v] - Diff between revs 5 and 8

Only display areas with differences | Details | Blame | View Log

Rev 5 Rev 8
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
////                                                              ////
////                                                              ////
////  Ram module                                                  ////
////  Ram module                                                  ////
////                                                              ////
////                                                              ////
////  Description:                                                ////
////  Description:                                                ////
////  this is 16x64, we can use a 16x128 to replace two of this   ////
////  this is 16x64, we can use a 16x128 to replace two of this   ////
////    module, also, can use specific foundry libs instead       ////
////    module, also, can use specific foundry libs instead       ////
////                                                              ////
////                                                              ////
////  To Do:                                                      ////
////  To Do:                                                      ////
////   - done                                                     ////
////   - done                                                     ////
////                                                              ////
////                                                              ////
////  Author(s):                                                  ////
////  Author(s):                                                  ////
////      - Luo Dongjun,   dongjun_luo@hotmail.com                ////
////      - Luo Dongjun,   dongjun_luo@hotmail.com                ////
////                                                              ////
////                                                              ////
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
module ram_16x64 (clk,wr,wr_addr,wr_data,rd,rd_addr,rd_data);
module ram_16x64 (clk,wr,wr_addr,wr_data,rd,rd_addr,rd_data);
 
 
input clk,wr,rd;
input clk,wr,rd;
input [3:0] wr_addr,rd_addr;
input [3:0] wr_addr,rd_addr;
input [63:0] wr_data;
input [63:0] wr_data;
output [63:0] rd_data;
output [63:0] rd_data;
 
 
reg [63:0] mem[15:0];
reg [63:0] mem[15:0];
wire [63:0] rd_data;
wire [63:0] rd_data;
 
 
// behavioral code for 16x64 mem
// behavioral code for 16x64 mem
always @ (posedge clk)
always @ (posedge clk)
begin
begin
   if (wr)
   if (wr)
      mem[wr_addr] <= wr_data;
      mem[wr_addr] <= wr_data;
end
end
 
 
//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTI
 
 
 
reg [3:0] srd_addr;
reg [3:0] srd_addr;
 
 
always @ (posedge clk)
always @ (posedge clk)
begin
begin
        if (rd)
        if (rd)
                srd_addr <= rd_addr;
                srd_addr <= rd_addr;
end
end
 
 
assign rd_data = mem[srd_addr];
assign rd_data = mem[srd_addr];
 
 
//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTI
 
 
 
// always @ (posedge clk)
 
// begin
 
//    if (rd)
 
//       rd_data <= mem[rd_addr];
 
// end
 
 
 
//MOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTIMOTI
 
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.