Commit 40928260 authored by Iulian Gheorghiu's avatar Iulian Gheorghiu

Add support for BIN files.

Add -s for split words in multiple files, to help missaligned read/write from/to memory.
parent 676922b0
No preview for this file type
This diff is collapsed.
This application is made to convert from Intel hex format to Verilog memory file format and is intended to be call by the compiler after HEX file was generated.
This application is made to convert from Intel HEX format or BIN file to Verilog memory file format and is intended to be call by the compiler after HEX or BIN file was generated.
You need to put the EXE in your Debug directory.
Down is an example of usage from Atmel Studio on Post build command line:
Below is an example of usage for Atmel Studio on Post build command line:
IntelHexToVerilogMem.exe -i "$(OutputFileName).hex" -o "C:\GitHub\XMEGA-CORE-IP-TST\core1ROM.mem" -g "2" -b "0x20000000"
IntelHexToVerilogMem.exe -i "$(OutputFileName).hex" -o "C:\GitHub\XMEGA-CORE-IP-TST\core1ROM.mem" -g "2" -b "0x20000000" -s "2"
the -g argument is optional (default is 2) and indicate the length in bytes on a row, values supported are 1, 2 or 4.
Below is an example of usage for Eclipse on Post build command line:
the -b argument is the offset of the memore, for example if the rom memory start from 0x20000000 the addresses from 0 to 0x1fffffff is not included in output file.
"${PWD}/IntelHexToVerilogMem.exe" -i "${PWD}\TestRiscVXilinx.hex" -o "C:\GitHub\VERILOG-RISC-V-LIGHT-CORE-IP-TST-XILINX\core1ROM.mem" -g "4" -b "0x8000" -s "2"
The -g argument is optional (default is 2) and indicate the length in bytes on a row, values supported are 1, 2 or 4.
The -b argument is the offset of the memore, for example if the rom memory start from 0x20000000 the addresses from 0 to 0x1fffffff is not included in output file.
The -s argument is optional and default value is 1.
The -s argument is the split value, for example if -g = 4 and -s = 2 this application will output 3 files, one with 4 bytes on the row and two files with half a row each, file "core1ROM_0.mem" will contain bytes 1 and 0 from the 4 byte row and file "core1ROM_1.mem" will contain bytes 3 and 2 from the 4 bytes row.
If -s argument is four will output five files, one with four bytes on each row and five files each with one byte on each row from a four byte row, this will help to read memory's with byte level missalignment in one single clock cycle.
This argument is usefull if you want to easily implement unaligned memory read and write in a single clock cycle.
For example for memory's with 32 bit per words if you want to read unaligned 32 bit data you can read the low 16 bit data from file "core1ROM_1.mem" and the high 16 bit data from address + 1 from file "core1ROM_0.mem".
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment