OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [rtl/] [src_noc/] [flit_buffer_reg_bas.v] - Diff between revs 48 and 54

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

Rev 48 Rev 54
Line 67... Line 67...
    output [VCw-1 : 0] class_all;
    output [VCw-1 : 0] class_all;
   // output [VDSTPw-1 :0 ] dest_port_encoded_all;
   // output [VDSTPw-1 :0 ] dest_port_encoded_all;
   // input  [V-1        :0]  ssa_rd;
   // input  [V-1        :0]  ssa_rd;
 
 
    wire [Fw-1       :0]  dout_all [V-1 : 0];    // Data out
    wire [Fw-1       :0]  dout_all [V-1 : 0];    // Data out
    reg  [VCw-1 : 0] class_vc [V-1 : 0];
    wire [VCw-1 : 0] class_vc [V-1 : 0];
    reg [REGFw-1 : 0] flit_regs [V-1 : 0];   // a register array save the head of each quque
    reg  [VCw-1 : 0] class_vc_next [V-1 : 0];
 
    wire [REGFw-1 : 0] flit_regs [V-1 : 0];   // a register array save the head of each quque
 
    reg  [REGFw-1 : 0] flit_regs_next [V-1 : 0];
    reg [V-1 : 0] valid,valid_next; // if valid is asseted it shows the VC queue has a flit waiting to be sent 
    reg [V-1 : 0] valid,valid_next; // if valid is asseted it shows the VC queue has a flit waiting to be sent 
 
 
    wire [Fw-1 : 0] bram_dout;
    wire [Fw-1 : 0] bram_dout;
    wire [V-1 : 0] bram_not_empty;
    wire [V-1 : 0] bram_not_empty;
    wire bram_wr_en;
    wire bram_wr_en;
