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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_ram_top.v] - Diff between revs 174 and 177

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 174 Rev 177
Line 42... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.10  2003/06/20 13:36:37  simont
 
// ram modules added.
 
//
// Revision 1.9  2003/06/17 14:17:22  simont
// Revision 1.9  2003/06/17 14:17:22  simont
// BIST signals added.
// BIST signals added.
//
//
// Revision 1.8  2003/04/02 16:12:04  simont
// Revision 1.8  2003/04/02 16:12:04  simont
// generic_dpram used
// generic_dpram used
Line 125... Line 128...
// wr_addr_m    write address modified
// wr_addr_m    write address modified
// wr_data_m    write data modified
// wr_data_m    write data modified
reg [7:0] wr_data_m;
reg [7:0] wr_data_m;
reg [7:0] rd_addr_m, wr_addr_m;
reg [7:0] rd_addr_m, wr_addr_m;
 
 
// bit_addr_r   bit addresable instruction (registerd)
 
reg bit_addr_r;
wire       rd_en;
 
reg        bit_addr_r,
 
           rd_en_r;
 
reg  [7:0] wr_data_r;
 
wire [7:0] rd_data_m;
reg [2:0] bit_select;
reg [2:0] bit_select;
 
 
assign bit_data_out = rd_data[bit_select];
assign bit_data_out = rd_data[bit_select];
 
 
 
 
 
assign rd_data = rd_en_r ? wr_data_r: rd_data_m;
 
assign rd_en   = (rd_addr_m == wr_addr_m) & wr;
 
 
oc8051_ram_256x8_two_bist oc8051_idata(
oc8051_ram_256x8_two_bist oc8051_idata(
                           .clk     ( clk        ),
                           .clk     ( clk        ),
                           .rst     ( rst        ),
                           .rst     ( rst        ),
                           .rd_addr ( rd_addr_m  ),
                           .rd_addr ( rd_addr_m  ),
                           .rd_data ( rd_data    ),
                           .rd_data ( rd_data_m  ),
                           .rd_en   ( 1'b1       ),
                           .rd_en   ( !rd_en     ),
                           .wr_addr ( wr_addr_m  ),
                           .wr_addr ( wr_addr_m  ),
                           .wr_data ( wr_data_m  ),
                           .wr_data ( wr_data_m  ),
                           .wr_en   ( 1'b1       ),
                           .wr_en   ( 1'b1       ),
                           .wr      ( wr         )
                           .wr      ( wr         )
`ifdef OC8051_BIST
`ifdef OC8051_BIST
Line 163... Line 172...
    bit_addr_r <= #1 bit_addr;
    bit_addr_r <= #1 bit_addr;
    bit_select <= #1 rd_addr[2:0];
    bit_select <= #1 rd_addr[2:0];
  end
  end
 
 
 
 
 
always @(posedge clk or posedge rst)
 
  if (rst) begin
 
    rd_en_r    <= #1 1'b0;
 
    wr_data_r  <= #1 8'h0;
 
  end else begin
 
    rd_en_r    <= #1 rd_en;
 
    wr_data_r  <= #1 wr_data_m;
 
  end
 
 
 
 
always @(rd_addr or bit_addr)
always @(rd_addr or bit_addr)
  casex ( {bit_addr, rd_addr[7]} ) // synopsys full_case parallel_case
  casex ( {bit_addr, rd_addr[7]} ) // synopsys full_case parallel_case
      2'b0?: rd_addr_m = rd_addr;
      2'b0?: rd_addr_m = rd_addr;
      2'b10: rd_addr_m = {4'b0010, rd_addr[6:3]};
      2'b10: rd_addr_m = {4'b0010, rd_addr[6:3]};
      2'b11: rd_addr_m = {1'b1, rd_addr[6:3], 3'b000};
      2'b11: rd_addr_m = {1'b1, rd_addr[6:3], 3'b000};

powered by: WebSVN 2.1.0

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