Pipeline ML-KEM datapath bottlenecks

This commit is contained in:
2026-07-08 00:23:46 +08:00
parent 8c3f4317f5
commit 372a90e601
17 changed files with 776 additions and 176 deletions

View File

@@ -14,10 +14,12 @@
// xelab tb_mlkem_two_inst_xsim ; xsim
`timescale 1ns/1ps
module tb_mlkem_two_inst_xsim;
localparam KP = 2; // ML-KEM-512
localparam EKB = 384*KP + 32; // 800
localparam DKB = 768*KP + 96; // 1632
localparam CTB = 32*(10*KP + 4); // 768
parameter KP = 2; // 2/3/4 = ML-KEM-512/768/1024
localparam DU = (KP == 4) ? 11 : 10;
localparam DV = (KP == 4) ? 5 : 4;
localparam EKB = 384*KP + 32;
localparam DKB = 768*KP + 96;
localparam CTB = 32*(DU*KP + DV);
localparam MLEN = 11; // "hello world"
reg clk=0;
@@ -100,7 +102,7 @@ module tb_mlkem_two_inst_xsim;
msg_b[0]="h"; msg_b[1]="e"; msg_b[2]="l"; msg_b[3]="l"; msg_b[4]="o";
msg_b[5]=" "; msg_b[6]="w"; msg_b[7]="o"; msg_b[8]="r"; msg_b[9]="l"; msg_b[10]="d";
$display("=== ML-KEM hello_world (TWO instances: genenc + dec, ML-KEM-512) ===");
$display("=== ML-KEM hello_world (TWO instances: genenc + dec, K=%0d) ===", KP);
$write("Original: \""); for(i=0;i<MLEN;i=i+1) $write("%c", msg_b[i]); $display("\"\n");
a_rst_n=0; b_rst_n=0; repeat(4) @(posedge clk); a_rst_n=1; b_rst_n=1; @(posedge clk);