Skip to content

Commit

Permalink
update to new user field
Browse files Browse the repository at this point in the history
  • Loading branch information
volkamir committed Jun 8, 2023
1 parent 3dd5807 commit 74f1879
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 35 deletions.
11 changes: 7 additions & 4 deletions umi/rtl/umi_endpoint.v
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
30 changes: 12 additions & 18 deletions umi/rtl/umi_pack.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand All @@ -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]};
Expand All @@ -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(
Expand Down
11 changes: 7 additions & 4 deletions umi/rtl/umi_regif.v
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 5 additions & 9 deletions umi/rtl/umi_unpack.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down Expand Up @@ -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

0 comments on commit 74f1879

Please sign in to comment.