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

Subversion Repositories simple_fm_receiver

[/] [simple_fm_receiver/] [trunk/] [source/] [pat2vcd.c] - Blame information for rev 47

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 36 arif_endro
#include <stdio.h>
2
#include <string.h>
3
 
4
main(int argc, char *argv[])
5
{
6
 FILE *f;
7
 char *fname = "fm.txt";
8
 int c,i;
9
 char dmout[5000][20];
10
 
11
 if (argc > 1) {
12
 fname = argv[1];
13
 }
14
 
15
if(fname && (f = fopen(fname, "rt"))) {
16
  i = 0;
17
  while(fgets(dmout[i],sizeof(dmout[i]),f) != NULL) {
18
    c = strlen(dmout[i]);
19
    if(dmout[i][c-1] == '\n') dmout[i][c-1] = '\0';
20
    i++;
21
  }
22
  fclose (f);
23
} else {
24
  fclose (f);
25
}
26
 
27
 for (c = 0; c < i; c++) {
28
         printf("#%d\n", c); /* time */
29
         printf("%s\n", dmout[c]);
30
         printf("b%d %%\n", c%2); /* clock */
31
 }
32
 
33
 fclose (f);
34
}

powered by: WebSVN 2.1.0

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