Skip to content

Commit

Permalink
Merge pull request chipsalliance#193 from chipsalliance/dev-integrate
Browse files Browse the repository at this point in the history
Merge dev-integrate --> main
  • Loading branch information
bharatpillilli authored Aug 25, 2023
2 parents 8bb19ac + d824380 commit 76d7c90
Show file tree
Hide file tree
Showing 269 changed files with 9,185 additions and 1,127 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and<BR>
limitations under the License.*_<BR>

# **Caliptra Hands-On Guide** #
_*Last Update: 2023/07/28*_
_*Last Update: 2023/08/24*_


## **Tools Used** ##
Expand Down
2 changes: 1 addition & 1 deletion Release_Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and<BR>
limitations under the License.*_<BR>

# **Release Notes** #
_*Last Update: 2023/07/26*_
_*Last Update: 2023/08/24*_

## Rev 0p8 ##

Expand Down
Binary file modified docs/Caliptra_Integration_Specification.pdf
Binary file not shown.
Binary file modified docs/Caliptra_TestPlan.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions src/aes/config/aes.vf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_util_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_alert_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_subreg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/aes/config/aes_pkg.vf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_util_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_alert_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_subreg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/ahb_lite_bus/config/ahb_lite_bus.vf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_to_reg_adapter.sv
${CALIPTRA_ROOT}/src/ahb_lite_bus/rtl/ahb_lite_bus_inf.sv
${CALIPTRA_ROOT}/src/ahb_lite_bus/rtl/ahb_lite_address_decoder.sv
Expand Down
36 changes: 22 additions & 14 deletions src/ahb_lite_bus/rtl/ahb_lite_2to1_mux.sv
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module ahb_lite_2to1_mux #(
// ---------------------------------------
input logic hclk,
input logic hreset_n,
input logic force_bus_idle,

// ---------------------------------------
// From Initiator 0
Expand Down Expand Up @@ -81,7 +82,9 @@ module ahb_lite_2to1_mux #(
//Initiator 0 always takes priority

logic initiator0_address_ph, initiator1_address_ph;
logic initiator0_data_ph_nq, initiator1_data_ph_nq;
logic initiator0_data_ph, initiator1_data_ph;
logic initiator0_pend_addr_ph_nq, initiator1_pend_addr_ph_nq;
logic initiator0_pend_addr_ph, initiator1_pend_addr_ph;
logic initiator0_gnt, initiator1_gnt;
logic [AHB_LITE_ADDR_WIDTH-1:0] initiator0_pend_haddr, initiator1_pend_haddr;
Expand All @@ -94,8 +97,8 @@ logic initiator0_pend_hwrite, initiator1_pend_hwrite;
logic initiator0_hwrite, initiator1_hwrite;

//Detect address phase
always_comb initiator0_address_ph = hsel_i_0 & hready_i_0 & htrans_i_0 inside {2'b10, 2'b11};
always_comb initiator1_address_ph = hsel_i_1 & hready_i_1 & htrans_i_1 inside {2'b10, 2'b11};
always_comb initiator0_address_ph = hsel_i_0 & hready_i_0 & htrans_i_0 inside {2'b10, 2'b11} & ~force_bus_idle;
always_comb initiator1_address_ph = hsel_i_1 & hready_i_1 & htrans_i_1 inside {2'b10, 2'b11} & ~force_bus_idle;

always_ff @(posedge hclk or negedge hreset_n) begin
if (~hreset_n) begin
Expand All @@ -107,10 +110,10 @@ always_ff @(posedge hclk or negedge hreset_n) begin
initiator1_pend_hsize <= '0;
initiator0_pend_hwrite <= '0;
initiator1_pend_hwrite <= '0;
initiator0_pend_addr_ph <= '0;
initiator1_pend_addr_ph <= '0;
initiator0_data_ph <= '0;
initiator1_data_ph <= '0;
initiator0_pend_addr_ph_nq <= '0;
initiator1_pend_addr_ph_nq <= '0;
initiator0_data_ph_nq <= '0;
initiator1_data_ph_nq <= '0;
end
else begin
//Capture the address during the address phase for each initiator
Expand All @@ -124,15 +127,20 @@ always_ff @(posedge hclk or negedge hreset_n) begin
initiator1_pend_hwrite <= initiator1_address_ph & ~initiator1_pend_addr_ph ? hwrite_i_1 : initiator1_pend_hwrite;

//Capture pending address phase when initiators collide
initiator0_pend_addr_ph <= (initiator0_address_ph | initiator0_pend_addr_ph) & ~(hreadyout_i & initiator0_gnt);
initiator1_pend_addr_ph <= (initiator1_address_ph | initiator1_pend_addr_ph) & ~(hreadyout_i & initiator1_gnt);
initiator0_pend_addr_ph_nq <= (initiator0_address_ph | initiator0_pend_addr_ph) & ~(hreadyout_i & initiator0_gnt);
initiator1_pend_addr_ph_nq <= (initiator1_address_ph | initiator1_pend_addr_ph) & ~(hreadyout_i & initiator1_gnt);

