Baixe o arquivo convert_hex2ver.c do site EDIF (http://www.edif.org/lpmweb/convert_hex2ver.c).
- Crie um arquivo chamado veriuser_mti.c com o seguinte conteúdo:
#include "veriuser.h" #include "acc_user.h" extern convert_hex2ver(); s_tfcell veriusertfs[] = { /*** Template for an entry: { usertask|userfunction, data, checktf(), sizetf(), calltf(), misctf(), ""}, Example: { usertask, 0, check, 0, func, misctf, "" }, ***/ /*** add customer task entries here ***/ /* This converts intel binary bit patterns to a verilog readmemb format*/ {usertask, 0, 0, 0, convert_hex2ver, 0, "", 1}, {0} /*** final entry must be 0 ***/ }; /* mti interface */ void init_usertfs() { p_tfcell usertf; for (usertf = veriusertfs; usertf; usertf ) { if(usertf->type == 0) return; mti_RegisterUserTF(usertf); } } - Compile e linke os dois arquivos de origem C (veriuser_mti.c E convert_hex2ver.c). Por exemplo:
gcc -c -I/<full_path_to_modelsim>/include convert_hex2ver.c<full_path_to_modelsim>
gcc -c -I//include veriuser_mti.c
ld -G -o altera.sl convert_hex2ver.o veriuser_mti.o - Crie e edite uma cópia local de modelsim.ini para incluir as seguintes informações:
Veriuser = /<full_path_to_where_you_created_altera.sl>/altera.sl - Compile o arquivo De origem Verilog usando o Vlog Comando. Você deve ver as seguintes mensagens ao analisar o arquivo usando Vlog:
Loading work.<design_name>Loading /<full_path_to_where_you_created_altera.sl>/altera.sl - Prossiga com a simulação.