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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [sw/] [c/] [aeMB_testbench.c] - Diff between revs 46 and 53

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

Rev 46 Rev 53
Line 1... Line 1...
/*
/*
 * $Id: aeMB_testbench.c,v 1.8 2007-11-03 08:40:18 sybreon Exp $
 * $Id: aeMB_testbench.c,v 1.9 2007-11-09 20:51:53 sybreon Exp $
 *
 *
 * AEMB Function Verification C Testbench
 * AEMB Function Verification C Testbench
 * Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
 * Copyright (C) 2004-2007 Shawn Tan Ser Ngiap <shawn.tan@aeste.net>
 *
 *
 * This library is free software; you can redistribute it and/or
 * This library is free software; you can redistribute it and/or
Line 23... Line 23...
 * It tests a whole gamut of operations and is tightly linked to the
 * It tests a whole gamut of operations and is tightly linked to the
 * ae68_testbench.v testbench module for verification.
 * ae68_testbench.v testbench module for verification.
 *
 *
 * HISTORY
 * HISTORY
 * $Log: not supported by cvs2svn $
 * $Log: not supported by cvs2svn $
 
 * Revision 1.8  2007/11/03 08:40:18  sybreon
 
 * Minor code cleanup.
 
 *
 * Revision 1.7  2007/11/02 18:32:19  sybreon
 * Revision 1.7  2007/11/02 18:32:19  sybreon
 * Enable MSR_IE with software.
 * Enable MSR_IE with software.
 *
 *
 * Revision 1.6  2007/04/30 15:57:10  sybreon
 * Revision 1.6  2007/04/30 15:57:10  sybreon
 * Removed byte acrobatics.
 * Removed byte acrobatics.
Line 262... Line 265...
    }
    }
  }
  }
  return 0;
  return 0;
}
}
 
 
 
 
 
/**
 
   FSL TEST ROUTINE
 
*/
 
 
 
int fsl_test ()
 
{
 
  // TEST FSL1 ONLY
 
  int FSL = 0xCAFEF00D;
 
 
 
  asm ("PUT %0, RFSL1" :: "r"(FSL));
 
  asm ("GET %0, RFSL1" : "=r"(FSL));
 
 
 
  if (FSL != 0x04) return -1;
 
 
 
  asm ("PUT %0, RFSL31" :: "r"(FSL));
 
  asm ("GET %0, RFSL31" : "=r"(FSL));
 
 
 
  if (FSL != 0x7C) return -1;
 
 
 
  return 0;
 
}
 
 
/**
/**
   MAIN TEST PROGRAMME
   MAIN TEST PROGRAMME
 
 
   This is the main test procedure. It will output signals onto the
   This is the main test procedure. It will output signals onto the
   MPI port that is checked by the testbench.
   MPI port that is checked by the testbench.
Line 278... Line 304...
  int* mpi = (int*)0xFFFFFFFF;
  int* mpi = (int*)0xFFFFFFFF;
 
 
  // Number of each test to run
  // Number of each test to run
  int max = 10;
  int max = 10;
 
 
 
  // FSL TEST
 
  if (fsl_test() == -1) { *mpi = 0x4641494C; }
 
 
  // Enable Global Interrupts
  // Enable Global Interrupts
  int_enable();
  int_enable();
 
 
  // Fibonacci Test
  // Fibonacci Test
  if (fib_test(max) == -1) { *mpi = 0x4641494C; }
  if (fib_test(max) == -1) { *mpi = 0x4641494C; }

powered by: WebSVN 2.1.0

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