Skip to content

Commit c804450

Browse files
committed
[lc_ctrl,rtl] Adapt KMAC app interface to extended interface
This are the required changes to match the adapted KMAC app interface. Signed-off-by: Pascal Etterli <pascal.etterli@lowrisc.org>
1 parent 2fc354d commit c804450

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

hw/ip/lc_ctrl/rtl/lc_ctrl_kmac_if.sv

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,16 @@ module lc_ctrl_kmac_if
7171
.dst_ack_i ( kmac_ack ),
7272
// Truncate hash to 128bit and remove masking (not required here).
7373
.data_i ( {kmac_data_i.error,
74-
kmac_data_i.digest_share0[LcTokenWidth-1:0] ^
75-
kmac_data_i.digest_share1[LcTokenWidth-1:0]} ),
74+
kmac_data_i.digest_s0[LcTokenWidth-1:0] ^
75+
kmac_data_i.digest_s1[LcTokenWidth-1:0]} ),
7676
.data_o ( {token_hash_err_d,
7777
hashed_token_d} )
7878
);
7979

8080
logic unused_sigs;
8181
assign unused_sigs = ^{
82-
kmac_data_i.digest_share0[LcTokenWidth +: (kmac_pkg::AppDigestW - LcTokenWidth)],
83-
kmac_data_i.digest_share1[LcTokenWidth +: (kmac_pkg::AppDigestW - LcTokenWidth)]
82+
kmac_data_i.digest_s0[LcTokenWidth +: (kmac_pkg::AppDigestW - LcTokenWidth)],
83+
kmac_data_i.digest_s1[LcTokenWidth +: (kmac_pkg::AppDigestW - LcTokenWidth)]
8484
};
8585

8686
// Hashed Token Register Running on LC Clock
@@ -157,36 +157,40 @@ module lc_ctrl_kmac_if
157157
// Serialize the 128bit token into two 64bit beats.
158158
always_comb begin : p_kmac
159159
state_d = state_q;
160-
kmac_data_o = '0;
161160
kmac_ack = 1'b0;
162161
kmac_fsm_err_d = 1'b0;
163162

163+
// LC ctrl operates on unshared data and accepts digest responses immediately.
164+
kmac_data_o = '0;
165+
kmac_data_o.data_s1 = '0;
166+
kmac_data_o.rsp_ready = 1'b1;
167+
164168
unique case (state_q)
165169
// Wait for request and transfer first half of
166170
// LC token.
167171
FirstSt: begin
168172
if (kmac_req) begin
169-
kmac_data_o.valid = 1'b1;
170-
kmac_data_o.strb = 8'hFF;
171-
kmac_data_o.data = kmac_transition_token[0 +: 64];
172-
if (kmac_data_i.ready) begin
173+
kmac_data_o.req_valid = 1'b1;
174+
kmac_data_o.strb = 8'hFF;
175+
kmac_data_o.data_s0 = kmac_transition_token[0 +: 64];
176+
if (kmac_data_i.req_ready) begin
173177
state_d = SecondSt;
174178
end
175179
end
176180
end
177181
// Transfer second half of LC token.
178182
SecondSt: begin
179-
kmac_data_o.valid = 1'b1;
180-
kmac_data_o.strb = 8'hFF;
181-
kmac_data_o.last = 1'b1;
182-
kmac_data_o.data = kmac_transition_token[64 +: 64];
183-
if (kmac_data_i.ready) begin
183+
kmac_data_o.req_valid = 1'b1;
184+
kmac_data_o.strb = 8'hFF;
185+
kmac_data_o.req_last = 1'b1;
186+
kmac_data_o.data_s0 = kmac_transition_token[64 +: 64];
187+
if (kmac_data_i.req_ready) begin
184188
state_d = WaitSt;
185189
end
186190
end
187191
// Wait for hashed token response and go to terminal state.
188192
WaitSt: begin
189-
if (kmac_data_i.done) begin
193+
if (kmac_data_i.rsp_valid) begin
190194
kmac_ack = 1'b1;
191195
state_d = DoneSt;
192196
end

0 commit comments

Comments
 (0)