You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xsim_1.c 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**********************************************************************/
  2. /* ____ ____ */
  3. /* / /\/ / */
  4. /* /___/ \ / */
  5. /* \ \ \/ */
  6. /* \ \ Copyright (c) 2003-2020 Xilinx, Inc. */
  7. /* / / All Right Reserved. */
  8. /* /---/ /\ */
  9. /* \ \ / \ */
  10. /* \___\/\___\ */
  11. /**********************************************************************/
  12. #if defined(_WIN32)
  13. #include "stdio.h"
  14. #define IKI_DLLESPEC __declspec(dllimport)
  15. #else
  16. #define IKI_DLLESPEC
  17. #endif
  18. #include "iki.h"
  19. #include <string.h>
  20. #include <math.h>
  21. #ifdef __GNUC__
  22. #include <stdlib.h>
  23. #else
  24. #include <malloc.h>
  25. #define alloca _alloca
  26. #endif
  27. /**********************************************************************/
  28. /* ____ ____ */
  29. /* / /\/ / */
  30. /* /___/ \ / */
  31. /* \ \ \/ */
  32. /* \ \ Copyright (c) 2003-2020 Xilinx, Inc. */
  33. /* / / All Right Reserved. */
  34. /* /---/ /\ */
  35. /* \ \ / \ */
  36. /* \___\/\___\ */
  37. /**********************************************************************/
  38. #if defined(_WIN32)
  39. #include "stdio.h"
  40. #define IKI_DLLESPEC __declspec(dllimport)
  41. #else
  42. #define IKI_DLLESPEC
  43. #endif
  44. #include "iki.h"
  45. #include <string.h>
  46. #include <math.h>
  47. #ifdef __GNUC__
  48. #include <stdlib.h>
  49. #else
  50. #include <malloc.h>
  51. #define alloca _alloca
  52. #endif
  53. typedef void (*funcp)(char *, char *);
  54. extern int main(int, char**);
  55. IKI_DLLESPEC extern void execute_40(char*, char *);
  56. IKI_DLLESPEC extern void execute_41(char*, char *);
  57. IKI_DLLESPEC extern void execute_37(char*, char *);
  58. IKI_DLLESPEC extern void execute_39(char*, char *);
  59. IKI_DLLESPEC extern void transaction_0(char*, char*, unsigned, unsigned, unsigned);
  60. IKI_DLLESPEC extern void transaction_1(char*, char*, unsigned, unsigned, unsigned);
  61. IKI_DLLESPEC extern void vhdl_transfunc_eventcallback(char*, char*, unsigned, unsigned, unsigned, char *);
  62. funcp funcTab[7] = {(funcp)execute_40, (funcp)execute_41, (funcp)execute_37, (funcp)execute_39, (funcp)transaction_0, (funcp)transaction_1, (funcp)vhdl_transfunc_eventcallback};
  63. const int NumRelocateId= 7;
  64. void relocate(char *dp)
  65. {
  66. iki_relocate(dp, "xsim.dir/pwm_test_db_behav/xsim.reloc", (void **)funcTab, 7);
  67. iki_vhdl_file_variable_register(dp + 6264);
  68. iki_vhdl_file_variable_register(dp + 6320);
  69. /*Populate the transaction function pointer field in the whole net structure */
  70. }
  71. void sensitize(char *dp)
  72. {
  73. iki_sensitize(dp, "xsim.dir/pwm_test_db_behav/xsim.reloc");
  74. }
  75. void simulate(char *dp)
  76. {
  77. iki_schedule_processes_at_time_zero(dp, "xsim.dir/pwm_test_db_behav/xsim.reloc");
  78. // Initialize Verilog nets in mixed simulation, for the cases when the value at time 0 should be propagated from the mixed language Vhdl net
  79. iki_execute_processes();
  80. // Schedule resolution functions for the multiply driven Verilog nets that have strength
  81. // Schedule transaction functions for the singly driven Verilog nets that have strength
  82. }
  83. #include "iki_bridge.h"
  84. void relocate(char *);
  85. void sensitize(char *);
  86. void simulate(char *);
  87. extern SYSTEMCLIB_IMP_DLLSPEC void local_register_implicit_channel(int, char*);
  88. extern SYSTEMCLIB_IMP_DLLSPEC int xsim_argc_copy ;
  89. extern SYSTEMCLIB_IMP_DLLSPEC char** xsim_argv_copy ;
  90. int main(int argc, char **argv)
  91. {
  92. iki_heap_initialize("ms", "isimmm", 0, 2147483648) ;
  93. iki_set_sv_type_file_path_name("xsim.dir/pwm_test_db_behav/xsim.svtype");
  94. iki_set_crvs_dump_file_path_name("xsim.dir/pwm_test_db_behav/xsim.crvsdump");
  95. void* design_handle = iki_create_design("xsim.dir/pwm_test_db_behav/xsim.mem", (void *)relocate, (void *)sensitize, (void *)simulate, (void*)0, 0, isimBridge_getWdbWriter(), 0, argc, argv);
  96. iki_set_rc_trial_count(100);
  97. (void) design_handle;
  98. return iki_simulate_design();
  99. }