/************************************** * Module: emulator * Date:2017-01-20 * Author: alireza * * Description: ***************************************/ `include "pronoc_def.v" module noc_emulator #( parameter NOC_ID=0, // simulation parameter PATTERN_VJTAG_INDEX=125, parameter STATISTIC_VJTAG_INDEX=124 )( jtag_ctrl_reset, start_o, reset, clk, done ); `NOC_CONF parameter MAX_RATIO = 100; parameter RAM_Aw=7; parameter STATISTIC_NUM=8; input reset,jtag_ctrl_reset,clk; output done; output start_o; localparam PCK_CNTw =30, // 1 G packets PCK_SIZw =14, // 16 K flit MAX_EAw =8, MAX_Cw =4; // 16 message classes //localparam MAX_SIM_CLKs = 1_000_000_000; reg start_i; reg [10:0] cnt; assign start_o=start_i; //noc connection channels smartflit_chanel_t chan_in_all [NE-1 : 0]; smartflit_chanel_t chan_out_all [NE-1 : 0]; noc_top # ( .NOC_ID(NOC_ID) ) the_top ( .reset(reset), .clk(clk), .chan_in_all(chan_in_all), .chan_out_all(chan_out_all), .router_event() ); Jtag_traffic_gen #( .NOC_ID(NOC_ID), .PATTERN_VJTAG_INDEX(PATTERN_VJTAG_INDEX), .STATISTIC_VJTAG_INDEX(STATISTIC_VJTAG_INDEX), .MAX_RATIO(MAX_RATIO), .RAM_Aw(RAM_Aw), .STATISTIC_NUM(STATISTIC_NUM), // the last 8 rows of RAM is reserved for collecting statistic values; .PCK_CNTw(PCK_CNTw), // 1 G packets .PCK_SIZw(PCK_SIZw), // 16 K flit .MAX_EAw(MAX_EAw), // 16 nodes in x dimension .MAX_Cw(MAX_Cw) // 16 message class ) the_traffic_gen ( .start_i(start_i), .jtag_ctrl_reset(jtag_ctrl_reset), .reset(reset), .clk(clk), .done(done), //noc .chan_in_all(chan_out_all), .chan_out_all(chan_in_all) ); always @(posedge clk or posedge reset) begin if(reset) begin cnt <=0; start_i <=0; end else begin if(cnt < 1020) cnt<= cnt+1'b1; if(cnt== 1000)begin start_i<=1'b1; end else if(cnt== 1010)begin start_i<=1'b0; end end end endmodule /*************** Jtag_traffic_gen: A traffic generator which can be programed using JTAG port ****************/ module Jtag_traffic_gen #( parameter NOC_ID = 0, parameter PATTERN_VJTAG_INDEX=125, parameter STATISTIC_VJTAG_INDEX=124, parameter RAM_Aw=7, parameter STATISTIC_NUM=8, parameter MAX_RATIO = 100, parameter PCK_CNTw =30, // 1 G packets parameter PCK_SIZw =14, // 16 K flit parameter MAX_EAw =8, parameter MAX_Cw =4 // 16 message class ) ( chan_in_all, chan_out_all, done, start_i, jtag_ctrl_reset, reset, clk ); `NOC_CONF input reset,jtag_ctrl_reset, clk; input start_i; output done; // NOC interfaces input smartflit_chanel_t chan_in_all [NE-1 : 0]; output smartflit_chanel_t chan_out_all [NE-1 : 0]; wire [NE-1 : 0] start; wire [NE-1 : 0] done_sep; assign done = &done_sep; start_delay_gen #( .NC(NE) //number of cores ) st_gen ( .clk(clk), .reset(reset), .start_i(start_i), .start_o(start) ); //jtag pattern controller localparam NEw=$clog2(NE), Dw=64, Aw =RAM_Aw; wire [Dw-1 : 0] jtag_data ; wire [Aw-1 : 0] jtag_addr ; wire jtag_we; wire [Dw-1 : 0] jtag_q ; wire [NEw-1: 0] jtag_RAM_select; wire [NE-1 : 0] jtag_we_sep; wire [Dw-1 : 0] jtag_q_sep [NE-1 : 0]; assign jtag_q = jtag_q_sep[jtag_RAM_select]; jtag_emulator_controller #( .VJTAG_INDEX(PATTERN_VJTAG_INDEX), .Dw(Dw), .Aw(Aw+NEw) ) pttern_jtag_controller ( .dat_o(jtag_data), .addr_o({jtag_RAM_select,jtag_addr}), .we_o(jtag_we), .q_i(jtag_q), .clk(clk), .reset(jtag_ctrl_reset) ); //jtag statistic reader localparam STATISw=log2(STATISTIC_NUM); wire [STATISw-1 : 0] statis_jtag_addr ; wire [Dw-1 : 0] statis_jtag_data_i; wire [NEw-1: 0] statis_jtag_select; wire [Dw-1 : 0] statis_jtag_q_sep [NE-1 : 0]; assign statis_jtag_data_i = statis_jtag_q_sep[statis_jtag_select]; jtag_emulator_controller #( .VJTAG_INDEX(STATISTIC_VJTAG_INDEX), .Dw(Dw), .Aw(STATISw+NEw) ) jtag_statistic_reader ( .dat_o(), .addr_o({statis_jtag_select,statis_jtag_addr}), .we_o( ), .q_i(statis_jtag_data_i), .clk(clk), .reset(jtag_ctrl_reset) ); function integer addrencode; input integer pos,k,n,kw; integer pow,i,tmp;begin addrencode=0; pow=1; for (i = 0; i 4'd0 && counter<=4'b1111) counter <=counter+1'b1; end end assign start_traffic = counter == 4'b1100; // delaied for 12 clock cycles traffic_gen_top #( .NOC_ID(NOC_ID), .MAX_RATIO(MAX_RATIO) ) the_traffic_gen ( .reset(reset), .clk(clk), //input .ratio (ratio), .start(start_traffic), .stop(stop), .pck_size_in(pck_size_in), .current_e_addr(current_e_addr), .dest_e_addr(dest_e_addr), .pck_class_in(pck_class), .init_weight({WEIGHTw{1'b0}}), .report ( ), //output .update(update), // update the noc_analayzer .src_e_addr( ), .pck_number( ), .sent_done(sent_done), // tail flit has been sent .hdr_flit_sent( ), .distance( ), .pck_class_out( ), .time_stamp_h2h( ), .time_stamp_h2t(time_stamp_h2t), .flit_out_class(), //noc .chan_in(chan_in), .chan_out(chan_out), .mcast_dst_num_o() ); always @ (*)begin case (statistic_jtag_addr_b) SENT_PCK_ADDR: statistic_jtag_q_b= total_pck_sent; RSVD_PCK_ADDR: statistic_jtag_q_b= total_pck_recieved; TOTAL_LATENCY_ADDR: statistic_jtag_q_b= total_latency_cnt; WORST_LATENCY_ADDR: statistic_jtag_q_b= worst_latency; default: statistic_jtag_q_b= worst_latency; endcase end always @ (*)begin ns=ps; addr_a_next = addr_a; pck_number_sent_next = pck_number_sent; done_next =done; total_latency_cnt_next = total_latency_cnt; worst_latency_next = worst_latency; total_pck_recieved_next = total_pck_recieved; total_pck_sent_next = total_pck_sent; ram_counter_next = ram_counter; data_a = total_pck_sent; we_a = 0; stop=1'b0; if(update)begin total_latency_cnt_next = total_latency_cnt + time_stamp_h2t; if(time_stamp_h2t >worst_latency ) worst_latency_next=time_stamp_h2t; total_pck_recieved_next =total_pck_recieved+1'b1; end if(sent_done)begin pck_number_sent_next =pck_number_sent+1'b1; total_pck_sent_next =total_pck_sent+1'b1; end case(ps) IDEAL : begin done_next =1'b0; addr_a_next =RAM_CNT_ADDR; ram_counter_next = q_a[31:0]; // first ram data shows how many times the RAM is needed to ne read if( start) begin addr_a_next=PATTERN_START_ADDR; ns= WAIT1; end end//IDEAL WAIT1 : begin ns= WAIT2; end WAIT2 : begin ns= SEND_PCK; end SEND_PCK: begin if (reset_pck_number_sent) begin pck_number_sent_next={PCK_CNTw{1'b0}}; if(last_adr_in)begin if(ram_counter==0)begin ns = ASSET_DONE;// SAVE_SENT_PCK_NUM; //addr_a_next = SENT_PCK_ADDR; end else addr_a_next = 1; ram_counter_next=ram_counter-1'b1; end else begin addr_a_next=addr_a+1'b1; end end end//SEND_PCk /* SAVE_SENT_PCK_NUM: begin data_a = total_pck_sent; we_a = 1; addr_a_next =RSVD_PCK_ADDR ; ns= SAVE_RSVD_PCK_NUM; end SAVE_RSVD_PCK_NUM: begin data_a = total_pck_recieved; addr_a_next =TOTAL_LATENCY_ADDR; we_a = 1; ns= SAVE_TOTAL_LATENCY_NUM; end SAVE_TOTAL_LATENCY_NUM: begin data_a = total_latency_cnt; addr_a_next =WORST_LATENCY_ADDR; we_a = 1; ns=SAVE_WORST_LATENCY_NUM; end SAVE_WORST_LATENCY_NUM:begin data_a = worst_latency; we_a = 1; ns= ASSET_DONE; end */ ASSET_DONE: begin done_next =1'b1; stop=1'b1; end endcase end//always always @(posedge clk) begin if(reset)begin ps <= IDEAL; addr_a <={Aw{1'b0}}; pck_number_sent<={PCK_CNTw{1'b0}}; done<=1'b0; total_latency_cnt<=64'd0; total_pck_recieved<=64'd0; total_pck_sent<=64'd0; ram_counter<= 32'd0; nvalid_dest<=1'b0; reset_pck_number_sent_old<=1'b0; worst_latency<={CLK_CNTw{1'b0}}; end else begin ps <= ns; addr_a<= addr_a_next; pck_number_sent<= pck_number_sent_next; done <=done_next; total_latency_cnt<= total_latency_cnt_next; total_pck_recieved<= total_pck_recieved_next; total_pck_sent<= total_pck_sent_next; ram_counter<= ram_counter_next; nvalid_dest<=nvalid_dest_next; reset_pck_number_sent_old<=reset_pck_number_sent; worst_latency<=worst_latency_next; end end endmodule /*********************** * * jtag_emulator_controller * ***********************/ module jtag_emulator_controller #( parameter VJTAG_INDEX=125, parameter Dw=32, parameter Aw=32 )( clk, reset, //wishbone master interface signals dat_o, addr_o, we_o, q_i ); //IO declaration input reset,clk; //wishbone master interface signals output [Dw-1 : 0] dat_o; output [Aw-1 : 0] addr_o; output we_o; input [Dw-1 : 0] q_i; localparam STATE_NUM=3, IDEAL =1, WB_WR_DATA=2, WB_RD_DATA=4; reg [STATE_NUM-1 : 0] ps,ns; wire [Dw-1 :0] data_out, data_in; wire wb_wr_addr_en, wb_wr_data_en, wb_rd_data_en; reg wr_mem_en, wb_cap_rd; reg [Aw-1 : 0] wb_addr,wb_addr_next; reg [Dw-1 : 0] wb_wr_data,wb_rd_data; reg wb_addr_inc; assign we_o = wr_mem_en; assign dat_o = wb_wr_data; assign addr_o = wb_addr; assign data_in = wb_rd_data; //vjtag vjtag signals declaration localparam VJ_DW= (Dw > Aw)? Dw : Aw; vjtag_ctrl #( .DW(VJ_DW), .VJTAG_INDEX(VJTAG_INDEX) ) vjtag_ctrl_inst ( .clk(clk), .reset(reset), .data_out(data_out), .data_in(data_in), .wb_wr_addr_en(wb_wr_addr_en), .wb_wr_data_en(wb_wr_data_en), .wb_rd_data_en(wb_rd_data_en), .status_i( ) ); always @(posedge clk or posedge reset) begin if(reset) begin wb_addr <= {Aw{1'b0}}; wb_wr_data <= {Dw{1'b0}}; ps <= IDEAL; end else begin wb_addr <= wb_addr_next; ps <= ns; if(wb_wr_data_en) wb_wr_data <= data_out; if(wb_cap_rd) wb_rd_data <= q_i; end end always @(*)begin wb_addr_next= wb_addr; if(wb_wr_addr_en) wb_addr_next = data_out [Aw-1 : 0]; else if (wb_addr_inc) wb_addr_next = wb_addr + 1'b1; end always @(*)begin ns=ps; wr_mem_en =1'b0; wb_addr_inc=1'b0; wb_cap_rd=1'b0; case(ps) IDEAL : begin if(wb_wr_data_en) ns= WB_WR_DATA; if(wb_rd_data_en) ns= WB_RD_DATA; end WB_WR_DATA: begin wr_mem_en =1'b1; ns=IDEAL; wb_addr_inc=1'b1; end WB_RD_DATA: begin wb_cap_rd=1'b1; ns=IDEAL; //wb_addr_inc=1'b1; end endcase end //assign led={wb_addr[7:0], wb_wr_data[7:0]}; endmodule

Error running this command: diff -w -U 5 "/tmp/80IaV5" ""

diff: : No such file or directory