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/] [iport_reg_base.sv] - Diff between revs 48 and 54

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

Rev 48 Rev 54
Line 1... Line 1...
`timescale    1ns/1ps
`include "pronoc_def.v"
//`define MONITORE_PATH
//`define MONITORE_PATH
 
 
/**********************************************************************
/**********************************************************************
**      File: input_ports.v
**      File: input_ports.v
**
**
Line 150... Line 150...
    input   [VV-1 : 0] assigned_ovc_num;
    input   [VV-1 : 0] assigned_ovc_num;
    input   [V-1 : 0] sel;
    input   [V-1 : 0] sel;
    input   [V-1 : 0] nonspec_first_arbiter_granted_ivc;
    input   [V-1 : 0] nonspec_first_arbiter_granted_ivc;
    input   [V-1 : 0] ssa_ivc_num_getting_sw_grant;
    input   [V-1 : 0] ssa_ivc_num_getting_sw_grant;
    input   [(DSTPw*V)-1 : 0] destport_clear;
    input   [(DSTPw*V)-1 : 0] destport_clear;
    output reg [WEIGHTw-1 : 0] iport_weight;
    output  [WEIGHTw-1 : 0] iport_weight;
    output  [V-1 : 0] vc_weight_is_consumed;
    output  [V-1 : 0] vc_weight_is_consumed;
    output  iport_weight_is_consumed;
    output  iport_weight_is_consumed;
    input   refresh_w_counter;
    input   refresh_w_counter;
    input   [P_1-1 : 0] granted_dest_port;
    input   [P_1-1 : 0] granted_dest_port;
    output  [WP-1 : 0] oports_weight;
    output  [WP-1 : 0] oports_weight;
Line 168... Line 168...
    wire [VDSTPw-1 : 0] lk_destination_encoded;
    wire [VDSTPw-1 : 0] lk_destination_encoded;
    wire [EAw-1 : 0] dest_e_addr_in;
    wire [EAw-1 : 0] dest_e_addr_in;
    wire [EAw-1 : 0] src_e_addr_in;
    wire [EAw-1 : 0] src_e_addr_in;
    wire [V-1 : 0] vc_num_in;
    wire [V-1 : 0] vc_num_in;
    wire [V-1 : 0] hdr_flit_wr,flit_wr;
    wire [V-1 : 0] hdr_flit_wr,flit_wr;
    reg  [V-1 : 0] hdr_flit_wr_delayed;
    wire [V-1 : 0] hdr_flit_wr_delayed;
    wire [V-1 : 0] class_rd_fifo,dst_rd_fifo;
    wire [V-1 : 0] class_rd_fifo,dst_rd_fifo;
    reg  [V-1 : 0] lk_dst_rd_fifo;
    wire [V-1 : 0] lk_dst_rd_fifo;
    wire [DSTPw-1 : 0] lk_destination_in_encoded;
    wire [DSTPw-1 : 0] lk_destination_in_encoded;
    wire [WEIGHTw-1  : 0] weight_in;
    wire [WEIGHTw-1  : 0] weight_in;
    wire [Fw-1 : 0] buffer_out;
    wire [Fw-1 : 0] buffer_out;
    wire hdr_flg_in,tail_flg_in;
    wire hdr_flg_in,tail_flg_in;
    wire [V-1 : 0] ivc_not_empty;
    wire [V-1 : 0] ivc_not_empty;
    wire [Cw-1 : 0] class_out [V-1 : 0];
    wire [Cw-1 : 0] class_out [V-1 : 0];
    wire  [VELw-1 : 0] endp_localp_num;
    wire  [VELw-1 : 0] endp_localp_num;
    wire [ELw-1 : 0] endp_l_in;
    wire [ELw-1 : 0] endp_l_in;
 
    logic  [WEIGHTw-1 : 0] iport_weight_next;
 
 
//extract header flit info
//extract header flit info
    extract_header_flit_info #(
    extract_header_flit_info #(
        .DATA_w(0)
        .DATA_w(0)
     )
     )
Line 230... Line 230...
    `endif
    `endif
    // synthesis translate_on
    // synthesis translate_on
    // synopsys  translate_on
    // synopsys  translate_on
 
 
 
 
`ifdef SYNC_RESET_MODE
    pronoc_register #(.W(WEIGHTw), .RESET_TO(1)) reg5(
    always @ (posedge clk )begin
                .in             (iport_weight_next ),
`else
                .reset  (reset ),
    always @ (posedge clk or posedge reset)begin
                .clk    (clk   ),
`endif
                .out    (iport_weight  ));
        if(reset) begin
 
              iport_weight <= 1;
 
        end else begin
    always @ (*)begin
              if(hdr_flit_wr != {V{1'b0}})  iport_weight <= (weight_in=={WEIGHTw{1'b0}})? 1 : weight_in; // the minimum weight is 1
        iport_weight_next = iport_weight;
        end
        if(hdr_flit_wr != {V{1'b0}})  iport_weight_next = (weight_in=={WEIGHTw{1'b0}})? 1 : weight_in; // the minimum weight is 1
    end
    end
 
 
 
 
// genrate write enable for lk_routing result with one clock cycle latency after reciveing the flit
// genrate write enable for lk_routing result with one clock cycle latency after reciveing the flit
`ifdef SYNC_RESET_MODE
 
    always @ (posedge clk )begin
    pronoc_register #(.W(V)) reg1(
`else
                .in             (hdr_flit_wr ),
    always @ (posedge clk or posedge reset)begin
                .reset  (reset ),
`endif
                .clk    (clk   ),
        if(reset) begin
                .out    (hdr_flit_wr_delayed  ));
            hdr_flit_wr_delayed <= {V{1'b0}};
 
            //lk_dst_rd_fifo          <= {V{1'b0}};
 
        end else begin
 
            hdr_flit_wr_delayed <= hdr_flit_wr;
 
        //    lk_dst_rd_fifo          <= dst_rd_fifo;
 
        end
 
    end
 
 
 
 
 
genvar i;
genvar i;
generate
generate
    /* verilator lint_off WIDTH */
    /* verilator lint_off WIDTH */
