ext/main.c in ruby-vpi-16.0.1 vs ext/main.c in ruby-vpi-17.0.0

- old
+ new

@@ -21,25 +21,27 @@ // load the VPI interface for Ruby Init_vpi(); rb_define_module_function(mVpi, "relay_verilog", main_relay_verilog, 0); rb_define_module_function(mVpi, "relay_ruby_reason", main_relay_ruby_reason, 0); - // initialize the Ruby bench - char* benchFile = getenv("RUBYVPI_BOOTSTRAP"); + // some compilers have trouble with pointers to the va_list + // type. See ext/Rakefile and the user manual for details + rb_define_alias(mVpi, "vpi_vprintf", "vpi_printf"); + rb_define_alias(mVpi, "vpi_mcd_vprintf", "vpi_mcd_printf"); - if (benchFile != NULL) { - ruby_script(benchFile); - rb_load_file(benchFile); - } - else { - common_printf("error: environment variable RUBY_VPI__RUBY_BENCH_FILE is uninitialized."); - exit(EXIT_FAILURE); - } - // run the test bench - ruby_run(); + char* bootLoader = getenv("RUBYVPI_BOOT_LOADER"); + char* bootTarget = getenv("RUBYVPI_BOOT_TARGET"); - ruby_finalize(); + if (bootLoader != NULL && bootTarget != NULL) { + ruby_script(bootTarget); + rb_load_file(bootLoader); + ruby_run(); + } + else { + common_printf("error: the RUBYVPI_BOOT_LOADER and RUBYVPI_BOOT_TARGET environment variables are not initialized."); + exit(EXIT_FAILURE); + } } VALUE main_relay_verilog(VALUE arSelf) { relay_verilog(); return arSelf;