//Transition to data phase when endpoint accepts address phase, hold when not ready
initiator0_data_ph <= (initiator0_gnt) | (initiator0_data_ph & ~hreadyout_i);
initiator1_data_ph <= (initiator1_gnt) | (initiator1_data_ph & ~hreadyout_i);
initiator0_data_ph_nq <= (initiator0_gnt) | (initiator0_data_ph & ~hreadyout_i);
initiator1_data_ph_nq <= (initiator1_gnt) | (initiator1_data_ph & ~hreadyout_i);
end
end

always_comb initiator0_data_ph = initiator0_data_ph_nq & ~force_bus_idle;
always_comb initiator1_data_ph = initiator1_data_ph_nq & ~force_bus_idle;
always_comb initiator0_pend_addr_ph = initiator0_pend_addr_ph_nq & ~force_bus_idle;
always_comb initiator1_pend_addr_ph = initiator1_pend_addr_ph_nq & ~force_bus_idle;

always_comb initiator0_haddr = initiator0_pend_addr_ph ? initiator0_pend_haddr : haddr_i_0;
always_comb initiator0_htrans = initiator0_pend_addr_ph ? initiator0_pend_htrans : htrans_i_0;
always_comb initiator0_hsize = initiator0_pend_addr_ph ? initiator0_pend_hsize : hsize_i_0;
Expand Down Expand Up @@ -183,13 +191,13 @@ always_comb hready_o = initiator1_gnt | (initiator1_data_ph & ~initiator0_gnt) ?
//Send the data coming from responder when selected
always_comb hresp_o_0 = initiator0_data_ph ? hresp_i : '0;
always_comb hrdata_o_0 = initiator0_data_ph ? hrdata_i : '0;
always_comb hready_o_0 = initiator0_pend_addr_ph ? '0 :
initiator0_data_ph ? hreadyout_i : '1;
always_comb hready_o_0 = initiator0_data_ph ? hreadyout_i :
initiator0_pend_addr_ph ? '0 : '1;

always_comb hresp_o_1 = initiator1_data_ph? hresp_i: '0;
always_comb hrdata_o_1 = initiator1_data_ph ? hrdata_i: '0;
always_comb hready_o_1 = initiator1_pend_addr_ph ? '0 :
initiator1_data_ph ? hreadyout_i : '1;
always_comb hready_o_1 = initiator1_data_ph ? hreadyout_i :
initiator1_pend_addr_ph ? '0 : '1;

