xt_reftb.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Customer ID=11656; Build=0x5f626; Copyright (c) 2009-2013 by Tensilica Inc. ALL RIGHTS RESERVED.
  3. * These coded instructions, statements, and computer programs are the
  4. * copyrighted works and confidential proprietary information of
  5. * Tensilica Inc. They may be adapted and modified by bona fide
  6. * purchasers for internal use, but neither the original nor any
  7. * adapted or modified version may be disclosed or distributed to
  8. * third parties in any manner, medium, or form, in whole or in part,
  9. * without the prior written consent of Tensilica Inc.
  10. *
  11. * This software and its derivatives are to be executed solely on
  12. * products incorporating a Tensilica processor.
  13. */
  14. // Utility routines for returning pass/fail status in HW simulations
  15. #ifndef XT_REF_TESTBENCH_H
  16. #define XT_REF_TESTBENCH_H 1
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. // Exit routines for HW simulation
  21. extern int diag_pass();
  22. extern int diag_fail();
  23. // Set exit status for HW simulation
  24. int set_diag_status(int stat);
  25. // Setup for user power toggling
  26. extern int setup_power_toggle();
  27. // Return exit status location
  28. extern unsigned int* testbench_exit_location();
  29. // Return power toggle location
  30. extern unsigned int* testbench_power_toggle_location();
  31. // Change exit status location
  32. // You must also change the plusarg "+DVMagicExit" sent to the HW simulator
  33. // or change the argument "--exit_location" sent to the ISS
  34. extern unsigned int* set_testbench_exit_location(unsigned int*);
  35. // Change power toggle location
  36. // You must also change the plusarg "+DVPowerLoc" sent to the HW simulator
  37. extern unsigned int* set_testbench_power_toggle_location(unsigned int*);
  38. // Exit routines with status message
  39. //
  40. static inline
  41. int pass(const char *msg)
  42. {
  43. return diag_pass();
  44. }
  45. static inline
  46. int fail(const char *msg)
  47. {
  48. return diag_fail();
  49. }
  50. #define POWER_TOGGLE_ON 1
  51. #define POWER_TOGGLE_OFF 0
  52. // Routine to turn on and off power toggle
  53. // Does a magic write that Monitors.v intercepts and appropriately turns
  54. // SAIF dumping on and offf
  55. //
  56. extern volatile unsigned int *_reftb_power_toggle;
  57. __attribute__ ((always_inline))
  58. static inline
  59. int set_power_toggle(int val)
  60. {
  61. #ifdef __XTENSA__
  62. *_reftb_power_toggle = val;
  63. #endif
  64. return val;
  65. }
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif // XT_REF_TESTBENCH_H