Line 129... Line 131...
    always @(posedge clk) pass_din_to_flit_reg_delaied<=pass_din_to_flit_reg;
    always @(posedge clk) pass_din_to_flit_reg_delaied<=pass_din_to_flit_reg;
    assign  dout = dout_all[vc_num_rd_bin_delaied];
    assign  dout = dout_all[vc_num_rd_bin_delaied];
 
 
 
 
    flit_buffer #(
    flit_buffer #(
        .V(V),
 
        .B(B),
        .B(B),
        .PCK_TYPE(PCK_TYPE),
 
        .Fw(Fw),
 
        .DEBUG_EN(DEBUG_EN),
 
        .SSA_EN("NO")// should be "NO" even if SSA is enabled
        .SSA_EN("NO")// should be "NO" even if SSA is enabled
    )
    )
    flit_buffer
    flit_buffer
    (
    (
        .din(din),
        .din(din),
Line 149... Line 147...
        .rd_en(bram_rd_en),
        .rd_en(bram_rd_en),
        .dout(bram_dout),
        .dout(bram_dout),
        .vc_not_empty(bram_not_empty),
        .vc_not_empty(bram_not_empty),
        .reset(reset),
        .reset(reset),
        .clk(clk),
        .clk(clk),
        .ssa_rd({V{1'b0}})
        .ssa_rd({V{1'b0}}),
 
        .multiple_dest(),
 
        .sub_rd_ptr_ld(),
 
        .flit_is_tail()
 
 
 
 
    );
    );
 
 
 
 
    always @(posedge clk) begin
    always @(posedge clk) begin
        if(reset)  begin
        if(reset)  begin
Line 199... Line 202...
       // assign  dout_all[(i+1)*Fw-1 : i*Fw] = {flit_regs [i][REGFw-1: REGFw-2],i[V-1:0] ,flit_regs[i][Fpay-1:0]};
       // assign  dout_all[(i+1)*Fw-1 : i*Fw] = {flit_regs [i][REGFw-1: REGFw-2],i[V-1:0] ,flit_regs[i][Fpay-1:0]};
        assign  dout_all[i] = {flit_regs [i][REGFw-1: REGFw-2],i[V-1:0] ,flit_regs[i][Fpay-1:0]};
        assign  dout_all[i] = {flit_regs [i][REGFw-1: REGFw-2],i[V-1:0] ,flit_regs[i][Fpay-1:0]};
        assign  class_all[(i+1)*Cw-1 : i*Cw] = class_vc[i];
        assign  class_all[(i+1)*Cw-1 : i*Cw] = class_vc[i];
 
 
 
 
 
      pronoc_register #(
 
           .W(REGFw)
 
      ) reg1 (
 
           .in(flit_regs_next[i]),
 
           .reset(reset),
 
           .clk(clk),
 
           .out(flit_regs[i])
 
      );
 
 
 
 
 
       pronoc_register #(
 
           .W(Cw)
 
      ) reg2 (
 
           .in(class_vc_next[i]),
 
           .reset(reset),
 
           .clk(clk),
 
           .out(class_vc[i])
 
      );
 
 
 
 
 
 
`ifdef SYNC_RESET_MODE
        always @ (*)begin
        always @ (posedge clk )begin
            flit_regs_next[i] = flit_regs[i];
`else
            class_vc_next[i]  = class_vc[i];
        always @ (posedge clk or posedge reset)begin
            if(pass_din_to_flit_reg_delaied[i]) flit_regs_next[i] = {din[Fw-1:Fw-2],din_reg[Fpay-1:0]} ;
`endif
            if(bram_out_is_valid_delaied[i])    flit_regs_next[i] = {bram_dout[Fw-1:Fw-2],bram_dout[Fpay-1:0]};
            if(reset)begin
            if(flit_reg_wr_en[i] & flit_reg_mux_out[REGFw-1] ) class_vc_next[i] = class_i;// writing header flit 
                flit_regs[i]<= {REGFw{1'b0}};
 
                class_vc[i]<=  {Cw{1'b0}};
 
            //    dest_port_encoded_vc[i]<={DSTPw{1'b0}}; 
 
            end
 
            else begin //1 :din, 0: bram
 
               // if(pass_din_to_flit_reg_delaied[i] & (flit_reg_mux_sel_delay==1'b0)) $display("EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE");
 
               // if( bram_out_is_valid_delaied[i] & flit_reg_mux_sel_delay)  $display("RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR");
 
                if(pass_din_to_flit_reg_delaied[i]) flit_regs[i] <= {din[Fw-1:Fw-2],din_reg[Fpay-1:0]} ;
 
                if(bram_out_is_valid_delaied[i])    flit_regs[i] <= {bram_dout[Fw-1:Fw-2],bram_dout[Fpay-1:0]};
 
                if(flit_reg_wr_en[i] & flit_reg_mux_out[REGFw-1] ) class_vc[i]<=class_i;// writing header flit 
 
             //   if(destport_clear[i]>0) dest_port_encoded_vc<= dest_port_encoded_vc & ~destport_clear[i];
 
              //  else if(flit_reg_wr_en[i] & flit_reg_mux_out[REGFw-1] ) dest_port_encoded_vc <=destport_i;
 
            end
 
        end
        end
 
 
 
 
 
 
        /* verilator lint_off WIDTH */
        /* verilator lint_off WIDTH */
         /*
         /*
        if( ROUTE_TYPE=="DETERMINISTIC") begin : dtrmn_dest
        if( ROUTE_TYPE=="DETERMINISTIC") begin : dtrmn_dest
`ifdef SYNC_RESET_MODE
        always @ (`pronoc_clk_reset_edge )begin
            always @ (posedge clk )begin
               if(`pronoc_reset)begin
`else
 
            always @ (posedge clk or posedge reset)begin
 
`endif
 
                if(reset)begin
 
 
 
                end else begin
                end else begin
                    dest_port_encoded_vc[i]<= destport_in_encoded;
                    dest_port_encoded_vc[i]<= destport_in_encoded;
                end
                end
            end//always
            end//always

powered by: WebSVN 2.1.0

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