Remove smips/host-debugging cruft
authorAndrew Waterman <andrew@sifive.com>
Wed, 22 Mar 2017 00:04:49 +0000 (17:04 -0700)
committerAndrew Waterman <andrew@sifive.com>
Wed, 22 Mar 2017 00:04:49 +0000 (17:04 -0700)
12 files changed:
benchmarks/Makefile
benchmarks/common/util.h
benchmarks/dhrystone/dhrystone_main.c
benchmarks/median/median_main.c
benchmarks/mt-matmul/mt-matmul.c
benchmarks/mt-vvadd/mt-vvadd.c
benchmarks/multiply/multiply_main.c
benchmarks/qsort/qsort_main.c
benchmarks/readme.txt
benchmarks/rsort/rsort.c
benchmarks/towers/towers_main.c
benchmarks/vvadd/vvadd_main.c

index 531d9817072f02e74376470ec64db47b34fcc25a..15509d02e37692768245ee2a45dae5406f6a3469 100644 (file)
@@ -30,24 +30,10 @@ bmarks = \
        mt-vvadd \
        mt-matmul \
 
        mt-vvadd \
        mt-matmul \
 
-bmarks_host = \
-       median \
-       qsort \
-       towers \
-       vvadd \
-       multiply \
-       spmv \
-       vec-vvadd \
-       vec-cmplxmult \
-       vec-matmul \
-
 #--------------------------------------------------------------------
 # Build rules
 #--------------------------------------------------------------------
 
 #--------------------------------------------------------------------
 # Build rules
 #--------------------------------------------------------------------
 
-HOST_OPTS = -std=gnu99 -DPREALLOCATE=0 -DHOST_DEBUG=1
-HOST_COMP = gcc $(HOST_OPTS)
-
 RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf-
 RISCV_GCC ?= $(RISCV_PREFIX)gcc
 RISCV_GCC_OPTS ?= -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf
 RISCV_PREFIX ?= riscv$(XLEN)-unknown-elf-
 RISCV_GCC ?= $(RISCV_PREFIX)gcc
 RISCV_GCC_OPTS ?= -mcmodel=medany -static -std=gnu99 -O2 -ffast-math -fno-common -fno-builtin-printf
@@ -72,7 +58,7 @@ bmarks_riscv_bin  = $(addsuffix .riscv,  $(bmarks))
 bmarks_riscv_dump = $(addsuffix .riscv.dump, $(bmarks))
 bmarks_riscv_out  = $(addsuffix .riscv.out,  $(bmarks))
 
 bmarks_riscv_dump = $(addsuffix .riscv.dump, $(bmarks))
 bmarks_riscv_out  = $(addsuffix .riscv.out,  $(bmarks))
 
-bmarks_defs   = -DPREALLOCATE=1 -DHOST_DEBUG=0
+bmarks_defs   = -DPREALLOCATE=1
 bmarks_cycles = 80000
 
 $(bmarks_riscv_dump): %.riscv.dump: %.riscv
 bmarks_cycles = 80000
 
 $(bmarks_riscv_dump): %.riscv.dump: %.riscv
@@ -96,22 +82,6 @@ run-riscv: $(bmarks_riscv_out)
 
 junk += $(bmarks_riscv_bin) $(bmarks_riscv_dump) $(bmarks_riscv_hex) $(bmarks_riscv_out)
 
 
 junk += $(bmarks_riscv_bin) $(bmarks_riscv_dump) $(bmarks_riscv_hex) $(bmarks_riscv_out)
 
-#------------------------------------------------------------
-# Build and run benchmarks on host machine
-
-bmarks_host_bin = $(addsuffix .host, $(bmarks_host))
-bmarks_host_out = $(addsuffix .host.out, $(bmarks_host))
-
-$(bmarks_host_out): %.host.out: %.host
-       ./$< > $@
-
-host: $(bmarks_host_bin)
-run-host: $(bmarks_host_out)
-       echo; perl -ne 'print "  [$$1] $$ARGV \t$$2\n" if /\*{3}(.{8})\*{3}(.*)/' \
-              $(bmarks_host_out); echo;
-
-junk += $(bmarks_host_bin) $(bmarks_host_out)
-
 #------------------------------------------------------------
 # Default
 
 #------------------------------------------------------------
 # Default
 
