vvp: Stop simulation in case of errors in $ivl_string_method$to_vec.

This commit is contained in:
Maciej Suminski 2014-11-25 18:22:37 +01:00
parent ca2ef5c956
commit a8d43fa743
1 changed files with 4 additions and 2 deletions

View File

@ -149,12 +149,14 @@ static PLI_INT32 to_vec_calltf(ICARUS_VPI_CONST PLI_BYTE8*name)
int vec_size = vpi_get(vpiSize, vec);
if(str_size <= 0) {
vpi_printf("ERROR: Cannot cast empty string");
assert(0);
vpi_control(vpiFinish, 0);
return 0;
}
if(vec_size != str_size * 8) {
vpi_printf("ERROR: String and vector size do not match");
assert(0);
vpi_control(vpiFinish, 0);
return 0;
}
str_val.format = vpiStringVal;