OpenCores
URL https://opencores.org/ocsvn/mcip_open/mcip_open/trunk

Subversion Repositories mcip_open

[/] [mcip_open/] [trunk/] [HEXtoVHDLformat_Converter/] [CONVERT.CPP] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 mezzah
 
2
#include 
3
#include 
4
 
5
 
6
void main()
7
{
8
  FILE *ROM,*VHDL;
9
  char c;
10
  int i,j;
11
 
12
  ROM=fopen("app.hex","r");
13
  VHDL=fopen("prog.hdl","w");
14
        fprintf(VHDL,"(");
15
        while (feof(ROM)==0)
16
     {
17
         fprintf(VHDL,"\n");
18
         for (i=1;i<=9;i++) getc(ROM);
19
         for (i=1;i<=16;i++)
20
         {
21
           fprintf(VHDL,"X\"");
22
           for (j=0;j<2;j++)
23
             {c=getc(ROM);
24
             putc(c,VHDL);
25
             }
26
           fprintf(VHDL,"\",");
27
          }
28
          for (i=1;i<=3;i++) getc(ROM);
29
      }
30
  fprintf(VHDL,"\nothers => X\"FF\" );");
31
  fclose(ROM);
32
  fclose(VHDL);
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.