OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [orpsocv2/] [rtl/] [verilog/] [uart16550/] [uart_rfifo.v] - Diff between revs 360 and 363

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

Rev 360 Rev 363
Line 190... Line 190...
reg     [fifo_pointer_w-1:0]     bottom;
reg     [fifo_pointer_w-1:0]     bottom;
 
 
reg     [fifo_counter_w-1:0]     count;
reg     [fifo_counter_w-1:0]     count;
reg                             overrun;
reg                             overrun;
 
 
wire [fifo_pointer_w-1:0] top_plus_1 = top + 1'b1;
wire [fifo_pointer_w-1:0] top_plus_1 = top + 4'h1;
 
 
raminfr #(fifo_pointer_w,8,fifo_depth) rfifo
raminfr #(fifo_pointer_w,8,fifo_depth) rfifo
        (.clk(clk),
        (.clk(clk),
                        .we(push),
                        .we(push),
                        .a(top),
                        .a(top),
Line 206... Line 206...
always @(posedge clk or posedge wb_rst_i) // synchronous FIFO
always @(posedge clk or posedge wb_rst_i) // synchronous FIFO
begin
begin
        if (wb_rst_i)
        if (wb_rst_i)
        begin
        begin
                top             <=  0;
                top             <=  0;
                bottom          <=  1'b0;
                bottom          <=  0;
                count           <=  0;
                count           <=  0;
                fifo[0] <=  0;
                fifo[0] <=  0;
                fifo[1] <=  0;
                fifo[1] <=  0;
                fifo[2] <=  0;
                fifo[2] <=  0;
                fifo[3] <=  0;
                fifo[3] <=  0;
Line 228... Line 228...
                fifo[15] <=  0;
                fifo[15] <=  0;
        end
        end
        else
        else
        if (fifo_reset) begin
        if (fifo_reset) begin
                top             <=  0;
                top             <=  0;
                bottom          <=  1'b0;
                bottom          <=  0;
                count           <=  0;
                count           <=  0;
                fifo[0] <=  0;
                fifo[0] <=  0;
                fifo[1] <=  0;
                fifo[1] <=  0;
                fifo[2] <=  0;
                fifo[2] <=  0;
                fifo[3] <=  0;
                fifo[3] <=  0;
Line 254... Line 254...
                case ({push, pop})
                case ({push, pop})
                2'b10 : if (count<fifo_depth)  // overrun condition
                2'b10 : if (count<fifo_depth)  // overrun condition
                        begin
                        begin
                                top       <=  top_plus_1;
                                top       <=  top_plus_1;
                                fifo[top] <=  data_in[2:0];
                                fifo[top] <=  data_in[2:0];
                                count     <=  count + 1'b1;
                                count     <=  count + 5'd1;
                        end
                        end
                2'b01 : if(count>0)
                2'b01 : if(count>0)
                        begin
                        begin
        fifo[bottom] <=  0;
        fifo[bottom] <=  0;
                                bottom   <=  bottom + 1'b1;
                                bottom   <=  bottom + 4'd1;
                                count    <=  count - 1'b1;
                                count    <=  count - 5'd1;
                        end
                        end
                2'b11 : begin
                2'b11 : begin
                                bottom   <=  bottom + 1'b1;
                                bottom   <=  bottom + 4'd1;
                                top       <=  top_plus_1;
                                top       <=  top_plus_1;
                                fifo[top] <=  data_in[2:0];
                                fifo[top] <=  data_in[2:0];
                        end
                        end
    default: ;
    default: ;
                endcase
                endcase

powered by: WebSVN 2.1.0

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