For the M16C5x, I wrote a little utility which adds the addresses to the file. I run it within a DOS box, and use a little batch file to automate the process of assembling, converting the assembler output file to a mem file, and then copying the mem file to the destination directory.
I will modify the binary to hex utility I wrote for the M65C02 to do the same, and then just modify the DOS batch file to copy the mem file instead of the ASCII hex coe file. Both files need to be generated so that the final configuration of the block RAM can be determined before BitGen. Since the BitGen command line will likely reference the BMM file and mem files, generating a coe file is no really longer necessary. However, in simulation, ISim reloads the coe files for any memories which include an initial $readmemh() or $readmemb() for pre-synthesis inialization of their contents.
I am thinking that it may be possible to use DOS batch to create a mem file that is just the required address line and then append the hex file to that file. Looking at the DOS copy command, it is possible to copy multiple source files, separated by "+" symbols, into a single destination file. Thus, create a file that contains the single @address line that you use, and then use copy to create a single destination file:
Quote:
copy /Y /A addrs.mem + /A program.hex /A dst_mem.mem
I tried this DOS command using a Data2MEM-compatible address file I created from the console/command line:
Quote:
copy con: addrs.mem
@F800<CR>
<Cntl-Z>
The resulting destination file is the addrs.mem appended to m65c02.txt (my Boot ROM memory initialization file). Note: the /A preceding each of the file names indicates that the files are ASCII files rather than binary (/B) files.