spiflash: Allow setting firmware from plusarg

This commit is contained in:
Olof Kindgren 2018-05-11 15:43:13 +02:00
parent ad95e88e11
commit c9470e3e04
1 changed files with 4 additions and 1 deletions

View File

@ -98,8 +98,11 @@ module spiflash (
// 16 MB (128Mb) Flash // 16 MB (128Mb) Flash
reg [7:0] memory [0:16*1024*1024-1]; reg [7:0] memory [0:16*1024*1024-1];
reg [1023:0] firmware_file;
initial begin initial begin
$readmemh("firmware.hex", memory); if (!$value$plusargs("firmware=%s", firmware_file))
firmware_file = "firmware.hex";
$readmemh(firmware_file, memory);
end end
task spi_action; task spi_action;