Line 549... Line 545...
    /* verilator lint_off WIDTH */
    /* verilator lint_off WIDTH */
    if(COMBINATION_TYPE == "COMB_NONSPEC") begin  : nonspec
    if(COMBINATION_TYPE == "COMB_NONSPEC") begin  : nonspec
    /* verilator lint_on WIDTH */
    /* verilator lint_on WIDTH */
 
 
        flit_buffer #(
        flit_buffer #(
            .V(V),
 
            .B(B),   // buffer space :flit per VC
            .B(B),   // buffer space :flit per VC
            .PCK_TYPE(PCK_TYPE),
 
            .Fw(Fw),
 
            .DEBUG_EN(DEBUG_EN),
 
            .SSA_EN(SSA_EN)
            .SSA_EN(SSA_EN)
        )
        )
        the_flit_buffer
        the_flit_buffer
        (
        (
            .din(flit_in),     // Data in
            .din(flit_in),     // Data in
Line 567... Line 559...
            .rd_en(any_ivc_sw_request_granted),     // Read the next word
            .rd_en(any_ivc_sw_request_granted),     // Read the next word
            .dout(buffer_out),    // Data out
            .dout(buffer_out),    // Data out
            .vc_not_empty(ivc_not_empty),
            .vc_not_empty(ivc_not_empty),
            .reset(reset),
            .reset(reset),
            .clk(clk),
            .clk(clk),
            .ssa_rd(ssa_ivc_num_getting_sw_grant)
            .ssa_rd(ssa_ivc_num_getting_sw_grant),
 
            .multiple_dest(),
 
            .sub_rd_ptr_ld(),
 
            .flit_is_tail()
        );
        );
 
 
 
 
 
 
         localparam VCw = V *Cw;
         localparam VCw = V *Cw;
Line 634... Line 629...
 
 
    end else begin :spec//not nonspec comb
    end else begin :spec//not nonspec comb
 
 
 
 
        flit_buffer #(
        flit_buffer #(
            .V(V),
 
            .B(B),   // buffer space :flit per VC
            .B(B),   // buffer space :flit per VC
            .PCK_TYPE(PCK_TYPE),
 
            .Fw(Fw),
 
            .DEBUG_EN(DEBUG_EN),
 
            .SSA_EN(SSA_EN)
            .SSA_EN(SSA_EN)
        )
        )
        the_flit_buffer
        the_flit_buffer
        (
        (
            .din(flit_in),     // Data in
            .din(flit_in),     // Data in
Line 652... Line 643...
            .rd_en(any_ivc_sw_request_granted),     // Read the next word
            .rd_en(any_ivc_sw_request_granted),     // Read the next word
            .dout(buffer_out),    // Data out
            .dout(buffer_out),    // Data out
            .vc_not_empty(ivc_not_empty),
            .vc_not_empty(ivc_not_empty),
            .reset(reset),
            .reset(reset),
            .clk(clk),
            .clk(clk),
            .ssa_rd(ssa_ivc_num_getting_sw_grant)
            .ssa_rd(ssa_ivc_num_getting_sw_grant),
 
            .multiple_dest(),
 
            .sub_rd_ptr_ld(),
 
            .flit_is_tail()
 
 
        );
        );
 
 
    end
    end
endgenerate
endgenerate
 
 
Line 711... Line 706...
        .clk (clk)
        .clk (clk)
    );
    );
 
 
    assign flit_wr =(flit_in_wr )? vc_num_in : {V{1'b0}};
    assign flit_wr =(flit_in_wr )? vc_num_in : {V{1'b0}};
 
 
`ifdef SYNC_RESET_MODE
 
    always @ (posedge clk )begin
    pronoc_register #(.W(V)) reg2(
`else
                .in             (dst_rd_fifo ),
    always @ (posedge clk or posedge reset)begin
                .reset  (reset ),
`endif
                .clk    (clk   ),
        if(reset) begin
                .out    (lk_dst_rd_fifo  ));
                lk_dst_rd_fifo          <= {V{1'b0}};
 
        end else begin
 
                lk_dst_rd_fifo          <= dst_rd_fifo;
 
            end
 
    end//always
 
 
 
 
 
    assign    dst_rd_fifo = reset_ivc;
    assign    dst_rd_fifo = reset_ivc;
    assign    class_rd_fifo = (C>1)? reset_ivc : {V{1'bx}};
    assign    class_rd_fifo = (C>1)? reset_ivc : {V{1'bx}};
    assign    ivc_request = ivc_not_empty;
    assign    ivc_request = ivc_not_empty;

powered by: WebSVN 2.1.0

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