Skip to content
Snippets Groups Projects
Commit f783f487 authored by Daniel Newbrook's avatar Daniel Newbrook
Browse files

Add fast loader option to testbench

parent 80433754
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,8 @@
module nanosoc_axi_stream_io_8_txd_from_file
#(parameter TXDFILENAME = "adp.cmd",
parameter CODEFILENAME = "image.hex",
parameter VERBOSE = 0)
parameter VERBOSE = 0,
parameter FAST_LOAD = 1)
(
input wire aclk,
input wire aresetn,
......@@ -104,21 +105,31 @@ localparam BUFSIZE = (64 * 1024);
adpbuf[ 9] = "0"; //
adpbuf[10] = "0"; //
adpbuf[11] = 8'h0a; // newline
adpbuf[12] = "U"; // set upload filesize (N bytes)
adpbuf[13] = " "; // only up to 1Mbyte for now!
adpbuf[14] = FNmap_hex_digit(codesize[19:16]); //
adpbuf[15] = FNmap_hex_digit(codesize[15:12]); //
adpbuf[16] = FNmap_hex_digit(codesize[11: 8]); //
adpbuf[17] = FNmap_hex_digit(codesize[ 7: 4]); //
adpbuf[18] = FNmap_hex_digit(codesize[ 3: 0]); //
adpbuf[19] = 8'h0a; // newline
$readmemh(CODEFILENAME, adpbuf, 20);
adpbuf[clen+20] = "C"; // control
adpbuf[clen+21] = " ";
adpbuf[clen+22] = "2"; // (gpio bit set)
adpbuf[clen+23] = "0";
adpbuf[clen+24] = "1"; // assert reset to reboot
adpbuf[clen+25] = 8'h0a; // newline
if(FAST_LOAD==0) begin
adpbuf[12] = "U"; // set upload filesize (N bytes)
adpbuf[13] = " "; // only up to 1Mbyte for now!
adpbuf[14] = FNmap_hex_digit(codesize[19:16]); //
adpbuf[15] = FNmap_hex_digit(codesize[15:12]); //
adpbuf[16] = FNmap_hex_digit(codesize[11: 8]); //
adpbuf[17] = FNmap_hex_digit(codesize[ 7: 4]); //
adpbuf[18] = FNmap_hex_digit(codesize[ 3: 0]); //
adpbuf[19] = 8'h0a; // newline
$readmemh(CODEFILENAME, adpbuf, 20);
adpbuf[clen+20] = "C"; // control
adpbuf[clen+21] = " ";
adpbuf[clen+22] = "2"; // (gpio bit set)
adpbuf[clen+23] = "0";
adpbuf[clen+24] = "1"; // assert reset to reboot
adpbuf[clen+25] = 8'h0a; // newline
end else begin
clen = 0;
adpbuf[12] = "C"; // control
adpbuf[13] = " ";
adpbuf[14] = "2"; // (gpio bit set)
adpbuf[15] = "0";
adpbuf[16] = "1"; // assert reset to reboot
adpbuf[17] = 8'h0a; // newline
end
// append any ADP command file to the code memory preload
flen =0;
fd= $fopen(TXDFILENAME,"r");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment