Skip to content
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
6 changes: 3 additions & 3 deletions cocotb/sim/tb/tb_top_feature_ml_cpu_spi_flash.sv
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ localparam [31:0] FEAT_MOTION = FEATURE_BASE + 32'h08;
localparam [31:0] FEAT_DHR = FEATURE_BASE + 32'h0C;
localparam [31:0] FEAT_MSSD = FEATURE_BASE + 32'h10;

localparam int unsigned FLASH_WORDS = 1232;
localparam int unsigned FLASH_WORDS = 1280; // 1024 firmware + 256 weight slots (taketwo reads up to word 227, needing flash index 1251)
localparam int unsigned TB_TIMEOUT_CYCLES = 10_000_000;
localparam int unsigned TB_PROGRESS_EVERY = 10_000;
// The top-level SPI pins are shared. spi_boot_ctrl owns them until firmware
Expand Down Expand Up @@ -481,7 +481,7 @@ initial begin
end

if (dut.test_status == 32'hCAFE_BABE) begin
sampled_logit_word = {logit1[15:0], logit0[15:0]};
sampled_logit_word = dut.u_weight_ram.logit_reg_0;
raw_logit_word = sampled_logit_word;
log0_s = $signed(sampled_logit_word[15:0]);
log1_s = $signed(sampled_logit_word[31:16]);
Expand Down Expand Up @@ -564,7 +564,7 @@ initial begin
$display("FAIL: no AXI write activity from taketwo");
failures = failures + 1;
end
if ({logit1[15:0], logit0[15:0]} === 32'hA5A55A5A) begin
if (sampled_logit_word === 32'hA5A55A5A) begin
$display("FAIL: visible logit outputs kept sentinel value");
failures = failures + 1;
end
Expand Down
20 changes: 16 additions & 4 deletions src/chip_core.sv
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,22 @@ module chip_core #(
.ml_update_gate_o (ml_update_gate_w),
.invalid_reason_o (invalid_reason_w),

.spi_clk_o (spi_clk_w),
.spi_mosi_o (spi_mosi_w),
.spi_miso_i (bidir_in[4]),
.spi_cs_n_o (spi_cs_n_w),
.flash_spi_clk_o (spi_clk_w),
.flash_spi_mosi_o (spi_mosi_w),
.flash_spi_miso_i (bidir_in[4]),
.flash_spi_cs_n_o (spi_cs_n_w),
.boot_spi_clk_o (),
.boot_spi_mosi_o (),
.boot_spi_miso_i (1'b1),
.boot_spi_cs_n_o (),
.weight_spi_clk_o (),
.weight_spi_mosi_o(),
.weight_spi_miso_i(1'b1),
.weight_spi_cs_n_o(),
.spi_clk_o (),
.spi_mosi_o (),
.spi_miso_i (1'b1),
.spi_cs_n_o (),

.epoch_end_o (epoch_end_w),
.alarm_o (alarm_w),
Expand Down
Loading