Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

converted scanf to void and added kv signals #35

Merged
merged 6 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflow_metadata/pr_hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9545e1dfd31a286e20ee2948b2c6ded7bdac79561e52ab62ebddb14133c94a24cccb12afbea22cb76f007862fd738bd2
214c0b1444725dc142a4361e20d2d37423221cc10eda63949e445a2a06f3f8f61abeb3d4d18dd6fc0a2618cd920e4a51
2 changes: 1 addition & 1 deletion .github/workflow_metadata/pr_timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1731515073
1731643612
2 changes: 1 addition & 1 deletion src/mldsa_top/uvmf/config/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ targets:
- hdl_top
- hvl_top
sim:
pre_exec: 'echo "[PRE-EXEC] Copying C executbale vector generator to $PWD" && cp $COMPILE_ROOT/Dilithium_ref/dilithium/ref/test/test_dilithium5 . && cp $COMPILE_ROOT/Dilithium_ref/dilithium/ref/test/test_dilithium5_debug .'
pre_exec: 'echo "[PRE-EXEC] Copying C executable vector generator to $PWD" && cp $COMPILE_ROOT/Dilithium_ref/dilithium/ref/test/test_dilithium5 . && cp $COMPILE_ROOT/Dilithium_ref/dilithium/ref/test/test_dilithium5_debug .'
global:
tool:
vcs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ML_DSA_randomized_key_gen_and_sign_sequence extends mldsa_bench_sequence_b
end
// Skip the two lines (KeyGen command and PK in output)
void'($fgets(line, fd));
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
read_line(fd, 648, PK); // Read 2592-byte Public Key to the file
// Read the secret key (SK) from the file into the SK array
read_line(fd, 1224, SK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ML_DSA_randomized_sign_gen_sequence extends mldsa_bench_sequence_base;
end
// Skip the two lines (KeyGen command and PK in output)
void'($fgets(line, fd));
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
read_line(fd, 648, PK); // Read 2592-byte Public Key to the file
// Read the secret key (SK) from the file into the SK array
read_line(fd, 1224, SK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ML_DSA_randomized_verif_sequence extends mldsa_bench_sequence_base;
end
// Skip the two lines (KeyGen command and PK in output)
void'($fgets(line, fd));
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
read_line(fd, 648, PK); // Read 2592-byte Public Key to the file
// Read the secret key (SK) from the file into the SK array
read_line(fd, 1224, SK);
Expand Down Expand Up @@ -133,11 +133,11 @@ class ML_DSA_randomized_verif_sequence extends mldsa_bench_sequence_base;
else begin
// Skip the first line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
end
// Skip the second line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%08x\n", value);
void'($sscanf(line, "%08x\n", value));
read_line(fd, 1157, SIG);// Read 4864-byte Signature to the file
SIG[0] = SIG[0] >> 8;
$fclose(fd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module hdl_top;
import mldsa_parameters_pkg::*;
import qvip_ahb_lite_slave_params_pkg::*;
import uvmf_base_pkg_hdl::*;
`ifdef CALIPTRA
import kv_defines_pkg::*;
`endif

// pragma attribute hdl_top partition_module_xrtl
hdl_qvip_ahb_lite_slave
Expand Down Expand Up @@ -74,6 +77,13 @@ import uvmf_base_pkg_hdl::*;
rst = 1;
end

`ifdef CALIPTRA
var kv_rd_resp_t kv_rd_resp;
initial begin
kv_rd_resp = '{default:0};
end
`endif

// pragma uvmf custom dut_instantiation begin
// AHB Clock/reset
assign uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.default_clk_gen_CLK = clk;
Expand Down Expand Up @@ -101,7 +111,13 @@ import uvmf_base_pkg_hdl::*;
.hsize_i (uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HSIZE ),
.hresp_o (uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HRESP ),
.hreadyout_o(uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HREADY ),
.hrdata_o (uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HRDATA )
.hrdata_o (uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HRDATA ),
`ifdef CALIPTRA
.kv_read(),
.kv_rd_resp(kv_rd_resp),
`endif
.error_intr(),
.notif_intr()
);

assign uvm_test_top_environment_qvip_ahb_lite_slave_subenv_qvip_hdl.ahb_lite_slave_0_HBURST = 3'b0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ class mldsa_predictor #(
else begin
// Skip the first line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
end
read_line(fd, 648, PK); // Read 2592-byte Public Key to the file
read_line(fd, 1224, SK); // Read 4864-byte Secret Key to the file
Expand Down Expand Up @@ -428,11 +428,11 @@ class mldsa_predictor #(
else begin
// Skip the first line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
end
// Skip the second line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%08x\n", value);
void'($sscanf(line, "%08x\n", value));
read_line(fd, 1157, SIG);// Read 4864-byte Signature to the file
SIG[0] = SIG[0] >> 8;
$fclose(fd);
Expand Down Expand Up @@ -465,11 +465,11 @@ class mldsa_predictor #(
else begin
// Skip the first line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
end
// Skip the second line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
read_line(fd, 16, VERIF);// Read 16 dword verify result from the file
$fclose(fd);
end
Expand All @@ -484,7 +484,7 @@ class mldsa_predictor #(
end
// Skip the two lines (KeyGen command and PK in output)
void'($fgets(line, fd));
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
read_line(fd, 648, PK); // Read 2592-byte Public Key to the file
// Read the secret key (SK) from the file into the SK array
read_line(fd, 1224, SK);
Expand Down Expand Up @@ -514,11 +514,11 @@ class mldsa_predictor #(
else begin
// Skip the first line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%02x\n", value);
void'($sscanf(line, "%02x\n", value));
end
// Skip the second line
void'($fgets(line, fd)); // Read a line from the file
$sscanf(line, "%08x\n", value);
void'($sscanf(line, "%08x\n", value));
read_line(fd, 1157, SIG);// Read 4864-byte Signature to the file
SIG[0] = SIG[0] >> 8;
$fclose(fd);
Expand Down