`CALIPTRA_ASSERT_MUTEX(ERR_2TO1MUX_MUTEX_DATA_PH, {initiator0_data_ph,initiator1_data_ph}, hclk, hreset_n)
`CALIPTRA_ASSERT_NEVER(ERR_2TO1MUX_BAD_HTRANS, (htrans_o == 2'b01), hclk, hreset_n)
Expand Down
4 changes: 1 addition & 3 deletions src/ahb_lite_bus/rtl/ahb_lite_address_decoder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module ahb_lite_address_decoder #(
// ---------------------------------------
input logic hclk,
input logic hreset_n,

input logic force_bus_idle,
// ---------------------------------------
// From Initiator Interface Port
// ---------------------------------------
Expand Down Expand Up @@ -56,8 +56,6 @@ module ahb_lite_address_decoder #(
output logic [NUM_RESPONDERS-1:0][1:0] htrans_o,
output logic [NUM_RESPONDERS-1:0][2:0] hsize_o,

input logic force_bus_idle,

// ----------------------------------------------
// Responder Disable
// ----------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/caliptra_prim/config/caliptra_prim.vf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_util_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_alert_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_subreg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/csrng/config/csrng.vf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_util_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_alert_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_subreg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/csrng/config/csrng_tb.vf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_util_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_alert_pkg.sv
${CALIPTRA_ROOT}/src/caliptra_prim/rtl/caliptra_prim_subreg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/datavault/config/datavault.vf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/datavault/rtl/dv_defines_pkg.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_to_reg_adapter.sv
${CALIPTRA_ROOT}/src/datavault/rtl/dv_reg_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/doe/config/doe_cbc_tb.vf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/doe/rtl/doe_defines_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/doe/config/doe_core_cbc_tb.vf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/doe/rtl/doe_defines_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/doe/config/doe_ctrl.vf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/doe/rtl/doe_defines_pkg.sv
Expand Down
14 changes: 14 additions & 0 deletions src/ecc/config/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ targets:
- $COMPILE_ROOT/tb/ecc_top_tb.sv
tops: [ecc_top_tb]
---
provides: [ecc_montgomerymultiplier_tb]
schema_version: 2.4.0
requires:
- ecc_top
targets:
tb:
directories:
- $COMPILE_ROOT/tb
files:
- $COMPILE_ROOT/tb/ecc_montgomerymultiplier_tb.sv
tops: [ecc_montgomerymultiplier_tb]
sim:
pre_exec: 'echo "[PRE-EXEC] Copying Mont multiplication test vector to $PWD" && cp $COMPILE_ROOT/tb/test_vectors/mm_test_vectors*.hex .'
---
provides: [ecc_coverage]
schema_version: 2.4.0
requires:
Expand Down
81 changes: 81 additions & 0 deletions src/ecc/config/ecc_montgomerymultiplier_tb.vf
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
+incdir+${CALIPTRA_ROOT}/src/integration/rtl
+incdir+${CALIPTRA_ROOT}/src/libs/rtl
+incdir+${CALIPTRA_ROOT}/src/keyvault/rtl
+incdir+${CALIPTRA_ROOT}/src/pcrvault/rtl
+incdir+${CALIPTRA_ROOT}/src/ecc/tb
+incdir+${CALIPTRA_ROOT}/src/sha512/rtl
+incdir+${CALIPTRA_ROOT}/src/sha512_masked/rtl
+incdir+${CALIPTRA_ROOT}/src/hmac/rtl
+incdir+${CALIPTRA_ROOT}/src/hmac_drbg/rtl
+incdir+${CALIPTRA_ROOT}/src/ecc/rtl
${CALIPTRA_ROOT}/src/integration/rtl/config_defines.svh
${CALIPTRA_ROOT}/src/integration/rtl/caliptra_reg_defines.svh
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_sva.svh
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_macros.svh
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_sram.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_defines_pkg.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_ahb_srom.sv
${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_defines_pkg.sv
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_macros.svh
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_gen_hash.sv
${CALIPTRA_ROOT}/src/ecc/tb/ecc_montgomerymultiplier_tb.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_to_reg_adapter.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_reg_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_reg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_fsm.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_read_client.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_write_client.sv
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_reg_pkg.sv
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_reg.sv
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv.sv
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_reg_pkg.sv
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_params_pkg.sv
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_ctrl.sv
${CALIPTRA_ROOT}/src/sha512/rtl/sha512.sv
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_core.v
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_h_constants.v
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_k_constants.v
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_w_mem.v
${CALIPTRA_ROOT}/src/sha512/rtl/sha512_reg.sv
${CALIPTRA_ROOT}/src/sha512_masked/rtl/sha512_masked_defines_pkg.sv
${CALIPTRA_ROOT}/src/sha512_masked/rtl/sha512_masked_core.sv
${CALIPTRA_ROOT}/src/sha512_masked/rtl/sha512_masked_lfsr.sv
${CALIPTRA_ROOT}/src/hmac/rtl/hmac_param_pkg.sv
${CALIPTRA_ROOT}/src/hmac/rtl/hmac_reg_pkg.sv
${CALIPTRA_ROOT}/src/hmac/rtl/hmac_ctrl.sv
${CALIPTRA_ROOT}/src/hmac/rtl/hmac.sv
${CALIPTRA_ROOT}/src/hmac/rtl/hmac_core.v
${CALIPTRA_ROOT}/src/hmac/rtl/hmac_reg.sv
${CALIPTRA_ROOT}/src/hmac_drbg/rtl/hmac_drbg.sv
${CALIPTRA_ROOT}/src/hmac_drbg/rtl/hmac_drbg_lfsr.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_reg_pkg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_defines_pkg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_params_pkg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_dsa_uop_pkg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pm_uop_pkg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_top.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_reg.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_dsa_ctrl.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_dsa_sequencer.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_scalar_blinding.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_hmac_drbg_interface.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_arith_unit.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pm_ctrl.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pm_sequencer.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_ram_tdp_file.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_fau.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_montgomerymultiplier.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pe_first.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pe.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_pe_final.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_mult_dsp.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_add_sub_mod_alter.sv
${CALIPTRA_ROOT}/src/ecc/rtl/ecc_adder.sv
1 change: 1 addition & 0 deletions src/ecc/config/ecc_top.vf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_defines_pkg.sv
Expand Down
1 change: 1 addition & 0 deletions src/ecc/config/ecc_top_tb.vf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ${CALIPTRA_ROOT}/src/libs/rtl/apb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/ahb_slv_sif.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_icg.sv
${CALIPTRA_ROOT}/src/libs/rtl/clk_gate.sv
${CALIPTRA_ROOT}/src/libs/rtl/caliptra_2ff_sync.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_defines_pkg.sv
${CALIPTRA_ROOT}/src/keyvault/rtl/kv_macros.svh
${CALIPTRA_ROOT}/src/pcrvault/rtl/pv_defines_pkg.sv
Expand Down
44 changes: 44 additions & 0 deletions src/ecc/coverage/ecc_top_cov_if.sv
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,39 @@ interface ecc_top_cov_if
logic pubkeyx_input_outofrange;
logic pubkeyy_input_outofrange;
logic pubkey_input_invalid;
logic pcr_sign_input_invalid;
logic keygen_process;
logic signing_process;
logic verifying_process;


logic mod_p_q;
logic add_en;
logic add_sub_i;
logic [383 : 0] add_res0;
logic add_cout0;
logic add_cout1;
logic add_res_less_than_prime;
logic add_res_greater_than_prime;
logic add_res_greater_than_384_bit;

logic mult_ready;
logic mult_last_reduction;
logic mult_final_subtraction;

assign mod_p_q = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.mod_p_q;
assign add_en = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.add_en_i;
assign add_sub_i = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.sub_i;
assign add_res0 = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.i_ADDER_SUBTRACTOR.r0_reg;
assign add_cout0 = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.i_ADDER_SUBTRACTOR.carry0_reg;
assign add_cout1 = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.i_ADDER_SUBTRACTOR.carry1;
assign add_res_less_than_prime = ((add_cout0 == 1'b0) & (add_res0 < ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.prime_i));
assign add_res_greater_than_prime = ((add_cout0 == 1'b0) & (add_res0 >= ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.prime_i));
assign add_res_greater_than_384_bit = (add_cout0 == 1'b1);

assign mult_ready = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.i_MULTIPLIER.ready_o;
assign mult_last_reduction = ecc_top.ecc_dsa_ctrl_i.ecc_arith_unit_i.ecc_fau_i.i_MULTIPLIER.last_reduction;
assign mult_final_subtraction = mult_ready & mult_last_reduction;

assign ecc_cmd = ecc_top.ecc_dsa_ctrl_i.cmd_reg;
assign pcr_sign_mode = ecc_top.ecc_dsa_ctrl_i.pcr_sign_mode;
Expand All @@ -67,6 +98,8 @@ interface ecc_top_cov_if
assign pubkeyx_input_outofrange = ecc_top.ecc_dsa_ctrl_i.pubkeyx_input_outofrange;
assign pubkeyy_input_outofrange = ecc_top.ecc_dsa_ctrl_i.pubkeyy_input_outofrange;
assign pubkey_input_invalid = ecc_top.ecc_dsa_ctrl_i.pubkey_input_invalid;
assign pcr_sign_input_invalid = ecc_top.ecc_dsa_ctrl_i.pcr_sign_input_invalid;
assign keygen_process = ecc_top.ecc_dsa_ctrl_i.keygen_process;
assign signing_process = ecc_top.ecc_dsa_ctrl_i.signing_process;
assign verifying_process = ecc_top.ecc_dsa_ctrl_i.verifying_process;

Expand All @@ -90,6 +123,7 @@ interface ecc_top_cov_if
pubkeyx_input_outofrange_cp: coverpoint pubkeyx_input_outofrange;
pubkeyy_input_outofrange_cp: coverpoint pubkeyy_input_outofrange;
pubkey_input_invalid_cp: coverpoint pubkey_input_invalid;
pcr_sign_input_invalid_cp: coverpoint pcr_sign_input_invalid;

cmd_ready_cp: cross ecc_sw_cmd, ready;
cmd_kv_cp: cross ecc_cmd, dest_keyvault;
Expand All @@ -99,9 +133,19 @@ interface ecc_top_cov_if
zeroize_cmd_cp: cross zeroize, ecc_cmd;
zeroize_error_cp: cross zeroize, error_flag;
zeroize_ready_cp: cross ready, zeroize;
pcr_sign_input_invalid_cmd_cp: cross error_flag, ecc_cmd;
error_keygen_cp: cross error_flag, keygen_process;
error_signing_cp: cross error_flag, signing_process;
error_verifying_cp: cross error_flag, verifying_process;

// modular operation
mult_final_subtraction_cp: coverpoint mult_final_subtraction;
add_carry_cp: cross mod_p_q, add_sub_i, add_cout0, add_cout1;
add_result_less_than_prime_cp: cross mod_p_q, add_sub_i, add_res_less_than_prime;
add_result_greater_than_prime_cp: cross mod_p_q, add_sub_i, add_res_greater_than_prime;
add_result_greater_than_384_bit_cp: cross mod_p_q, add_sub_i, add_res_greater_than_384_bit;


endgroup

ecc_top_cov_grp ecc_top_cov_grp1 = new();
Expand Down
Loading

0 comments on commit 76d7c90

Please sign in to comment.