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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc1/] [or1ksim/] [vapi/] [vapi.c] - Diff between revs 381 and 419

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 381 Rev 419
Line 115... Line 115...
  nhandlers++;
  nhandlers++;
  rebuild_fds ();
  rebuild_fds ();
  return tt;
  return tt;
}
}
 
 
 
/* Added by Erez 09/12/01 */
 
static void write_vapi_file(unsigned msgtype, unsigned long devid, unsigned long data)
 
{
 
        if (!runtime.vapi.vapi_file)
 
                return;
 
        if (config.vapi.log_device_id)
 
                fprintf (runtime.vapi.vapi_file, "%08x", devid);
 
        fprintf (runtime.vapi.vapi_file, "%1x%08x\n", msgtype, data);
 
}
 
 
static int vapi_write_stream(int fd, void* buf, int len)
static int vapi_write_stream(int fd, void* buf, int len)
{
{
  int n;
  int n;
  char* w_buf = (char*)buf;
  char* w_buf = (char*)buf;
  struct pollfd block;
  struct pollfd block;
Line 400... Line 410...
      rebuild_fds ();
      rebuild_fds ();
    }
    }
    return;
    return;
  }
  }
 
 
  if (runtime.vapi.vapi_file)
        write_vapi_file (0, t->id, data);
    fprintf (runtime.vapi.vapi_file, "0%08x\n", data);
 
  debug (4, "[%08x, %08x]\n", t->id, data);
  debug (4, "[%08x, %08x]\n", t->id, data);
  if (!t->read_func)
  if (!t->read_func)
    fprintf (stderr, "WARNING: packet sent to undefined id %x, %x\n", t->id, data);
    fprintf (stderr, "WARNING: packet sent to undefined id %x, %x\n", t->id, data);
  else
  else
    t->read_func(t->id, data);
    t->read_func(t->id, data);
Line 501... Line 510...
  serverIP = 0;
  serverIP = 0;
  free (fds);
  free (fds);
  fds = 0;
  fds = 0;
  if (runtime.vapi.vapi_file) {
  if (runtime.vapi.vapi_file) {
    /* Mark end of simulation */
    /* Mark end of simulation */
    fprintf (runtime.vapi.vapi_file, "2%08x", 0);
                write_vapi_file (2, t->id, 0);
    fclose (runtime.vapi.vapi_file);
    fclose (runtime.vapi.vapi_file);
  }
  }
 
 
  while (vapi_handler) {
  while (vapi_handler) {
    t = vapi_handler;
    t = vapi_handler;
Line 560... Line 569...
 
 
/* Sends a packet to specified test */
/* Sends a packet to specified test */
int vapi_send (unsigned long id, unsigned long data)
int vapi_send (unsigned long id, unsigned long data)
{
{
  debug (4, "vapi_send [%08x %08x]\n", id, data);
  debug (4, "vapi_send [%08x %08x]\n", id, data);
  if (runtime.vapi.vapi_file)
        write_vapi_file (1, id, data);
    fprintf (runtime.vapi.vapi_file, "1%08x\n", data);
 
  write_packet (id, data);
  write_packet (id, data);
}
}
 
 
/*
/*
int main ()
int main ()

powered by: WebSVN 2.1.0

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