[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gEDA-user: icarus $fread



Has anybody created a $fread or $scanf VPI by any chance ?
I thought I'd ask before I start writing one.

I'd like to be able to do things like this C code fragment
in Verilog, because it would let me test the design against
streaming live data, in addition to specific testbench stuff.
Logic-to-driver integration (in user mode linux) gets easier
if the driver can directly operate the simulated hardware.

#include <stdio.h>
int main()
{ int sum=0, item;
  while (!feof(stdin))
    if (scanf("%i",&item))
      printf("%i\n", sum=(sum+item)%256);
  return 0;
}