ext/bridge.c in origen_sim-0.12.0 vs ext/bridge.c in origen_sim-0.13.0

- old
+ new

@@ -536,10 +536,11 @@ /// When Origen requests a cycle, time will be advanced and this func will be called again. PLI_INT32 bridge_wait_for_msg(p_cb_data data) { UNUSED(data); int max_msg_len = 1024; char msg[max_msg_len]; + char comment[128]; int err; char *opcode, *arg1, *arg2, *arg3, *arg4; vpiHandle handle; s_vpi_value v; @@ -704,17 +705,22 @@ v.value.str = arg2; vpi_put_value(handle, &v, NULL, vpiNoDelay); } break; // Set Comment - // c^Some comment about the pattern + // c^0^Some comment about the pattern case 'c' : - handle = vpi_handle_by_name(ORIGEN_SIM_TESTBENCH_CAT("debug.comments"), NULL); arg1 = strtok(NULL, "^"); + arg2 = strtok(NULL, "^"); + strcpy(comment, ORIGEN_SIM_TESTBENCH_CAT("debug.comments")); + strcat(comment, arg1); + + handle = vpi_handle_by_name(comment, NULL); + v.format = vpiStringVal; - v.value.str = arg1; + v.value.str = arg2; vpi_put_value(handle, &v, NULL, vpiNoDelay); break; // Log all messages // d^1 Turn logging on // d^0 Turn logging off @@ -754,9 +760,13 @@ break; // Get version, returns the version of OrigenSim the DUT object was compiled with // i^ case 'i' : client_put(ORIGEN_SIM_VERSION"\n"); + break; + // Flush + case 'j' : + vpi_flush(); break; default : vpi_printf("ERROR: Illegal message received from Origen: %s\n", orig_msg); runtime_errors += 1; end_simulation();