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

Subversion Repositories tv80

[/] [tv80/] [trunk/] [tests/] [malloc.c] - Diff between revs 2 and 84

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 84
#include <malloc.h>
#include <malloc.h>
 
 
#include "tv80_env.h"
#include "tv80_env.h"
 
 
#define TEST_SIZE 200
#define TEST_SIZE 200
int main ()
int main ()
{
{
  char *foo;
  char *foo;
  int i;
  int i;
  int cksum_in, cksum_out;
  int cksum_in, cksum_out;
 
 
  sim_ctl (SC_DUMPON);
  sim_ctl (SC_DUMPON);
 
 
  foo = malloc (TEST_SIZE);
  foo = malloc (TEST_SIZE);
  set_timeout (30000);
  set_timeout (30000);
 
 
  print ("Memory allocated\n");
  print ("Memory allocated\n");
 
 
  cksum_in = 0;
  cksum_in = 0;
  for (i=0; i<TEST_SIZE; i=i+1) {
  for (i=0; i<TEST_SIZE; i=i+1) {
    cksum_in += i;
    cksum_in += i;
    foo[i] = i;
    foo[i] = i;
  }
  }
 
 
  print ("Values assigned\n");
  print ("Values assigned\n");
 
 
  cksum_out = 0;
  cksum_out = 0;
  for (i=0; i<TEST_SIZE; i++)
  for (i=0; i<TEST_SIZE; i++)
    cksum_out += foo[i];
    cksum_out += foo[i];
 
 
  print ("Checksum computed\n");
  print ("Checksum computed\n");
 
 
  if (cksum_in == cksum_out)
  if (cksum_in == cksum_out)
    sim_ctl (SC_TEST_PASSED);
    sim_ctl (SC_TEST_PASSED);
  else
  else
    sim_ctl (SC_TEST_FAILED);
    sim_ctl (SC_TEST_FAILED);
 
 
  return 0;
  return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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