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

Subversion Repositories ethmac

[/] [ethmac/] [branches/] [unneback/] [rtl/] [verilog/] [eth_spram_256x32.v] - Diff between revs 302 and 304

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

Rev 302 Rev 304
Line 39... Line 39...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.6  2003/10/17 07:46:15  markom
 
// mbist signals updated according to newest convention
 
//
// Revision 1.5  2003/08/14 16:42:58  simons
// Revision 1.5  2003/08/14 16:42:58  simons
// Artisan ram instance added.
// Artisan ram instance added.
//
//
// Revision 1.4  2002/10/18 17:04:20  tadejm
// Revision 1.4  2002/10/18 17:04:20  tadejm
// Changed BIST scan signals.
// Changed BIST scan signals.
Line 82... Line 85...
        // Generic synchronous single-port RAM interface
        // Generic synchronous single-port RAM interface
        //
        //
        input           clk;  // Clock, rising edge
        input           clk;  // Clock, rising edge
        input           rst;  // Reset, active high
        input           rst;  // Reset, active high
        input           ce;   // Chip enable input, active high
        input           ce;   // Chip enable input, active high
        input           we;   // Write enable input, active high
        input  [3:0]    we;   // Write enable input, active high
        input           oe;   // Output enable input, active high
        input           oe;   // Output enable input, active high
        input  [7:0]    addr; // address bus inputs
        input  [7:0]    addr; // address bus inputs
        input  [31:0]   di;   // input data bus
        input  [31:0]   di;   // input data bus
        output [31:0]   do;   // output data bus
        output [31:0]   do;   // output data bus
 
 
