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

Added an initialization loop to the SPI flash emulation module #133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions verilog/dv/vip/spiflash.v
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,14 @@ module spiflash #(
// 16 MB (128Mb) Flash
reg [7:0] memory [0:16*1024*1024-1];

integer i;

initial begin
// Initialize memory or else prefetch past the end of the
// loaded program can cause undefined values to propagate.
for (i=0; i < 16*1024*1024; i=i+1)
memory[i] = 0;

$display("Reading %s", FILENAME);
$readmemh(FILENAME, memory);
//$display("Memory 5 bytes = 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
Expand Down