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

Subversion Repositories turbo8051

[/] [turbo8051/] [trunk/] [rtl/] [lib/] [wb_rd_mem2mem.v] - Diff between revs 20 and 24

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

Rev 20 Rev 24
Line 194... Line 194...
reg  [BE_WD-1:0]    wbo_be      ;
reg  [BE_WD-1:0]    wbo_be      ;
reg                 wbo_cyc     ;
reg                 wbo_cyc     ;
reg                 mem_ack     ;
reg                 mem_ack     ;
 
 
wire                mem_wr       = wbo_ack;
wire                mem_wr       = wbo_ack;
 
// Generate Next Address, to fix the read to address inc issue
 
wire [15:0]    taddr   = mem_addr+1;
 
 
wire [7:0]          mem_din  = (mem_addr[1:0] == 2'b00) ? wbo_dout[7:0] :
wire [7:0]          mem_din  = (mem_addr[1:0] == 2'b00) ? wbo_dout[7:0] :
                               (mem_addr[1:0] == 2'b01) ? wbo_dout[15:8] :
                               (mem_addr[1:0] == 2'b01) ? wbo_dout[15:8] :
                               (mem_addr[1:0] == 2'b10) ? wbo_dout[23:16] : wbo_dout[31:24]  ;
                               (mem_addr[1:0] == 2'b10) ? wbo_dout[23:16] : wbo_dout[31:24]  ;
 
 
Line 220... Line 222...
                cnt       <= mem_txfr;
                cnt       <= mem_txfr;
                wbo_taddr <= mem_taddr;
                wbo_taddr <= mem_taddr;
                wbo_addr  <= mem_addr[14:2];
                wbo_addr  <= mem_addr[14:2];
                wbo_stb   <= 1'b1;
                wbo_stb   <= 1'b1;
                wbo_we    <= 1'b0;
                wbo_we    <= 1'b0;
                wbo_be    <= {BE_WD{1'b1}};
                wbo_be    <= 1 << mem_addr[1:0];
                wbo_cyc   <= 1'b1;
                wbo_cyc   <= 1'b1;
                mem_ack   <= 1;
                mem_ack   <= 1;
                state     <= TXFR;
                state     <= TXFR;
            end
            end
         end
         end
         TXFR: begin
         TXFR: begin
            mem_ack     <= 0;
            mem_ack     <= 0;
            if(wbo_ack) begin
            if(wbo_ack) begin
               cnt      <= cnt-1;
               cnt      <= cnt-1;
               wbo_addr  <= mem_addr[14:2];
               wbo_addr  <= taddr[14:2];
 
               wbo_be    <= 1 << taddr[1:0];
               if(cnt == 1) begin
               if(cnt == 1) begin
                  wbo_stb   <= 1'b0;
                  wbo_stb   <= 1'b0;
                  wbo_cyc   <= 1'b0;
                  wbo_cyc   <= 1'b0;
                  state     <= IDLE;
                  state     <= IDLE;
               end
               end

powered by: WebSVN 2.1.0

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