Merge branch 'master' of github.com:steveicarus/iverilog

This commit is contained in:
Cary R 2015-08-18 16:23:02 -07:00
commit 19009ec808
1 changed files with 33 additions and 35 deletions

View File

@ -141,46 +141,44 @@ void verify_version(char*ivl_ver, char*commit)
} }
delete[] commit; delete[] commit;
char*vvp_ver = strdup(VERSION); int file_major, file_minor, file_minor2;
char *vp, *ip; char file_extra[128];
/* Check the major/minor version. */ // Old style format: 0.<major>.<minor> <extra>
ip = strrchr(ivl_ver, '.'); // This also catches a potential new-new format that has
*ip = '\0'; // another sub-minor number.
vp = strrchr(vvp_ver, '.'); file_extra[0] = 0;
*vp = '\0'; int rc = sscanf(ivl_ver, "%d.%d.%d %128s", &file_major, &file_minor, &file_minor2, file_extra);
if (strcmp(ivl_ver, vvp_ver) != 0) {
vpi_mcd_printf(1, "Error: VVP input file version %s can not " // If it wasn't the old style format, try the new format:
"be run with run time version %s!\n", // <major>.<minor> <extra>
ivl_ver, vvp_ver); if (rc == 2) {
file_extra[0] = 0;
rc = sscanf(ivl_ver, "%d.%d %128s", &file_major, &file_minor, file_extra);
file_minor2 = 0;
}
// If this was the old format, the file_major will be 0. In
// this case it is not really what we meant, so convert to the
// new format.
if (file_major == 0) {
file_major = file_minor;
file_minor = file_minor2;
file_minor2 = 0;
}
if (VERSION_MAJOR != file_major) {
vpi_mcd_printf(1, "Error: VVP input file %d.%d can not "
"be run with run time version %s\n",
file_major, file_minor, VERSION);
exit(1); exit(1);
} }
/* Check that the sub-version is compatible. */ if (VERSION_MINOR < file_minor) {
ip += 1; vpi_mcd_printf(1, "Warning: VVP input file sub version %d.%d"
vp += 1; " is greater than the run time version %s.\n",
int ivl_sv, vvp_sv; file_major, file_minor, VERSION);
if (strcmp(ip, "devel") == 0) {
ivl_sv = -1;
} else {
int res = sscanf(ip, "%d", &ivl_sv);
assert(res == 1);
} }
if (strcmp(vp, "devel") == 0) {
vvp_sv = -1;
} else {
int res = sscanf(vp, "%d", &vvp_sv);
assert(res == 1);
}
if (ivl_sv > vvp_sv) {
if (verbose_flag) vpi_mcd_printf(1, " ... ");
vpi_mcd_printf(1, "Warning: VVP input file sub-version %s is "
"greater than the run time sub-version %s!\n",
ip, vp);
}
delete[] ivl_ver;
free(vvp_ver);
} }
int vpip_delay_selection = _vpiDelaySelTypical; int vpip_delay_selection = _vpiDelaySelTypical;