Module Definition
dashboard | hierarchy | modlist | groups | tests | asserts



Module Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
98.33 91.67 100.00 100.00 100.00 100.00 u_otp_ctrl_scrmbl


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
no children



Module Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec

Instance :
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00 100.00


Instance's subtree :
SCORELINECONDTOGGLEFSMBRANCHASSERT
100.00 100.00 100.00 100.00 100.00


Parent :
SCORELINECONDTOGGLEFSMBRANCHASSERTNAME
98.33 91.67 100.00 100.00 100.00 100.00 u_otp_ctrl_scrmbl


Subtrees :
NAMESCORELINECONDTOGGLEFSMBRANCHASSERT
no children

Line Coverage for Module : prim_present ( parameter DataWidth=64,KeyWidth=128,NumRounds=31,NumPhysRounds=1,Decrypt=0 )
Line Coverage for Module self-instances :
SCORELINE
100.00 100.00
tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc

Line No.TotalCoveredPercent
TOTAL1111100.00
CONT_ASSIGN6211100.00
CONT_ASSIGN6311100.00
CONT_ASSIGN6411100.00
CONT_ASSIGN6911100.00
CONT_ASSIGN10611100.00
CONT_ASSIGN10911100.00
CONT_ASSIGN11111100.00
CONT_ASSIGN12311100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN14511100.00

61 // initialize 62 1/1 assign data_state[0] = data_i; Tests: T1 T2 T3  63 1/1 assign round_key[0] = key_i; Tests: T1 T2 T3  64 1/1 assign round_idx[0] = idx_i; Tests: T1 T2 T3  65 66 for (genvar k = 0; k < NumPhysRounds; k++) begin : gen_round 67 logic [DataWidth-1:0] data_state_xor, data_state_sbox; 68 // cipher layers 69 1/1 assign data_state_xor = data_state[k] ^ round_key[k][KeyWidth-1 : KeyWidth-DataWidth]; Tests: T1 T2 T3  70 //////////////////////////////// 71 // decryption pass, performs inverse permutation, sbox and keyschedule 72 if (Decrypt) begin : gen_dec 73 // Decrement round count. 74 assign round_idx[k+1] = round_idx[k] - 1'b1; 75 // original 64bit variant 76 if (DataWidth == 64) begin : gen_d64 77 assign data_state_sbox = prim_cipher_pkg::perm_64bit(data_state_xor, 78 prim_cipher_pkg::PRESENT_PERM64_INV); 79 assign data_state[k+1] = prim_cipher_pkg::sbox4_64bit(data_state_sbox, 80 prim_cipher_pkg::PRESENT_SBOX4_INV); 81 // reduced 32bit variant 82 end else begin : gen_d32 83 assign data_state_sbox = prim_cipher_pkg::perm_32bit(data_state_xor, 84 prim_cipher_pkg::PRESENT_PERM32_INV); 85 assign data_state[k+1] = prim_cipher_pkg::sbox4_32bit(data_state_sbox, 86 prim_cipher_pkg::PRESENT_SBOX4_INV); 87 end 88 // update round key, count goes from 1 to 31 (max) 89 // original 128bit key variant 90 if (KeyWidth == 128) begin : gen_k128 91 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key128(round_key[k], 92 round_idx[k]); 93 // original 80bit key variant 94 end else if (KeyWidth == 80) begin : gen_k80 95 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key80(round_key[k], 96 round_idx[k]); 97 // reduced 64bit key variant 98 end else begin : gen_k64 99 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key64(round_key[k], 100 round_idx[k]); 101 end 102 //////////////////////////////// 103 // encryption pass 104 end else begin : gen_enc 105 // Increment round count. 106 1/1 assign round_idx[k+1] = round_idx[k] + 1'b1; Tests: T1 T2 T3  107 // original 64bit variant 108 if (DataWidth == 64) begin : gen_d64 109 1/1 assign data_state_sbox = prim_cipher_pkg::sbox4_64bit(data_state_xor, Tests: T1 T2 T3  110 prim_cipher_pkg::PRESENT_SBOX4); 111 1/1 assign data_state[k+1] = prim_cipher_pkg::perm_64bit(data_state_sbox, Tests: T1 T2 T3  112 prim_cipher_pkg::PRESENT_PERM64); 113 // reduced 32bit variant 114 end else begin : gen_d32 115 assign data_state_sbox = prim_cipher_pkg::sbox4_32bit(data_state_xor, 116 prim_cipher_pkg::PRESENT_SBOX4); 117 assign data_state[k+1] = prim_cipher_pkg::perm_32bit(data_state_sbox, 118 prim_cipher_pkg::PRESENT_PERM32); 119 end 120 // update round key, count goes from 1 to 31 (max) 121 // original 128bit key variant 122 if (KeyWidth == 128) begin : gen_k128 123 1/1 assign round_key[k+1] = prim_cipher_pkg::present_update_key128(round_key[k], round_idx[k]); Tests: T1 T2 T3  124 // original 80bit key variant 125 end else if (KeyWidth == 80) begin : gen_k80 126 assign round_key[k+1] = prim_cipher_pkg::present_update_key80(round_key[k], round_idx[k]); 127 // reduced 64bit key variant 128 end else begin : gen_k64 129 assign round_key[k+1] = prim_cipher_pkg::present_update_key64(round_key[k], round_idx[k]); 130 end 131 end // gen_enc 132 //////////////////////////////// 133 end // gen_round 134 135 // This only needs to be applied after the last round. 136 // Note that for a full-round implementation the output index 137 // will be 0 for enc/dec for the last round (either due to wraparound or subtraction). 138 localparam int LastRoundIdx = (Decrypt != 0 || NumRounds == 31) ? 0 : NumRounds+1; 139 1/1 assign data_o = (int'(idx_o) == LastRoundIdx) ? Tests: T1 T2 T3  140 data_state[NumPhysRounds] ^ 141 round_key[NumPhysRounds][KeyWidth-1 : KeyWidth-DataWidth] : 142 data_state[NumPhysRounds]; 143 144 1/1 assign key_o = round_key[NumPhysRounds]; Tests: T1 T2 T3  145 1/1 assign idx_o = round_idx[NumPhysRounds]; Tests: T1 T2 T3 

Line Coverage for Module : prim_present ( parameter DataWidth=64,KeyWidth=128,NumRounds=31,NumPhysRounds=1,Decrypt=1 )
Line Coverage for Module self-instances :
SCORELINE
100.00 100.00
tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec

Line No.TotalCoveredPercent
TOTAL1111100.00
CONT_ASSIGN6211100.00
CONT_ASSIGN6311100.00
CONT_ASSIGN6411100.00
CONT_ASSIGN6911100.00
CONT_ASSIGN7411100.00
CONT_ASSIGN7711100.00
CONT_ASSIGN7911100.00
CONT_ASSIGN9111100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN14511100.00

61 // initialize 62 1/1 assign data_state[0] = data_i; Tests: T1 T2 T3  63 1/1 assign round_key[0] = key_i; Tests: T1 T2 T3  64 1/1 assign round_idx[0] = idx_i; Tests: T1 T2 T3  65 66 for (genvar k = 0; k < NumPhysRounds; k++) begin : gen_round 67 logic [DataWidth-1:0] data_state_xor, data_state_sbox; 68 // cipher layers 69 1/1 assign data_state_xor = data_state[k] ^ round_key[k][KeyWidth-1 : KeyWidth-DataWidth]; Tests: T1 T2 T3  70 //////////////////////////////// 71 // decryption pass, performs inverse permutation, sbox and keyschedule 72 if (Decrypt) begin : gen_dec 73 // Decrement round count. 74 1/1 assign round_idx[k+1] = round_idx[k] - 1'b1; Tests: T1 T2 T3  75 // original 64bit variant 76 if (DataWidth == 64) begin : gen_d64 77 1/1 assign data_state_sbox = prim_cipher_pkg::perm_64bit(data_state_xor, Tests: T1 T2 T3  78 prim_cipher_pkg::PRESENT_PERM64_INV); 79 1/1 assign data_state[k+1] = prim_cipher_pkg::sbox4_64bit(data_state_sbox, Tests: T1 T2 T3  80 prim_cipher_pkg::PRESENT_SBOX4_INV); 81 // reduced 32bit variant 82 end else begin : gen_d32 83 assign data_state_sbox = prim_cipher_pkg::perm_32bit(data_state_xor, 84 prim_cipher_pkg::PRESENT_PERM32_INV); 85 assign data_state[k+1] = prim_cipher_pkg::sbox4_32bit(data_state_sbox, 86 prim_cipher_pkg::PRESENT_SBOX4_INV); 87 end 88 // update round key, count goes from 1 to 31 (max) 89 // original 128bit key variant 90 if (KeyWidth == 128) begin : gen_k128 91 1/1 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key128(round_key[k], Tests: T1 T2 T3  92 round_idx[k]); 93 // original 80bit key variant 94 end else if (KeyWidth == 80) begin : gen_k80 95 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key80(round_key[k], 96 round_idx[k]); 97 // reduced 64bit key variant 98 end else begin : gen_k64 99 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key64(round_key[k], 100 round_idx[k]); 101 end 102 //////////////////////////////// 103 // encryption pass 104 end else begin : gen_enc 105 // Increment round count. 106 assign round_idx[k+1] = round_idx[k] + 1'b1; 107 // original 64bit variant 108 if (DataWidth == 64) begin : gen_d64 109 assign data_state_sbox = prim_cipher_pkg::sbox4_64bit(data_state_xor, 110 prim_cipher_pkg::PRESENT_SBOX4); 111 assign data_state[k+1] = prim_cipher_pkg::perm_64bit(data_state_sbox, 112 prim_cipher_pkg::PRESENT_PERM64); 113 // reduced 32bit variant 114 end else begin : gen_d32 115 assign data_state_sbox = prim_cipher_pkg::sbox4_32bit(data_state_xor, 116 prim_cipher_pkg::PRESENT_SBOX4); 117 assign data_state[k+1] = prim_cipher_pkg::perm_32bit(data_state_sbox, 118 prim_cipher_pkg::PRESENT_PERM32); 119 end 120 // update round key, count goes from 1 to 31 (max) 121 // original 128bit key variant 122 if (KeyWidth == 128) begin : gen_k128 123 assign round_key[k+1] = prim_cipher_pkg::present_update_key128(round_key[k], round_idx[k]); 124 // original 80bit key variant 125 end else if (KeyWidth == 80) begin : gen_k80 126 assign round_key[k+1] = prim_cipher_pkg::present_update_key80(round_key[k], round_idx[k]); 127 // reduced 64bit key variant 128 end else begin : gen_k64 129 assign round_key[k+1] = prim_cipher_pkg::present_update_key64(round_key[k], round_idx[k]); 130 end 131 end // gen_enc 132 //////////////////////////////// 133 end // gen_round 134 135 // This only needs to be applied after the last round. 136 // Note that for a full-round implementation the output index 137 // will be 0 for enc/dec for the last round (either due to wraparound or subtraction). 138 localparam int LastRoundIdx = (Decrypt != 0 || NumRounds == 31) ? 0 : NumRounds+1; 139 1/1 assign data_o = (int'(idx_o) == LastRoundIdx) ? Tests: T1 T2 T3  140 data_state[NumPhysRounds] ^ 141 round_key[NumPhysRounds][KeyWidth-1 : KeyWidth-DataWidth] : 142 data_state[NumPhysRounds]; 143 144 1/1 assign key_o = round_key[NumPhysRounds]; Tests: T1 T2 T3  145 1/1 assign idx_o = round_idx[NumPhysRounds]; Tests: T1 T2 T3 

Cond Coverage for Module : prim_present
TotalCoveredPercent
Conditions22100.00
Logical22100.00
Non-Logical00
Event00

 LINE       139
 EXPRESSION 
 Number  Term
      1  (int'(idx_o) == LastRoundIdx) ? ((data_state[NumPhysRounds] ^ round_key[NumPhysRounds][(KeyWidth - 1):(KeyWidth - DataWidth)])) : data_state[NumPhysRounds])
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

 LINE       139
 SUB-EXPRESSION (int'(idx_o) == LastRoundIdx)
                --------------1--------------
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

Branch Coverage for Module : prim_present
Line No.TotalCoveredPercent
Branches 1 1 100.00
TERNARY 139 1 1 100.00


139 assign data_o = (int'(idx_o) == LastRoundIdx) ? -1- ==> ==> (Unreachable)

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Unreachable T1,T2,T3


Assert Coverage for Module : prim_present
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
SupportedNumPhysRounds0_A 2244 2244 0 0
SupportedNumPhysRounds1_A 2244 2244 0 0
SupportedNumRounds_A 2244 2244 0 0
SupportedWidths_A 2244 2244 0 0


SupportedNumPhysRounds0_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 2244 2244 0 0
T1 2 2 0 0
T2 2 2 0 0
T3 2 2 0 0
T4 2 2 0 0
T5 2 2 0 0
T6 2 2 0 0
T10 2 2 0 0
T11 2 2 0 0
T12 2 2 0 0
T13 2 2 0 0

SupportedNumPhysRounds1_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 2244 2244 0 0
T1 2 2 0 0
T2 2 2 0 0
T3 2 2 0 0
T4 2 2 0 0
T5 2 2 0 0
T6 2 2 0 0
T10 2 2 0 0
T11 2 2 0 0
T12 2 2 0 0
T13 2 2 0 0

SupportedNumRounds_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 2244 2244 0 0
T1 2 2 0 0
T2 2 2 0 0
T3 2 2 0 0
T4 2 2 0 0
T5 2 2 0 0
T6 2 2 0 0
T10 2 2 0 0
T11 2 2 0 0
T12 2 2 0 0
T13 2 2 0 0

SupportedWidths_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 2244 2244 0 0
T1 2 2 0 0
T2 2 2 0 0
T3 2 2 0 0
T4 2 2 0 0
T5 2 2 0 0
T6 2 2 0 0
T10 2 2 0 0
T11 2 2 0 0
T12 2 2 0 0
T13 2 2 0 0

Line Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc
Line No.TotalCoveredPercent
TOTAL1111100.00
CONT_ASSIGN6211100.00
CONT_ASSIGN6311100.00
CONT_ASSIGN6411100.00
CONT_ASSIGN6911100.00
CONT_ASSIGN10611100.00
CONT_ASSIGN10911100.00
CONT_ASSIGN11111100.00
CONT_ASSIGN12311100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN14511100.00

61 // initialize 62 1/1 assign data_state[0] = data_i; Tests: T1 T2 T3  63 1/1 assign round_key[0] = key_i; Tests: T1 T2 T3  64 1/1 assign round_idx[0] = idx_i; Tests: T1 T2 T3  65 66 for (genvar k = 0; k < NumPhysRounds; k++) begin : gen_round 67 logic [DataWidth-1:0] data_state_xor, data_state_sbox; 68 // cipher layers 69 1/1 assign data_state_xor = data_state[k] ^ round_key[k][KeyWidth-1 : KeyWidth-DataWidth]; Tests: T1 T2 T3  70 //////////////////////////////// 71 // decryption pass, performs inverse permutation, sbox and keyschedule 72 if (Decrypt) begin : gen_dec 73 // Decrement round count. 74 assign round_idx[k+1] = round_idx[k] - 1'b1; 75 // original 64bit variant 76 if (DataWidth == 64) begin : gen_d64 77 assign data_state_sbox = prim_cipher_pkg::perm_64bit(data_state_xor, 78 prim_cipher_pkg::PRESENT_PERM64_INV); 79 assign data_state[k+1] = prim_cipher_pkg::sbox4_64bit(data_state_sbox, 80 prim_cipher_pkg::PRESENT_SBOX4_INV); 81 // reduced 32bit variant 82 end else begin : gen_d32 83 assign data_state_sbox = prim_cipher_pkg::perm_32bit(data_state_xor, 84 prim_cipher_pkg::PRESENT_PERM32_INV); 85 assign data_state[k+1] = prim_cipher_pkg::sbox4_32bit(data_state_sbox, 86 prim_cipher_pkg::PRESENT_SBOX4_INV); 87 end 88 // update round key, count goes from 1 to 31 (max) 89 // original 128bit key variant 90 if (KeyWidth == 128) begin : gen_k128 91 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key128(round_key[k], 92 round_idx[k]); 93 // original 80bit key variant 94 end else if (KeyWidth == 80) begin : gen_k80 95 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key80(round_key[k], 96 round_idx[k]); 97 // reduced 64bit key variant 98 end else begin : gen_k64 99 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key64(round_key[k], 100 round_idx[k]); 101 end 102 //////////////////////////////// 103 // encryption pass 104 end else begin : gen_enc 105 // Increment round count. 106 1/1 assign round_idx[k+1] = round_idx[k] + 1'b1; Tests: T1 T2 T3  107 // original 64bit variant 108 if (DataWidth == 64) begin : gen_d64 109 1/1 assign data_state_sbox = prim_cipher_pkg::sbox4_64bit(data_state_xor, Tests: T1 T2 T3  110 prim_cipher_pkg::PRESENT_SBOX4); 111 1/1 assign data_state[k+1] = prim_cipher_pkg::perm_64bit(data_state_sbox, Tests: T1 T2 T3  112 prim_cipher_pkg::PRESENT_PERM64); 113 // reduced 32bit variant 114 end else begin : gen_d32 115 assign data_state_sbox = prim_cipher_pkg::sbox4_32bit(data_state_xor, 116 prim_cipher_pkg::PRESENT_SBOX4); 117 assign data_state[k+1] = prim_cipher_pkg::perm_32bit(data_state_sbox, 118 prim_cipher_pkg::PRESENT_PERM32); 119 end 120 // update round key, count goes from 1 to 31 (max) 121 // original 128bit key variant 122 if (KeyWidth == 128) begin : gen_k128 123 1/1 assign round_key[k+1] = prim_cipher_pkg::present_update_key128(round_key[k], round_idx[k]); Tests: T1 T2 T3  124 // original 80bit key variant 125 end else if (KeyWidth == 80) begin : gen_k80 126 assign round_key[k+1] = prim_cipher_pkg::present_update_key80(round_key[k], round_idx[k]); 127 // reduced 64bit key variant 128 end else begin : gen_k64 129 assign round_key[k+1] = prim_cipher_pkg::present_update_key64(round_key[k], round_idx[k]); 130 end 131 end // gen_enc 132 //////////////////////////////// 133 end // gen_round 134 135 // This only needs to be applied after the last round. 136 // Note that for a full-round implementation the output index 137 // will be 0 for enc/dec for the last round (either due to wraparound or subtraction). 138 localparam int LastRoundIdx = (Decrypt != 0 || NumRounds == 31) ? 0 : NumRounds+1; 139 1/1 assign data_o = (int'(idx_o) == LastRoundIdx) ? Tests: T1 T2 T3  140 data_state[NumPhysRounds] ^ 141 round_key[NumPhysRounds][KeyWidth-1 : KeyWidth-DataWidth] : 142 data_state[NumPhysRounds]; 143 144 1/1 assign key_o = round_key[NumPhysRounds]; Tests: T1 T2 T3  145 1/1 assign idx_o = round_idx[NumPhysRounds]; Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc
TotalCoveredPercent
Conditions22100.00
Logical22100.00
Non-Logical00
Event00

 LINE       139
 EXPRESSION 
 Number  Term
      1  (int'(idx_o) == LastRoundIdx) ? ((data_state[NumPhysRounds] ^ round_key[NumPhysRounds][(KeyWidth - 1):(KeyWidth - DataWidth)])) : data_state[NumPhysRounds])
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

 LINE       139
 SUB-EXPRESSION (int'(idx_o) == LastRoundIdx)
                --------------1--------------
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

Branch Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc
Line No.TotalCoveredPercent
Branches 1 1 100.00
TERNARY 139 1 1 100.00


139 assign data_o = (int'(idx_o) == LastRoundIdx) ? -1- ==> ==> (Unreachable)

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Unreachable T1,T2,T3


Assert Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_enc
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
SupportedNumPhysRounds0_A 1122 1122 0 0
SupportedNumPhysRounds1_A 1122 1122 0 0
SupportedNumRounds_A 1122 1122 0 0
SupportedWidths_A 1122 1122 0 0


SupportedNumPhysRounds0_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedNumPhysRounds1_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedNumRounds_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedWidths_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

Line Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec
Line No.TotalCoveredPercent
TOTAL1111100.00
CONT_ASSIGN6211100.00
CONT_ASSIGN6311100.00
CONT_ASSIGN6411100.00
CONT_ASSIGN6911100.00
CONT_ASSIGN7411100.00
CONT_ASSIGN7711100.00
CONT_ASSIGN7911100.00
CONT_ASSIGN9111100.00
CONT_ASSIGN13911100.00
CONT_ASSIGN14411100.00
CONT_ASSIGN14511100.00

61 // initialize 62 1/1 assign data_state[0] = data_i; Tests: T1 T2 T3  63 1/1 assign round_key[0] = key_i; Tests: T1 T2 T3  64 1/1 assign round_idx[0] = idx_i; Tests: T1 T2 T3  65 66 for (genvar k = 0; k < NumPhysRounds; k++) begin : gen_round 67 logic [DataWidth-1:0] data_state_xor, data_state_sbox; 68 // cipher layers 69 1/1 assign data_state_xor = data_state[k] ^ round_key[k][KeyWidth-1 : KeyWidth-DataWidth]; Tests: T1 T2 T3  70 //////////////////////////////// 71 // decryption pass, performs inverse permutation, sbox and keyschedule 72 if (Decrypt) begin : gen_dec 73 // Decrement round count. 74 1/1 assign round_idx[k+1] = round_idx[k] - 1'b1; Tests: T1 T2 T3  75 // original 64bit variant 76 if (DataWidth == 64) begin : gen_d64 77 1/1 assign data_state_sbox = prim_cipher_pkg::perm_64bit(data_state_xor, Tests: T1 T2 T3  78 prim_cipher_pkg::PRESENT_PERM64_INV); 79 1/1 assign data_state[k+1] = prim_cipher_pkg::sbox4_64bit(data_state_sbox, Tests: T1 T2 T3  80 prim_cipher_pkg::PRESENT_SBOX4_INV); 81 // reduced 32bit variant 82 end else begin : gen_d32 83 assign data_state_sbox = prim_cipher_pkg::perm_32bit(data_state_xor, 84 prim_cipher_pkg::PRESENT_PERM32_INV); 85 assign data_state[k+1] = prim_cipher_pkg::sbox4_32bit(data_state_sbox, 86 prim_cipher_pkg::PRESENT_SBOX4_INV); 87 end 88 // update round key, count goes from 1 to 31 (max) 89 // original 128bit key variant 90 if (KeyWidth == 128) begin : gen_k128 91 1/1 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key128(round_key[k], Tests: T1 T2 T3  92 round_idx[k]); 93 // original 80bit key variant 94 end else if (KeyWidth == 80) begin : gen_k80 95 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key80(round_key[k], 96 round_idx[k]); 97 // reduced 64bit key variant 98 end else begin : gen_k64 99 assign round_key[k+1] = prim_cipher_pkg::present_inv_update_key64(round_key[k], 100 round_idx[k]); 101 end 102 //////////////////////////////// 103 // encryption pass 104 end else begin : gen_enc 105 // Increment round count. 106 assign round_idx[k+1] = round_idx[k] + 1'b1; 107 // original 64bit variant 108 if (DataWidth == 64) begin : gen_d64 109 assign data_state_sbox = prim_cipher_pkg::sbox4_64bit(data_state_xor, 110 prim_cipher_pkg::PRESENT_SBOX4); 111 assign data_state[k+1] = prim_cipher_pkg::perm_64bit(data_state_sbox, 112 prim_cipher_pkg::PRESENT_PERM64); 113 // reduced 32bit variant 114 end else begin : gen_d32 115 assign data_state_sbox = prim_cipher_pkg::sbox4_32bit(data_state_xor, 116 prim_cipher_pkg::PRESENT_SBOX4); 117 assign data_state[k+1] = prim_cipher_pkg::perm_32bit(data_state_sbox, 118 prim_cipher_pkg::PRESENT_PERM32); 119 end 120 // update round key, count goes from 1 to 31 (max) 121 // original 128bit key variant 122 if (KeyWidth == 128) begin : gen_k128 123 assign round_key[k+1] = prim_cipher_pkg::present_update_key128(round_key[k], round_idx[k]); 124 // original 80bit key variant 125 end else if (KeyWidth == 80) begin : gen_k80 126 assign round_key[k+1] = prim_cipher_pkg::present_update_key80(round_key[k], round_idx[k]); 127 // reduced 64bit key variant 128 end else begin : gen_k64 129 assign round_key[k+1] = prim_cipher_pkg::present_update_key64(round_key[k], round_idx[k]); 130 end 131 end // gen_enc 132 //////////////////////////////// 133 end // gen_round 134 135 // This only needs to be applied after the last round. 136 // Note that for a full-round implementation the output index 137 // will be 0 for enc/dec for the last round (either due to wraparound or subtraction). 138 localparam int LastRoundIdx = (Decrypt != 0 || NumRounds == 31) ? 0 : NumRounds+1; 139 1/1 assign data_o = (int'(idx_o) == LastRoundIdx) ? Tests: T1 T2 T3  140 data_state[NumPhysRounds] ^ 141 round_key[NumPhysRounds][KeyWidth-1 : KeyWidth-DataWidth] : 142 data_state[NumPhysRounds]; 143 144 1/1 assign key_o = round_key[NumPhysRounds]; Tests: T1 T2 T3  145 1/1 assign idx_o = round_idx[NumPhysRounds]; Tests: T1 T2 T3 

Cond Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec
TotalCoveredPercent
Conditions22100.00
Logical22100.00
Non-Logical00
Event00

 LINE       139
 EXPRESSION 
 Number  Term
      1  (int'(idx_o) == LastRoundIdx) ? ((data_state[NumPhysRounds] ^ round_key[NumPhysRounds][(KeyWidth - 1):(KeyWidth - DataWidth)])) : data_state[NumPhysRounds])
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

 LINE       139
 SUB-EXPRESSION (int'(idx_o) == LastRoundIdx)
                --------------1--------------
-1-StatusTests
0UnreachableT1,T2,T3
1CoveredT1,T2,T3

Branch Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec
Line No.TotalCoveredPercent
Branches 1 1 100.00
TERNARY 139 1 1 100.00


139 assign data_o = (int'(idx_o) == LastRoundIdx) ? -1- ==> ==> (Unreachable)

Branches:
-1-StatusTests
1 Covered T1,T2,T3
0 Unreachable T1,T2,T3


Assert Coverage for Instance : tb.dut.u_otp_ctrl_scrmbl.u_prim_present_dec
TotalAttemptedPercentSucceeded/MatchedPercent
Assertions 4 4 100.00 4 100.00
Cover properties 0 0 0
Cover sequences 0 0 0
Total 4 4 100.00 4 100.00




Assertion Details

NameAttemptsReal SuccessesFailuresIncomplete
SupportedNumPhysRounds0_A 1122 1122 0 0
SupportedNumPhysRounds1_A 1122 1122 0 0
SupportedNumRounds_A 1122 1122 0 0
SupportedWidths_A 1122 1122 0 0


SupportedNumPhysRounds0_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedNumPhysRounds1_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedNumRounds_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

SupportedWidths_A
NameAttemptsReal SuccessesFailuresIncomplete
Total 1122 1122 0 0
T1 1 1 0 0
T2 1 1 0 0
T3 1 1 0 0
T4 1 1 0 0
T5 1 1 0 0
T6 1 1 0 0
T10 1 1 0 0
T11 1 1 0 0
T12 1 1 0 0
T13 1 1 0 0

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%