index 22f81cf90177008155cae8ea1df183575c2239d3..a3e2e8cfa29c54a30c2505221a688203a09e772c 100644 (file)
@@ -3,62 +3,12 @@
 #ifndef __UTIL_H
 #define __UTIL_H
 
 #ifndef __UTIL_H
 #define __UTIL_H
 
-//--------------------------------------------------------------------------
-// Macros
-
-// Set HOST_DEBUG to 1 if you are going to compile this for a host
-// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG
-// to 0 if you are compiling with the smips-gcc toolchain.
-
-#ifndef HOST_DEBUG
-#define HOST_DEBUG 0
-#endif
-
-// Set PREALLOCATE to 1 if you want to preallocate the benchmark
-// function before starting stats. If you have instruction/data
-// caches and you don't want to count the overhead of misses, then
-// you will need to use preallocation.
-
-#ifndef PREALLOCATE
-#define PREALLOCATE 0
-#endif
-
-// Set SET_STATS to 1 if you want to carve out the piece that actually
-// does the computation.
-
-#if HOST_DEBUG
-#include <stdio.h>
-static void setStats(int enable) {}
-#else
 extern void setStats(int enable);
 extern void setStats(int enable);
-#endif
 
 #include <stdint.h>
 
 #define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; }
 
 
 #include <stdint.h>
 
 #define static_assert(cond) switch(0) { case 0: case !!(long)(cond): ; }
 