Line 97... Line 100...
  input [`ETH_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
  input [`ETH_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
`endif
`endif
 
 
`ifdef ETH_XILINX_RAMB4
`ifdef ETH_XILINX_RAMB4
 
 
    RAMB4_S16 ram0
    /*RAMB4_S16 ram0
 
    (
 
        .DO      (do[15:0]),
 
        .ADDR    (addr),
 
        .DI      (di[15:0]),
 
        .EN      (ce),
 
        .CLK     (clk),
 
        .WE      (we),
 
        .RST     (rst)
 
    );
 
 
 
    RAMB4_S16 ram1
 
    (
 
        .DO      (do[31:16]),
 
        .ADDR    (addr),
 
        .DI      (di[31:16]),
 
        .EN      (ce),
 
        .CLK     (clk),
 
        .WE      (we),
 
        .RST     (rst)
 
    );*/
 
 
 
    RAMB4_S8 ram0
    (
    (
        .DO      (do[15:0]),
        .DO      (do[7:0]),
        .ADDR    (addr),
        .ADDR    (addr),
        .DI      (di[15:0]),
        .DI      (di[7:0]),
        .EN      (ce),
        .EN      (ce),
        .CLK     (clk),
        .CLK     (clk),
        .WE      (we),
        .WE      (we[0]),
        .RST     (rst)
        .RST     (rst)
    );
    );
 
 
    RAMB4_S16 ram1
    RAMB4_S8 ram1
    (
    (
        .DO      (do[31:16]),
        .DO      (do[15:8]),
        .ADDR    (addr),
        .ADDR    (addr),
        .DI      (di[31:16]),
        .DI      (di[15:8]),
        .EN      (ce),
        .EN      (ce),
        .CLK     (clk),
        .CLK     (clk),
        .WE      (we),
        .WE      (we[1]),
 
        .RST     (rst)
 
    );
 
 
 
    RAMB4_S8 ram2
 
    (
 
        .DO      (do[23:16]),
 
        .ADDR    (addr),
 
        .DI      (di[23:16]),
 
        .EN      (ce),
 
        .CLK     (clk),
 
        .WE      (we[2]),
 
        .RST     (rst)
 
    );
 
 
 
    RAMB4_S8 ram3
 
    (
 
        .DO      (do[31:24]),
 
        .ADDR    (addr),
 
        .DI      (di[31:24]),
 
        .EN      (ce),
 
        .CLK     (clk),
 
        .WE      (we[3]),
        .RST     (rst)
        .RST     (rst)
    );
    );
 
 
`else   // !ETH_XILINX_RAMB4
`else   // !ETH_XILINX_RAMB4
`ifdef  ETH_VIRTUAL_SILICON_RAM
`ifdef  ETH_VIRTUAL_SILICON_RAM
  `ifdef ETH_BIST
  `ifdef ETH_BIST
      vs_hdsp_256x32_bist ram0_bist
      //vs_hdsp_256x32_bist ram0_bist
 
      vs_hdsp_256x32_bw_bist ram0_bist
  `else
  `else
      vs_hdsp_256x32 ram0
      //vs_hdsp_256x32 ram0
 
      vs_hdsp_256x32_bw ram0
  `endif
  `endif
      (
      (
        .CK         (clk),
        .CK         (clk),
        .CEN        (!ce),
        .CEN        (!ce),
        .WEN        (!we),
        .WEN        (!we),
Line 148... Line 197...
 
 
`else   // !ETH_VIRTUAL_SILICON_RAM
`else   // !ETH_VIRTUAL_SILICON_RAM
 
 
`ifdef  ETH_ARTISAN_RAM
`ifdef  ETH_ARTISAN_RAM
  `ifdef ETH_BIST
  `ifdef ETH_BIST
      art_hssp_256x32_bist ram0_bist
      //art_hssp_256x32_bist ram0_bist
 
      art_hssp_256x32_bw_bist ram0_bist
  `else
  `else
      art_hssp_256x32 ram0
      //art_hssp_256x32 ram0
 
      art_hssp_256x32_bw ram0
  `endif
  `endif
      (
      (
        .CLK        (clk),
        .CLK        (clk),
        .CEN        (!ce),
        .CEN        (!ce),
        .WEN        (!we),
        .WEN        (!we),
Line 178... Line 229...
        //
        //
 
 
        //
        //
        // Generic RAM's registers and wires
        // Generic RAM's registers and wires
        //
        //
        reg  [31:0] mem [255:0];  // RAM content
        reg  [ 7: 0] mem0 [255:0]; // RAM content
 
        reg  [15: 8] mem1 [255:0]; // RAM content
 
        reg  [23:16] mem2 [255:0]; // RAM content
 
        reg  [31:24] mem3 [255:0]; // RAM content
        wire [31:0] q;          // RAM output
        wire [31:0] q;          // RAM output
        reg  [7:0]  raddr;      // RAM read address
        reg  [7:0]  raddr;      // RAM read address
        //
        //
        // Data output drivers
        // Data output drivers
        //
        //
Line 195... Line 249...
        // read operation
        // read operation
        always@(posedge clk)
        always@(posedge clk)
        if (ce) // && !we)
        if (ce) // && !we)
                raddr <= #1 addr;    // read address needs to be registered to read clock
                raddr <= #1 addr;    // read address needs to be registered to read clock
 
 
        assign #1 q = rst ? {32{1'b0}} : mem[raddr];
        assign #1 q = rst ? {32{1'b0}} : {mem3[raddr], mem2[raddr], mem1[raddr], mem0[raddr]};
 
 
        // write operation
        // write operation
        always@(posedge clk)
        always@(posedge clk)
                if (ce && we)
        begin
                        mem[addr] <= #1 di;
                if (ce && we[3])
 
                        mem3[addr] <= #1 di[31:24];
 
                if (ce && we[2])
 
                        mem2[addr] <= #1 di[23:16];
 
                if (ce && we[1])
 
                        mem1[addr] <= #1 di[15: 8];
 
                if (ce && we[0])
 
                        mem0[addr] <= #1 di[ 7: 0];
 
        end
 
 
        // Task prints range of memory
        // Task prints range of memory
        // *** Remember that tasks are non reentrant, don't call this task in parallel for multiple instantiations. 
        // *** Remember that tasks are non reentrant, don't call this task in parallel for multiple instantiations. 
        task print_ram;
        task print_ram;
        input [7:0] start;
        input [7:0] start;
        input [7:0] finish;
        input [7:0] finish;
        integer rnum;
        integer rnum;
        begin
        begin
                for (rnum=start;rnum<=finish;rnum=rnum+1)
                for (rnum=start;rnum<=finish;rnum=rnum+1)
                        $display("Addr %h = %h",rnum,mem[rnum]);
                        $display("Addr %h = %0h %0h %0h %0h",rnum,mem3[rnum],mem2[rnum],mem1[rnum],mem0[rnum]);
        end
        end
        endtask
        endtask
 
 
`endif  // !ETH_ARTISAN_RAM
`endif  // !ETH_ARTISAN_RAM
`endif  // !ETH_VIRTUAL_SILICON_RAM
`endif  // !ETH_VIRTUAL_SILICON_RAM

powered by: WebSVN 2.1.0

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