From c9470e3e041d253cc355e1138d6fa29559e00b7f Mon Sep 17 00:00:00 2001 From: Olof Kindgren Date: Fri, 11 May 2018 15:43:13 +0200 Subject: spiflash: Allow setting firmware from plusarg --- picosoc/spiflash.v | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'picosoc') diff --git a/picosoc/spiflash.v b/picosoc/spiflash.v index 63d21dc..18b918b 100644 --- a/picosoc/spiflash.v +++ b/picosoc/spiflash.v @@ -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; -- cgit