-static void printArray(const char name[], int n, const int arr[])
-{
-#if HOST_DEBUG
-  int i;
-  printf( " %10s :", name );
-  for ( i = 0; i < n; i++ )
-    printf( " %3d ", arr[i] );
-  printf( "\n" );
-#endif
-}
-
-static void printDoubleArray(const char name[], int n, const double arr[])
-{
-#if HOST_DEBUG
-  int i;
-  printf( " %10s :", name );
-  for ( i = 0; i < n; i++ )
-    printf( " %g ", arr[i] );
-  printf( "\n" );
-#endif
-}
-
 static int verify(int n, const volatile int* test, const int* verify)
 {
   int i;
 static int verify(int n, const volatile int* test, const int* verify)
 {
   int i;
index 492270a0439d23b84b0eed9b06e42f7b07999805..9c7bcf544ffc01d7e1d11650cb97593a70f888d1 100644 (file)
@@ -5,45 +5,13 @@
 //--------------------------------------------------------------------------
 //
 // This is the classic Dhrystone synthetic integer benchmark.
 //--------------------------------------------------------------------------
 //
 // This is the classic Dhrystone synthetic integer benchmark.
-// You should not change anything except the HOST_DEBUG and
-// PREALLOCATE macros for your timing run.
+//
 
 #pragma GCC optimize ("no-inline")
 
 #include "dhrystone.h"
 
 
 #pragma GCC optimize ("no-inline")
 
 #include "dhrystone.h"
 
-//--------------------------------------------------------------------------
-// Macros
-
-// Set HOST_DEBUG to 1 if you are going to compile this for a host
-// machine (ie Athena/Linux) for debug purposes and set HOST_DEBUG
-// to 0 if you are compiling with the smips-gcc toolchain.
-
-#ifndef HOST_DEBUG
-#define HOST_DEBUG 0
-#endif
-
-// Set PREALLOCATE to 1 if you want to preallocate the benchmark
-// function before starting stats. If you have instruction/data
-// caches and you don't want to count the overhead of misses, then
-// you will need to use preallocation.
-
-#ifndef PREALLOCATE
-#define PREALLOCATE 0
-#endif
-
-// Set SET_STATS to 1 if you want to carve out the piece that actually
-// does the computation.
-
-#ifndef SET_STATS
-#define SET_STATS 0
-#endif
-
-#if HOST_DEBUG
-# define debug_printf printf
-#else
 void debug_printf(const char* str, ...);
 void debug_printf(const char* str, ...);
-#endif
 
 #include "util.h"
 
 
 #include "util.h"
 
@@ -101,21 +69,7 @@ int main (int argc, char** argv)
   REG   int             Number_Of_Runs;
 
   /* Arguments */
   REG   int             Number_Of_Runs;
 
   /* Arguments */
-#if HOST_DEBUG
-  if (argc > 2)
-  {
-     printf("Usage: %s [number of loops]\n", argv[0]);
-     exit (1);
-  }
-  if (argc == 2)
-  {
-     Number_Of_Runs = atoi (argv[1]);
-  }
-  else if (Number_Of_Runs <= 0)
-#endif
-  {
-     Number_Of_Runs = NUMBER_OF_RUNS;
-  }
+  Number_Of_Runs = NUMBER_OF_RUNS;
 
   /* Initializations */
 
 
   /* Initializations */
 
index c7fd6a6e8af26d23de92cff86623c2d050ecf629..b62ecd185aa97ad17bdd2169c3400dbf5481255d 100644 (file)
@@ -7,8 +7,7 @@
 // This benchmark performs a 1D three element median filter. The
 // input data (and reference data) should be generated using the
 // median_gendata.pl perl script and dumped to a file named
 // This benchmark performs a 1D three element median filter. The
 // input data (and reference data) should be generated using the
 // median_gendata.pl perl script and dumped to a file named
-// dataset1.h You should not change anything except the
-// HOST_DEBUG and PREALLOCATE macros for your timing run.
+// dataset1.h.
 
 #include "util.h"
 
 
 #include "util.h"
 
@@ -26,10 +25,6 @@ int main( int argc, char* argv[] )
 {
   int results_data[DATA_SIZE];
 
 {
   int results_data[DATA_SIZE];
 
-  // Output the input array
-  printArray( "input",  DATA_SIZE, input_data  );
-  printArray( "verify", DATA_SIZE, verify_data );
-
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   median( DATA_SIZE, input_data, results_data );
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   median( DATA_SIZE, input_data, results_data );
@@ -40,9 +35,6 @@ int main( int argc, char* argv[] )
   median( DATA_SIZE, input_data, results_data );
   setStats(0);
 
   median( DATA_SIZE, input_data, results_data );
   setStats(0);
 
-  // Print out the results
-  printArray( "results", DATA_SIZE, results_data );
-
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
 }
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
 }
index 9c68adaf9e7937835fdd577cb98359d7913a052b..dbb756236a74b91ef508122209af1ee2bf7cefd9 100644 (file)
 // using the matmul_gendata.pl perl script and dumped to a file named
 // dataset.h. 
 
 // using the matmul_gendata.pl perl script and dumped to a file named
 // dataset.h. 
 
-
-// print out arrays, etc.
-//#define DEBUG
-
 //--------------------------------------------------------------------------
 // Includes 
 
 //--------------------------------------------------------------------------
 // Includes 
 
@@ -57,10 +53,5 @@ void thread_entry(int cid, int nc)
  
    int res = verify(ARRAY_SIZE, results_data, verify_data);
 
  
    int res = verify(ARRAY_SIZE, results_data, verify_data);
 
-#ifdef DEBUG
-   printArray("results:", ARRAY_SIZE, results_data);
-   printArray("verify :", ARRAY_SIZE, verify_data);
-#endif
-
    exit(res);
 }
    exit(res);
 }
index 870916686db6ca113a64d7010de4ea4b27f18073..54c960236d542f26fd9dfbbf88f9baa35379ad9c 100644 (file)
@@ -12,9 +12,6 @@
 // generated using the vvadd_gendata.pl perl script and dumped
 // to a file named dataset.h 
 
 // generated using the vvadd_gendata.pl perl script and dumped
 // to a file named dataset.h 
 
-// to print out arrays, etc.
-//#define DEBUG
-
 //--------------------------------------------------------------------------
 // Includes 
 
 //--------------------------------------------------------------------------
 // Includes 
 
