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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [cbasic.c] - Diff between revs 493 and 997

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

Rev 493 Rev 997
Line 92... Line 92...
  int j;
  int j;
 
 
  for(j = i; j < 35; j++) {
  for(j = i; j < 35; j++) {
    shl += 1 << j;
    shl += 1 << j;
#if 0
#if 0
    printf("%u. shl:%.8lx", j, shl);
    PRINTF("%u. shl:%.8lx", j, shl);
    report(shl);
    report(shl);
#endif
#endif
    shr += 0x80000000 >> j;
    shr += 0x80000000 >> j;
#if 0
#if 0
    printf("  shr:%.8lx", shr);
    PRINTF("  shr:%.8lx", shr);
    report(shr);
    report(shr);
#endif
#endif
    bit += ((~j ^ 0x11223344) & 0x33557788) + (j | 0x11223344);
    bit += ((~j ^ 0x11223344) & 0x33557788) + (j | 0x11223344);
#if 0
#if 0
    printf("  bit:%.8lx\n", bit);
    PRINTF("  bit:%.8lx\n", bit);
    report(bit);
    report(bit);
#endif
#endif
  }
  }
 
 
  return (shl + shr + bit);
  return (shl + shr + bit);
Line 131... Line 131...
    us = i;
    us = i;
    ss = i;
    ss = i;
    ul = i;
    ul = i;
    sl = i;
    sl = i;
#if 0
#if 0
    printf("%u. i:%.8lx ", j, i);
    PRINTF("%u. i:%.8lx ", j, i);
    printf("uc:%.8lx sc:%.8lx ", uc, sc);
    PRINTF("uc:%.8lx sc:%.8lx ", uc, sc);
    report(uc);
    report(uc);
    report(sc);
    report(sc);
    printf("us:%.8lx ss:%.8lx ", us, ss);
    PRINTF("us:%.8lx ss:%.8lx ", us, ss);
    report(us);
    report(us);
    report(ss);
    report(ss);
    printf("ul:%.8lx sl:%.8lx\n", ul, sl);
    PRINTF("ul:%.8lx sl:%.8lx\n", ul, sl);
    report(ul);
    report(ul);
    report(sl);
    report(sl);
#endif
#endif
    i = uc + sc + us + ss + ul + sl;
    i = uc + sc + us + ss + ul + sl;
  }
  }
Line 176... Line 176...
  signed long result1 = 0;
  signed long result1 = 0;
  signed long result2 = 0;
  signed long result2 = 0;
  signed long result3 = 0;
  signed long result3 = 0;
 
 
#if DEBUG
#if DEBUG
  printf("Start...\n");
  PRINTF("Start...\n");
#endif
#endif
  result1 = test_cond(1);
  result1 = test_cond(1);
  result2 = test_cond(-1);
  result2 = test_cond(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_cond:   0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_cond:   0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
 
 
  result1 = test_loops(1);
  result1 = test_loops(1);
  result2 = test_loops(-1);
  result2 = test_loops(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_loops:  0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_loops:  0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
 
 
  result1 = test_arith(1);
  result1 = test_arith(1);
  result2 = test_arith(-1);
  result2 = test_arith(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_arith:  0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_arith:  0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
 
 
  result1 = test_bitop(1);
  result1 = test_bitop(1);
  result2 = test_bitop(-1);
  result2 = test_bitop(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_bitop:  0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_bitop:  0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
 
 
  result1 = test_types(1);
  result1 = test_types(1);
  result2 = test_types(-1);
  result2 = test_types(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_types:  0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_types:  0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
  result1 = test_array(1);
  result1 = test_array(1);
  result2 = test_array(-1);
  result2 = test_array(-1);
  result3 -= result1 + result2;
  result3 -= result1 + result2;
  report(result2);
  report(result2);
#if DEBUG
#if DEBUG
  printf("After test_array:  0x%.8lx  0x%.8lx\n", result1, result2);
  PRINTF("After test_array:  0x%.8lx  0x%.8lx\n", result1, result2);
#endif
#endif
 
 
#ifdef XXX
#ifdef XXX
#warning xxx
#warning xxx
#endif
#endif
 
 
  printf("RESULT: %.8lx\n", result3 ^ 0x4bad2569 ^ 0xdeaddead);
  PRINTF("RESULT: %.8lx\n", result3 ^ 0x4bad2569 ^ 0xdeaddead);
  report(result3 ^ 0x4bad2569 ^ 0xdeaddead);
  report(result3 ^ 0x4bad2569 ^ 0xdeaddead);
 
 
  exit(0);
  exit(0);
}
}
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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