O seguinte script Tcl automatiza o arquivo de inicialização de memória (. mif) para conversão de arquivo Hexadecimal (Formato Intel) (.hex) com um utilitário de software Quartus® II chamado mif2hex. Copie e colar o script abaixo em um arquivo chamado mif_to_hex.tcl e use o comando a seguir para executar: quartus_sh -t mif_to_hex.tcl *.mif
global quartus
if { 0 == [llength (args)] } {
post_message "Usage: quartus_sh -t [info script] "
} else {
set file_pattern [lindex (args) 0]
foreach mif_name [glob ] {
# Rename to .hex
set rootname [file rootname ]
set hex_name .hex
if { [catch { qexec "[file join (binpath) mif2hex]
" } res] } {
post_message -type error
break
} else {
post_message "Converted to "
}
}
}