<commit_before>// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`include "prim_assert.sv"

module otbn_idle_checker
  import otbn_reg_pkg::*;
  import otbn_pkg::*;
(
  input logic         clk_i,
  input logic         rst_ni,

  input otbn_reg2hw_t reg2hw,
  input otbn_hw2reg_t hw2reg,
  input logic         done_i,

  input prim_mubi_pkg::mubi4_t idle_o_i,

  input logic otbn_dmem_scramble_key_req_busy_i,
  input logic otbn_imem_scramble_key_req_busy_i,

  input logic [7:0] status_q_i,
  input logic [38:0] imem_rdata_bus,
  input logic [ExtWLEN-1:0] dmem_rdata_bus,

  input logic locking_i
);

  // Several of the internal signals that we snoop from the otbn module run "a cycle early". This
  // lets the design flop some outputs, but we need to do some converting here to get everything to
  // line up.
  logic rotating_keys, done;
  always_ff @(posedge clk_i or negedge rst_ni) begin
    if (!rst_ni) begin
      rotating_keys <= 1'b0;
      done          <= 1'b0;
    end else begin
      rotating_keys <= otbn_dmem_scramble_key_req_busy_i | otbn_imem_scramble_key_req_busy_i;
      done          <= done_i;
    end
  end

  // Detect writes to CMD. They only take effect if we are in state IDLE
  logic cmd_operation, start_req, do_start;

  assign cmd_operation = reg2hw.cmd.q inside {otbn_pkg::CmdSecWipeImem,
                                              otbn_pkg::CmdSecWipeDmem,
                                              otbn_pkg::CmdExecute};
<commit_msg>[otbn,dv] Remove unused "locking_i" signal to the idle checker<commit_after>// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

`include "prim_assert.sv"

module otbn_idle_checker
  import otbn_reg_pkg::*;
  import otbn_pkg::*;
(
  input logic         clk_i,
  input logic         rst_ni,

  input otbn_reg2hw_t reg2hw,
  input otbn_hw2reg_t hw2reg,
  input logic         done_i,

  input prim_mubi_pkg::mubi4_t idle_o_i,

  input logic otbn_dmem_scramble_key_req_busy_i,
  input logic otbn_imem_scramble_key_req_busy_i,

  input logic [7:0] status_q_i,
  input logic [38:0] imem_rdata_bus,
  input logic [ExtWLEN-1:0] dmem_rdata_bus
);

  // Several of the internal signals that we snoop from the otbn module run "a cycle early". This
  // lets the design flop some outputs, but we need to do some converting here to get everything to
  // line up.
  logic rotating_keys, done;
  always_ff @(posedge clk_i or negedge rst_ni) begin
    if (!rst_ni) begin
      rotating_keys <= 1'b0;
      done          <= 1'b0;
    end else begin
      rotating_keys <= otbn_dmem_scramble_key_req_busy_i | otbn_imem_scramble_key_req_busy_i;
      done          <= done_i;
    end
  end

  // Detect writes to CMD. They only take effect if we are in state IDLE
  logic cmd_operation, start_req, do_start;

  assign cmd_operation = reg2hw.cmd.q inside {otbn_pkg::CmdSecWipeImem,
                                              otbn_pkg::CmdSecWipeDmem,
                                              otbn_pkg::CmdExecute};

{'fraction_non_alphanumeric': 0.07104684061615844, 'fraction_numerical': 0.013203395158755108, 'mean_word_length': 2.765680473372781, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '515974', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1087, 'n_words': 311}