Merge pull request #66 from olofk/spiflash-plusarg

spiflash: Allow setting firmware from plusarg
This commit is contained in:
Clifford Wolf 2018-05-15 11:43:44 +02:00 committed by GitHub
commit 3015c18e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

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