diff --git a/umi/rtl/umi_endpoint.v b/umi/rtl/umi_endpoint.v index 96a24c2..52f957f 100644 --- a/umi/rtl/umi_endpoint.v +++ b/umi/rtl/umi_endpoint.v @@ -82,7 +82,8 @@ module umi_endpoint wire [4:0] loc_hostid; wire [1:0] loc_prot; wire [3:0] loc_qos; - wire [22:0] loc_user; + wire [1:0] loc_user; + wire [18:0] loc_user_extended; wire [CW-1:0] packet_cmd; // End of automatics @@ -121,7 +122,8 @@ module umi_endpoint .cmd_eom (loc_eom), // Templated .cmd_eof (loc_eof), // Templated .cmd_ex (loc_ex), // Templated - .cmd_user (loc_user[22:0]), // Templated + .cmd_user (loc_user[1:0]), // Templated + .cmd_user_extended(loc_user_extended[18:0]), // Templated .cmd_err (loc_err[1:0]), // Templated .cmd_hostid (loc_hostid[4:0]), // Templated // Inputs @@ -217,10 +219,11 @@ module umi_endpoint .cmd_qos (loc_qos[3:0]), // Templated .cmd_eom (loc_eom), // Templated .cmd_eof (loc_eof), // Templated - .cmd_user (loc_user[18:0]), // Templated + .cmd_user (loc_user[1:0]), // Templated .cmd_err (loc_err[1:0]), // Templated .cmd_ex (loc_ex), // Templated - .cmd_hostid (loc_hostid[4:0])); // Templated + .cmd_hostid (loc_hostid[4:0]), // Templated + .cmd_user_extended (loc_user_extended[18:0])); // Templated always @ (posedge clk or negedge nreset) if (!nreset) diff --git a/umi/rtl/umi_pack.v b/umi/rtl/umi_pack.v index bce7012..7a64d4a 100644 --- a/umi/rtl/umi_pack.v +++ b/umi/rtl/umi_pack.v @@ -18,10 +18,11 @@ module umi_pack #(parameter CW = 32) input [3:0] cmd_qos, input cmd_eom, input cmd_eof, - input [18:0] cmd_user, + input [1:0] cmd_user, input [1:0] cmd_err, input cmd_ex, input [4:0] cmd_hostid, + input [18:0] cmd_user_extended, // Output packet output [CW-1:0] packet_cmd ); @@ -33,6 +34,9 @@ module umi_pack #(parameter CW = 32) wire cmd_link; wire cmd_link_resp; wire cmd_atomic; + wire extended_user_sel; + + assign extended_user_sel = cmd_link | cmd_link_resp | cmd_err; // Take only the required fields for the decode assign cmd_in[31:0] = {24'h00_0000,cmd_size[2:0],cmd_opcode[4:0]}; @@ -45,24 +49,14 @@ module umi_pack #(parameter CW = 32) cmd_error ? 3'h0 : cmd_size[2:0]; - assign cmd_out[15:8] = cmd_atomic ? cmd_atype[7:0] : - (cmd_error | - cmd_link | - cmd_link_resp) ? cmd_user[7:0] : - cmd_len[7:0]; - - assign cmd_out[19:16] = (cmd_link | cmd_link_resp) ? cmd_user[11:8] : cmd_qos[3:0]; - - assign cmd_out[21:20] = (cmd_link | cmd_link_resp) ? cmd_user[13:12] : cmd_prot[1:0]; - - assign cmd_out[24:22] = (cmd_link | cmd_link_resp) ? cmd_user[16:14] : - cmd_error ? cmd_user[10:8] : - {cmd_ex,cmd_eof,cmd_eom}; - - assign cmd_out[26:25] = cmd_link ? cmd_user[18:17] : - (cmd_response | cmd_error) ? cmd_err[1:0] : - cmd_user[1:0] ; + assign cmd_out[15:8] = cmd_atomic ? cmd_atype[7:0] : + extended_user_sel ? cmd_user_extended[7:0] : + cmd_len[7:0]; + assign cmd_out[19:16] = extended_user_sel ? cmd_user_extended[11:8] : cmd_qos[3:0]; + assign cmd_out[21:20] = extended_user_sel ? cmd_user_extended[13:12] : cmd_prot[1:0]; + assign cmd_out[24:22] = extended_user_sel ? cmd_user_extended[16:14] : {cmd_ex,cmd_eof,cmd_eom}; + assign cmd_out[26:25] = extended_user_sel ? cmd_user_extended[18:17] : cmd_user[1:0] ; assign cmd_out[31:27] = cmd_hostid[4:0]; /*umi_decode AUTO_TEMPLATE( diff --git a/umi/rtl/umi_regif.v b/umi/rtl/umi_regif.v index 91a83c5..68aef1e 100644 --- a/umi/rtl/umi_regif.v +++ b/umi/rtl/umi_regif.v @@ -90,7 +90,8 @@ module umi_regif wire [4:0] reg_hostid; wire [1:0] reg_prot; wire [3:0] reg_qos; - wire [22:0] reg_user; + wire [1:0] reg_user; + wire [18:0] reg_user_extended; // End of automatics wire [4:0] cmd_opcode; @@ -119,7 +120,8 @@ module umi_regif .cmd_eom (reg_eom), // Templated .cmd_eof (reg_eof), // Templated .cmd_ex (reg_ex), // Templated - .cmd_user (reg_user[22:0]), // Templated + .cmd_user (reg_user[1:0]), // Templated + .cmd_user_extended(reg_user_extended[18:0]), // Templated .cmd_err (reg_err[1:0]), // Templated .cmd_hostid (reg_hostid[4:0]), // Templated // Inputs @@ -224,10 +226,11 @@ module umi_regif .cmd_qos (reg_qos[3:0]), // Templated .cmd_eom (reg_eom), // Templated .cmd_eof (reg_eof), // Templated - .cmd_user (reg_user[18:0]), // Templated + .cmd_user (reg_user[1:0]), // Templated .cmd_err (reg_err[1:0]), // Templated .cmd_ex (reg_ex), // Templated - .cmd_hostid (reg_hostid[4:0])); // Templated + .cmd_hostid (reg_hostid[4:0]), // Templated + .cmd_user_extended (reg_user_extended[18:0])); // Templated // Amir - response fields cannot assume that the request will be help // Therefore they need to be sampled when the request is acknowledged diff --git a/umi/rtl/umi_unpack.v b/umi/rtl/umi_unpack.v index deb756e..77a0e4d 100644 --- a/umi/rtl/umi_unpack.v +++ b/umi/rtl/umi_unpack.v @@ -36,7 +36,8 @@ module umi_unpack output cmd_eom, output cmd_eof, output cmd_ex, - output [22:0] cmd_user, + output [1:0] cmd_user, + output [18:0] cmd_user_extended, output [1:0] cmd_err, output [4:0] cmd_hostid ); @@ -104,14 +105,9 @@ module umi_unpack assign cmd_eof = packet_cmd[23]; // Ignore for error and responses assign cmd_ex = packet_cmd[24]; // Ignore for error and responses assign cmd_hostid[4:0] = packet_cmd[31:27]; + assign cmd_user[1:0] = packet_cmd[26:25]; + assign cmd_err[1:0] = cmd_response ? packet_cmd[26:25] : 2'h0; - assign cmd_user[18:0] = cmd_link ? packet_cmd[26:8] : - cmd_link_resp ? {2'h0,packet_cmd[24:8]} : - cmd_error ? {8'h00,packet_cmd[24:22],packet_cmd[15:8]} : - cmd_request ? {17'h0_0000,packet_cmd[26:25]} : - 19'h0_0000 ; - - assign cmd_err[1:0] = (cmd_response | cmd_error) ? packet_cmd[26:25] : - 2'h0; + assign cmd_user_extended[18:0] = packet_cmd[26:8]; endmodule // umi_unpack