pylab_ml.common.file_io.writeVlogMemFile
- writeVlogMemFile(fileName, mem, a_dig=4, d_dig=8, adroffset=0, adrinc=1, header=['', 'verilog memory data file', ''])[source]
Write memory data to a file in verilog hex format.
eg. writeVlogMemFile(‘memory.v’, mem) will write the memory data from the list ‘mem’ to the file ‘memory.v’ in verilog hex format. The function will write the data to the file in the format “@address data”, where address is the memory address in hexadecimal and data is the memory data in hexadecimal. The function will also include a header at the top of the file as comments, and will allow for customization of the address and data formatting through the parameters.
- Parameters:
fileName (string) – Path to the verilog file.
mem (list) – List with integer memory data.
a_dig (int) – Minimum address digits.
d_dig (int) – Minimum data digits.
adroffset (int) – Address offset.
adrinc (int) – Increment address by.
header (list) – List of strings placed as comments at the top of the file.
- Returns:
True if the file was successfully written, False otherwise.
- Return type:
bool