Skip to content

Commit ba61f6e

Browse files
committed
update stream msg KAT to disable scoreboard and rely on self checking
update stream msg KAT to set STROBE back to 0xF at the start of each KAT
1 parent 774b4f1 commit ba61f6e

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

src/abr_top/uvmf/uvmf_template_output/project_benches/mldsa/tb/sequences/src/ML_DSA_verif_KATs_sequence.svh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ class ML_DSA_verif_KATs_sequence extends mldsa_bench_sequence_base;
9797
ready = data[0];
9898
end
9999

100-
101100
// Writing the PK into the MLDSA_PUBKEY register array
102101
for (int j = 0; j < reg_model.MLDSA_PUBKEY.m_mem.get_size(); j++) begin
103102
reg_model.MLDSA_PUBKEY.m_mem.write(status, j, kat_PK[j], UVM_FRONTDOOR, reg_model.default_map, this);
@@ -157,9 +156,9 @@ class ML_DSA_verif_KATs_sequence extends mldsa_bench_sequence_base;
157156
end
158157

159158
if (data !== VERIFY_RES[j]) begin
160-
`uvm_error("VALIDATION_FAIL", $sformatf("SIG mismatch for KAT %0d at index %0d: Expected %h, Got %h", i, j, SIG[j], data));
159+
`uvm_error("VALIDATION_FAIL", $sformatf("VERIFY_RES mismatch for KAT %0d at index %0d: Expected %h, Got %h", i, j, VERIFY_RES[j], data));
161160
end else begin
162-
`uvm_info("VALIDATION_PASS", $sformatf("SIG match for KAT %0d at index %0d: %h", i, j, data), UVM_LOW);
161+
`uvm_info("VALIDATION_PASS", $sformatf("VERIFY_RES match for KAT %0d at index %0d: %h", i, j, data), UVM_LOW);
163162
end
164163
end
165164

@@ -174,7 +173,7 @@ class ML_DSA_verif_KATs_sequence extends mldsa_bench_sequence_base;
174173
end
175174

176175

177-
`uvm_info("KAT", $sformatf("signing KAT validation completed"), UVM_LOW);
176+
`uvm_info("KAT", $sformatf("verif KAT validation completed"), UVM_LOW);
178177

179178

180179
endtask

src/abr_top/uvmf/uvmf_template_output/project_benches/mldsa/tb/sequences/src/ML_DSA_verif_KATs_stream_msg_sequence.svh

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ class ML_DSA_verif_KATs_stream_msg_sequence extends mldsa_bench_sequence_base;
112112
end
113113
end
114114

115-
// Write MSG to MLDSA_MSG registers
116-
foreach (reg_model.MLDSA_MSG[j]) begin
117-
reg_model.MLDSA_MSG[j].write(status, kat_MSG[j], UVM_FRONTDOOR, reg_model.default_map, this);
118-
if (status != UVM_IS_OK) begin
119-
`uvm_error("REG_WRITE_FAIL", $sformatf("Failed to write MLDSA_MSG[%0d] for KAT %0d", j, i));
120-
end else begin
121-
`uvm_info("REG_WRITE_PASS", $sformatf("Successfully wrote MLDSA_MSG[%0d]: %h", j, kat_MSG[j]), UVM_LOW);
122-
end
123-
end
124-
125115
// Writing the SIGNATURE into the MLDSA_SIGNATURE register array
126116
for (int j = 0; j < reg_model.MLDSA_SIGNATURE.m_mem.get_size(); j++) begin
127117
reg_model.MLDSA_SIGNATURE.m_mem.write(status, j, kat_SIG[j], UVM_FRONTDOOR, reg_model.default_map, this);
@@ -151,8 +141,15 @@ class ML_DSA_verif_KATs_stream_msg_sequence extends mldsa_bench_sequence_base;
151141
stream_msg_rdy = data[2];
152142
end
153143

144+
//write 0 to strobe since it's aligned to trigger end
145+
reg_model.MLDSA_MSG_STROBE.write(status, 4'b1111, UVM_FRONTDOOR, reg_model.default_map, this);
146+
if (status != UVM_IS_OK) begin
147+
`uvm_error("REG_WRITE", $sformatf("Failed to write MLDSA_MSG_STROBE"));
148+
end else begin
149+
`uvm_info("REG_WRITE", $sformatf("MLDSA_MSG_STROBE written with %0h", 0), UVM_LOW);
150+
end
154151
// Writing MLDSA_MSG register
155-
// Hack to stream normal message in through streaming interface
152+
// Stream message in through streaming interface
156153
foreach (MSG[j]) begin
157154
reg_model.MLDSA_MSG[0].write(status, kat_MSG[j], UVM_FRONTDOOR, reg_model.default_map, this);
158155
if (status != UVM_IS_OK) begin
@@ -196,9 +193,9 @@ class ML_DSA_verif_KATs_stream_msg_sequence extends mldsa_bench_sequence_base;
196193
end
197194

198195
if (data !== VERIFY_RES[j]) begin
199-
`uvm_error("VALIDATION_FAIL", $sformatf("SIG mismatch for KAT %0d at index %0d: Expected %h, Got %h", i, j, SIG[j], data));
196+
`uvm_error("VALIDATION_FAIL", $sformatf("VERIFY_RES mismatch for KAT %0d at index %0d: Expected %h, Got %h", i, j, VERIFY_RES[j], data));
200197
end else begin
201-
`uvm_info("VALIDATION_PASS", $sformatf("SIG match for KAT %0d at index %0d: %h", i, j, data), UVM_LOW);
198+
`uvm_info("VALIDATION_PASS", $sformatf("VERIFY_RES match for KAT %0d at index %0d: %h", i, j, data), UVM_LOW);
202199
end
203200
end
204201

@@ -213,7 +210,7 @@ class ML_DSA_verif_KATs_stream_msg_sequence extends mldsa_bench_sequence_base;
213210
end
214211

215212

216-
`uvm_info("KAT", $sformatf("signing KAT validation completed"), UVM_LOW);
213+
`uvm_info("KAT", $sformatf("verif KAT validation completed"), UVM_LOW);
217214

218215

219216
endtask

src/abr_top/uvmf/uvmf_template_output/project_benches/mldsa/tb/tests/src/ML_DSA_verif_KATs_stream_msg_test.svh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class ML_DSA_verif_KATs_stream_msg_test extends test_top;
2121

2222
`uvm_component_utils(ML_DSA_verif_KATs_stream_msg_test);
2323

24+
bit disable_scrboard_from_test;
25+
bit disable_pred_from_test;
26+
2427
function new(string name = "", uvm_component parent = null);
2528
super.new(name, parent);
2629
endfunction
@@ -33,6 +36,12 @@ class ML_DSA_verif_KATs_stream_msg_test extends test_top;
3336
super.build_phase(phase);
3437
// pragma uvmf custom configuration_settings_post_randomize begin
3538
// UVMF_CHANGE_ME Test specific configuration values can be set here.
39+
disable_scrboard_from_test = 1;
40+
disable_pred_from_test = 1;
41+
42+
uvm_config_db#(bit)::set(null, "*", "disable_scrboard_from_test", disable_scrboard_from_test);
43+
uvm_config_db#(bit)::set(null, "*", "disable_pred_from_test", disable_pred_from_test);
44+
3645
// The configuration structure has already been randomized.
3746
// pragma uvmf custom configuration_settings_post_randomize end
3847
endfunction

0 commit comments

Comments
 (0)