`timescale 1ns / 1ps /************************************ mesh_torus_look_ahead_routing *************************************/ module mesh_torus_look_ahead_routing #( parameter NX =4, parameter NY =4, parameter SW_LOC =0, parameter TOPOLOGY ="MESH",//"MESH","TORUS" parameter ROUTE_NAME="XY",// parameter ROUTE_TYPE="DETERMINISTIC"// "DETERMINISTIC", "FULL_ADAPTIVE", "PAR_ADAPTIVE" ) ( current_x, //current router x address current_y, //current router y address dest_x, // destination router x address dest_y, // destination router y address destport_encoded, // current router destination port number lkdestport_encoded, // look ahead destination port number reset, clk ); /* verilator lint_off WIDTH */ localparam P = (TOPOLOGY == "MESH" || TOPOLOGY == "FMESH" || TOPOLOGY == "TORUS")? 5:3; /* verilator lint_on WIDTH */ function integer log2; input integer number; begin log2=(number <=1) ? 1: 0; while(2**log2 destport_in_bin ) ? destport_in_bin : destport_in_bin -1'b1; assign destport_out_bin=temp[P_1w-1 :0]; bin_to_one_hot #( .BIN_WIDTH(P_1w), .ONE_HOT_WIDTH(P_1) ) convert3( .bin_code(destport_out_bin), .one_hot_code(destport_out) ); endmodule /************************************** add_sw_loc_one_hot ****************************************/ module add_sw_loc_one_hot #( parameter P = 5, parameter SW_LOC = 1 ) ( destport_in, destport_out ); localparam P_1 = P-1; input [P_1-1 : 0] destport_in; output reg [P-1 : 0] destport_out; integer i; always @(*)begin for(i=0;iSW_LOC) destport_out[i] = destport_in[i-1]; else if (i==SW_LOC) destport_out[i] = 1'b0; else destport_out[i] = destport_in[i]; end//for end endmodule module add_sw_loc_one_hot_val #( parameter P = 5, parameter SW_LOC = 1 ) ( sw_loc_val, destport_in, destport_out ); localparam P_1 = P-1; input sw_loc_val; input [P_1-1 : 0] destport_in; output reg [P-1 : 0] destport_out; integer i; always @(*)begin for(i=0;iSW_LOC) destport_out[i] = destport_in[i-1]; else if (i==SW_LOC) destport_out[i] = sw_loc_val; else destport_out[i] = destport_in[i]; end//for end endmodule /*************************************************** conventional routing ***************************************************/ module mesh_torus_conventional_routing #( parameter TOPOLOGY = "MESH", parameter ROUTE_NAME = "XY", parameter ROUTE_TYPE = "DETERMINISTIC", parameter NX = 4, parameter NY = 4, parameter LOCATED_IN_NI = 0//use for add even only ) ( current_x, current_y, dest_x, dest_y, destport ); function integer log2; input integer number; begin log2=(number <=1) ? 1: 0; while(2**log2= (NX-2)) && (xd <= (NX-4))) || ((xdiff> 0) && (xd<= (NX-3)))) tranc_x_plus = 1'b1; else tranc_x_min = 1'b1; end end//always assign same_x = (xdiff == 0); always@(*)begin if (same_x ) destport_one_hot= LOCAL; else begin if (tranc_x_plus) destport_one_hot= PLUS; else if (tranc_x_min) destport_one_hot= MINUS; end end line_ring_encode_dstport encode( .dstport_one_hot(destport_one_hot), .dstport_encoded(destport) ); endmodule /******************************************** xy_line *********************************************/ module xy_line_routing #( parameter NX = 8 ) ( current_x, dest_x, destport ); function integer log2; input integer number; begin log2=(number <=1) ? 1: 0; while(2**log2 current_x) destport_one_hot = PLUS [2 :0]; else if (dest_x < current_x) destport_one_hot = MINUS [2 :0]; end line_ring_encode_dstport encode( .dstport_one_hot(destport_one_hot), .dstport_encoded(destport) ); endmodule module line_ring_encode_dstport ( dstport_one_hot, dstport_encoded ); input [2 : 0] dstport_one_hot; output [1 : 0] dstport_encoded; localparam FORWARD = 2'd1, BACKWARD= 2'd2; /************************ destination-port_in 2'b11 : FORWARD or BACKWARD // can be sent to any of them 2'b10 : BACKWARD 2'b01 : FORWARD 2'b00 : LOCAL *******************/ // code the destination port assign dstport_encoded = {dstport_one_hot[BACKWARD], dstport_one_hot[FORWARD]}; endmodule module line_ring_decode_dstport ( dstport_one_hot, dstport_encoded ); output reg [2 : 0] dstport_one_hot; input [1 : 0] dstport_encoded; /************************ localparam FORWARD = 2'd1, BACKWARD= 2'd2; destination-port_in 2'b11 : FORWARD or BACKWARD // can be sey to any of them 2'b10 : BACKWARD 2'b01 : FORWARD 2'b00 : LOCAL *******************/ // code the destination port //assign dstport_encoded = {dstport_one_hot[BACKWARD], dstport_one_hot[FORWARD]}; always @(*)begin dstport_one_hot = 3'b000; case(dstport_encoded) 2'b10 : dstport_one_hot=3'b100; 2'b01 : dstport_one_hot=3'b010; 2'b00 : dstport_one_hot=3'b001; 2'b11 : dstport_one_hot=3'b110; //invalid condition in determinstic routing endcase end //always endmodule module mesh_tori_decode_dstport ( dstport_encoded, dstport_one_hot ); input [3 : 0] dstport_encoded; output reg [4 : 0] dstport_one_hot; wire x,y,a,b; assign {x,y,a,b} = dstport_encoded; always @(*)begin dstport_one_hot = 5'd0; case({a,b}) 2'b10 : dstport_one_hot = {1'b0,~x,1'b0,x,1'b0}; 2'b01 : dstport_one_hot = {~y,1'b0,y,1'b0,1'b0}; 2'b11 : dstport_one_hot = {1'b0,~x,1'b0,x,1'b0}; //illegal 2'b00 : dstport_one_hot = 5'b00001; endcase end //always endmodule

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

diff: : No such file or directory