@@ -57,10 +54,6 @@ void thread_entry(int cid, int nc)
    stats(vvadd(cid, nc, DATA_SIZE, input1_data, input2_data, results_data); barrier(nc), DATA_SIZE);
  
    if(cid == 0) {
    stats(vvadd(cid, nc, DATA_SIZE, input1_data, input2_data, results_data); barrier(nc), DATA_SIZE);
  
    if(cid == 0) {
-#ifdef DEBUG
-     printDoubleArray("out-of-place results: ", DATA_SIZE, results_data);
-     printDoubleArray("out-of-place verify : ", DATA_SIZE, verify_data);
-#endif
      int res = verifyDouble(DATA_SIZE, results_data, verify_data);
      if(res) exit(res);
    }
      int res = verifyDouble(DATA_SIZE, results_data, verify_data);
      if(res) exit(res);
    }
@@ -76,10 +69,6 @@ void thread_entry(int cid, int nc)
    stats(vvadd(cid, nc, DATA_SIZE, results_data, input2_data, results_data); barrier(nc), DATA_SIZE);
  
    if(cid == 0) {
    stats(vvadd(cid, nc, DATA_SIZE, results_data, input2_data, results_data); barrier(nc), DATA_SIZE);
  
    if(cid == 0) {
-#ifdef DEBUG
-     printDoubleArray("in-place results: ", DATA_SIZE, results_data);
-     printDoubleArray("in-place verify : ", DATA_SIZE, verify_data);
-#endif
      int res = verifyDouble(DATA_SIZE, results_data, verify_data);
      if(res) exit(res);
    }
      int res = verifyDouble(DATA_SIZE, results_data, verify_data);
      if(res) exit(res);
    }
index aed3e0d59db004a4e55b3d1c808e4c5aa736da32..ea225eb520a8e165b848d701caceade71c590251 100644 (file)
@@ -7,8 +7,7 @@
 // This benchmark tests the software multiply implemenation. The
 // input data (and reference data) should be generated using the
 // multiply_gendata.pl perl script and dumped to a file named
 // This benchmark tests the software multiply implemenation. The
 // input data (and reference data) should be generated using the
 // multiply_gendata.pl perl script and dumped to a file named
-// dataset1.h You should not change anything except the
-// HOST_DEBUG and VERIFY macros for your timing run.
+// dataset1.h
 
 #include "util.h"
 
 
 #include "util.h"
 
@@ -27,11 +26,6 @@ int main( int argc, char* argv[] )
   int i;
   int results_data[DATA_SIZE];
 
   int i;
   int results_data[DATA_SIZE];
 
-  // Output the input arrays
-  printArray( "input1",  DATA_SIZE, input_data1  );
-  printArray( "input2",  DATA_SIZE, input_data2  );
-  printArray( "verify", DATA_SIZE, verify_data );
-
 #if PREALLOCATE
   for (i = 0; i < DATA_SIZE; i++)
   {
 #if PREALLOCATE
   for (i = 0; i < DATA_SIZE; i++)
   {
@@ -45,9 +39,6 @@ int main( int argc, char* argv[] )
     results_data[i] = multiply( input_data1[i], input_data2[i] );
   }
   setStats(0);
     results_data[i] = multiply( input_data1[i], input_data2[i] );
   }
   setStats(0);
-  
-  // Print out the results
-  printArray( "results", DATA_SIZE, results_data );
 
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
 
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
index e962e829ce1c7a5b0f7a6da9cd120c58c0b6bea0..18adc25d26ca0f168fbd659b91e570c3aa372c79 100644 (file)
@@ -8,10 +8,7 @@
 // implementation is largely adapted from Numerical Recipes for C. The
 // input data (and reference data) should be generated using the
 // qsort_gendata.pl perl script and dumped to a file named
 // implementation is largely adapted from Numerical Recipes for C. The
 // input data (and reference data) should be generated using the
 // qsort_gendata.pl perl script and dumped to a file named
