int VhpiStartupCbHdl::run_callback(void) { gpi_sim_info_t sim_info; sim_info.argc = 0; sim_info.argv = NULL; sim_info.product = gpi_copy_name(vhpi_get_str(vhpiNameP, NULL)); sim_info.version = gpi_copy_name(vhpi_get_str(vhpiToolVersionP, NULL)); gpi_embed_init(&sim_info); free(sim_info.product); free(sim_info.version); return 0; }
int VpiStartupCbHdl::run_callback(void) { s_vpi_vlog_info info; gpi_sim_info_t sim_info; vpi_get_vlog_info(&info); sim_info.argc = info.argc; sim_info.argv = info.argv; sim_info.product = info.product; sim_info.version = info.version; gpi_embed_init(&sim_info); return 0; }
void fli_elab_cb(void *nothing) { LOG_INFO("fli_elab_cb called\n"); fli_table = new FliImpl("FLI"); gpi_register_impl(fli_table); gpi_load_extra_libs(); // Elaboration has already happened so jump straight in! gpi_sim_info_t sim_info; char *version = mti_GetProductVersion(); // Returned pointer must not be freed // copy in sim_info.product // FIXME split product and version from returned string? sim_info.argc = 0; sim_info.argv = NULL; sim_info.product = version; sim_info.version = version; gpi_embed_init(&sim_info); }
int FliStartupCbHdl::run_callback(void) { gpi_sim_info_t sim_info; char *c_info = mti_GetProductVersion(); // Returned pointer must not be freed std::string info = c_info; std::string search = " Version "; std::size_t found = info.find(search); std::string product_str = c_info; std::string version_str = c_info; if (found != std::string::npos) { product_str = info.substr(0,found); version_str = info.substr(found+search.length()); LOG_DEBUG("Found Version string at %d", found); LOG_DEBUG(" product: %s", product_str.c_str()); LOG_DEBUG(" version: %s", version_str.c_str()); } std::vector<char> product(product_str.begin(), product_str.end()); std::vector<char> version(version_str.begin(), version_str.end()); product.push_back('\0'); version.push_back('\0'); // copy in sim_info.product sim_info.argc = 0; sim_info.argv = NULL; sim_info.product = &product[0]; sim_info.version = &version[0]; gpi_embed_init(&sim_info); return 0; }