-// dataset1.h The smips-gcc toolchain does not support system calls
-// so printf's can only be used on a host system, not on the smips
-// processor simulator itself. You should not change anything except
-// the HOST_DEBUG and PREALLOCATE macros for your timing run.
+// dataset1.h.
 
 #include "util.h"
 #include <string.h>
 
 #include "util.h"
 #include <string.h>
@@ -76,10 +73,6 @@ void sort(size_t n, type arr[])
 
   for (;;)
   {
 
   for (;;)
   {
-#if HOST_DEBUG
-    printArray( "", n, arr );
-#endif
-
     // Insertion sort when subarray small enough.
     if ( ir-l < INSERTION_THRESHOLD )
     {
     // Insertion sort when subarray small enough.
     if ( ir-l < INSERTION_THRESHOLD )
     {
@@ -122,10 +115,6 @@ void sort(size_t n, type arr[])
       // Push pointers to larger subarray on stack,
       // process smaller subarray immediately.
 
       // Push pointers to larger subarray on stack,
       // process smaller subarray immediately.
 
-#if HOST_DEBUG
-      assert(stackp < stack+NSTACK);
-#endif
-
       if ( ir-i+1 >= j-l )
       {
         stackp[0] = ir;
       if ( ir-i+1 >= j-l )
       {
         stackp[0] = ir;
@@ -147,10 +136,6 @@ void sort(size_t n, type arr[])
 
 int main( int argc, char* argv[] )
 {
 
 int main( int argc, char* argv[] )
 {
-  // Output the input array
-  printArray( "input", DATA_SIZE, input_data );
-  printArray( "verify", DATA_SIZE, verify_data );
-
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   sort(DATA_SIZE, verify_data);
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   sort(DATA_SIZE, verify_data);
@@ -163,9 +148,6 @@ int main( int argc, char* argv[] )
   sort( DATA_SIZE, input_data );
   setStats(0);
 
   sort( DATA_SIZE, input_data );
   setStats(0);
 
-  // Print out the results
-  printArray( "test", DATA_SIZE, input_data );
-
   // Check the results
   return verify( DATA_SIZE, input_data, verify_data );
 }
   // Check the results
   return verify( DATA_SIZE, input_data, verify_data );
 }
index a14780f559b519ba57b90ecc1f727218326d5f55..d90fe2de87db1a457e0e7d60e5a41b28450b3953 100644 (file)
@@ -37,13 +37,6 @@ points to make about the toolchain.
    about how to write assembly in C here:
    http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
 
    about how to write assembly in C here:
    http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
 
- + If you look at the example benchmarks you will see that I have two
-   important macros HOST_DEBUG and VERIFY. Use HOST_DEBUG to compile the
-   benchmark on your host workstation (ie use standard gcc on Athena/Linux
-   box) and then debug the benchmark. Since you are using standard gcc you
-   can use printf's to make sure that your benchmark actually works before
-   trying it out on your RISCV processor.
-
  + Debugging C compiled code on the RISCV processor is a real pain. It is
    hard to associate the assembly with the C code and there is no
    debugger. So if you encounter a bug in your processor when running a C
  + Debugging C compiled code on the RISCV processor is a real pain. It is
    hard to associate the assembly with the C code and there is no
    debugger. So if you encounter a bug in your processor when running a C
index dc536424069473284b2324338d9ddee521fa1671..7ffc12a41c73f801c19beb216a5b2db10335cb9e 100644 (file)
@@ -8,10 +8,7 @@
 // implementation is largely adapted from Numerical Recipes for C. The
 // input data (and reference data) should be generated using the
 // qsort_gendata.pl perl script and dumped to a file named
 // implementation is largely adapted from Numerical Recipes for C. The
 // input data (and reference data) should be generated using the
 // qsort_gendata.pl perl script and dumped to a file named
-// dataset1.h The smips-gcc toolchain does not support system calls
-// so printf's can only be used on a host system, not on the smips
-// processor simulator itself. You should not change anything except
-// the HOST_DEBUG and PREALLOCATE macros for your timing run.
+// dataset1.h
 
 #include "util.h"
 #include <string.h>
 
 #include "util.h"
 #include <string.h>
@@ -107,9 +104,6 @@ void sort(size_t n, type* arrIn, type* scratchIn)
 int main( int argc, char* argv[] )
 {
   static type scratch[DATA_SIZE];
 int main( int argc, char* argv[] )
 {
   static type scratch[DATA_SIZE];
-  // Output the input array
-  printArray( "input", DATA_SIZE, input_data );
-  printArray( "verify", DATA_SIZE, verify_data );
 
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
 
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
@@ -123,9 +117,6 @@ int main( int argc, char* argv[] )
   sort(DATA_SIZE, input_data, scratch);
   setStats(0);
 
   sort(DATA_SIZE, input_data, scratch);
   setStats(0);
 
-  // Print out the results
-  printArray( "test", DATA_SIZE, input_data );
-
   // Check the results
   return verify( DATA_SIZE, input_data, verify_data );
 }
   // Check the results
   return verify( DATA_SIZE, input_data, verify_data );
 }
index 03de47d6f4577d12eeb0bd15684f288303bf6dbe..8c2355af345938f92244d3e52a246814ed897287 100644 (file)
 // disc on top of a smaller disc.
 //
 // This implementation starts with NUM_DISC discs and uses a recursive
 // disc on top of a smaller disc.
 //
 // This implementation starts with NUM_DISC discs and uses a recursive
-// algorithm to sovel the puzzle.  The smips-gcc toolchain does not support
-// system calls so printf's can only be used on a host system, not on the
-// smips processor simulator itself. You should not change anything except
-// the HOST_DEBUG and PREALLOCATE macros for your timing run.
+// algorithm to sovel the puzzle.
 
 #include "util.h"
 
 
 #include "util.h"
 
@@ -140,34 +137,6 @@ void towers_clear( struct Towers* this )
 
 }
 
 
 }
 
-#if HOST_DEBUG
-void towers_print( struct Towers* this )
-{
-  struct Node* ptr;
-  int i, numElements;
-
-  printf( "  pegA: " );
-  for ( i = 0; i < ((this->numDiscs)-list_getSize(&(this->pegA))); i++ )
-    printf( ". " );
-  for ( ptr = this->pegA.head; ptr != 0; ptr = ptr->next )
-    printf( "%d ", ptr->val );
-
-  printf( "  pegB: " );
-  for ( i = 0; i < ((this->numDiscs)-list_getSize(&(this->pegB))); i++ )
-    printf( ". " );
-  for ( ptr = this->pegB.head; ptr != 0; ptr = ptr->next )
-    printf( "%d ", ptr->val );
-
-  printf( "  pegC: " );
-  for ( i = 0; i < ((this->numDiscs)-list_getSize(&(this->pegC))); i++ )
-    printf( ". " );
-  for ( ptr = this->pegC.head; ptr != 0; ptr = ptr->next )
-    printf( "%d ", ptr->val );
-
-  printf( "\n" );
-}
-#endif
-
 void towers_solve_h( struct Towers* this, int n,
                      struct List* startPeg,
                      struct List* tempPeg,
 void towers_solve_h( struct Towers* this, int n,
                      struct List* startPeg,
                      struct List* tempPeg,
@@ -176,9 +145,6 @@ void towers_solve_h( struct Towers* this, int n,
   int val;
 
   if ( n == 1 ) {
   int val;
 
   if ( n == 1 ) {
-#if HOST_DEBUG
-    towers_print(this);
-#endif
     val = list_pop(startPeg);
     list_push(destPeg,val);
     this->numMoves++;
     val = list_pop(startPeg);
     list_push(destPeg,val);
     this->numMoves++;
@@ -202,43 +168,25 @@ int towers_verify( struct Towers* this )
   int numDiscs = 0;
 
   if ( list_getSize(&this->pegA) != 0 ) {
   int numDiscs = 0;
 
   if ( list_getSize(&this->pegA) != 0 ) {
-#if HOST_DEBUG
-    printf( "ERROR: Peg A is not empty!\n" );
-#endif
     return 2;
   }
 
   if ( list_getSize(&this->pegB) != 0 ) {
     return 2;
   }
 
   if ( list_getSize(&this->pegB) != 0 ) {
-#if HOST_DEBUG
-    printf( "ERROR: Peg B is not empty!\n" );
-#endif
     return 3;
   }
 
   if ( list_getSize(&this->pegC) != this->numDiscs ) {
     return 3;
   }
 
   if ( list_getSize(&this->pegC) != this->numDiscs ) {
-#if HOST_DEBUG
-    printf( " ERROR: Expected %d discs but found only %d discs!\n", \
-            this->numDiscs, list_getSize(&this->pegC) );
-#endif
     return 4;
   }
 
   for ( ptr = this->pegC.head; ptr != 0; ptr = ptr->next ) {
     numDiscs++;
     if ( ptr->val != numDiscs ) {
     return 4;
   }
 
   for ( ptr = this->pegC.head; ptr != 0; ptr = ptr->next ) {
     numDiscs++;
     if ( ptr->val != numDiscs ) {
-#if HOST_DEBUG
-      printf( " ERROR: Expecting disc %d on peg C but found disc %d instead!\n", \
-              numDiscs, ptr->val );
-#endif
       return 5;
     }
   }
 
   if ( this->numMoves != ((1 << this->numDiscs) - 1) ) {
       return 5;
     }
   }
 
   if ( this->numMoves != ((1 << this->numDiscs) - 1) ) {
-#if HOST_DEBUG
-    printf( " ERROR: Expecting %d num moves but found %d instead!\n", \
-            ((1 << this->numDiscs) - 1), this->numMoves );
-#endif
     return 6;
   }
 
     return 6;
   }
 
@@ -280,12 +228,6 @@ int main( int argc, char* argv[] )
   towers_solve( &towers );
   setStats(0);
 
   towers_solve( &towers );
   setStats(0);
 
-  // Print out the results
-
-#if HOST_DEBUG
-  towers_print( &towers );
-#endif
-
   // Check the results
   return towers_verify( &towers );
 }
   // Check the results
   return towers_verify( &towers );
 }
index 00e1593d33731a5db706b6b16699a5225800b641..d8ff01c86f81e0b4d5acc1bb5960289664d5e49e 100644 (file)
@@ -7,11 +7,7 @@
 // This benchmark uses adds to vectors and writes the results to a
 // third vector. The input data (and reference data) should be
 // generated using the vvadd_gendata.pl perl script and dumped
 // This benchmark uses adds to vectors and writes the results to a
 // third vector. The input data (and reference data) should be
 // generated using the vvadd_gendata.pl perl script and dumped
-// to a file named dataset1.h The smips-gcc toolchain does not
-// support system calls so printf's can only be used on a host system,
-// not on the smips processor simulator itself. You should not change
-// anything except the HOST_DEBUG and PREALLOCATE macros for your timing
-// runs.
+// to a file named dataset1.h.
  
 #include "util.h"
 
  
 #include "util.h"
 
@@ -37,11 +33,6 @@ int main( int argc, char* argv[] )
 {
   int results_data[DATA_SIZE];
 
 {
   int results_data[DATA_SIZE];
 
-  // Output the input array
-  printArray( "input1", DATA_SIZE, input1_data );
-  printArray( "input2", DATA_SIZE, input2_data );
-  printArray( "verify", DATA_SIZE, verify_data );
-
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   vvadd( DATA_SIZE, input1_data, input2_data, results_data );
 #if PREALLOCATE
   // If needed we preallocate everything in the caches
   vvadd( DATA_SIZE, input1_data, input2_data, results_data );
@@ -52,9 +43,6 @@ int main( int argc, char* argv[] )
   vvadd( DATA_SIZE, input1_data, input2_data, results_data );
   setStats(0);
 
   vvadd( DATA_SIZE, input1_data, input2_data, results_data );
   setStats(0);
 
-  // Print out the results
-  printArray( "results", DATA_SIZE, results_data );
-
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
 }
   // Check the results
   return verify( DATA_SIZE, results_data, verify_data );
 }