diff --git a/ivtest/vpi/poke_escaped.c b/ivtest/vpi/poke_escaped.c new file mode 100644 index 000000000..bf3d1a064 --- /dev/null +++ b/ivtest/vpi/poke_escaped.c @@ -0,0 +1,42 @@ +#include "vpi_user.h" + +static PLI_INT32 poke_escaped_calltf(PLI_BYTE8 *xx) +{ + vpiHandle scope; + vpiHandle variable; + s_vpi_value value; + + (void)xx; /* Parameter is not used. */ + + scope = vpi_handle(vpiScope, NULL); + variable = vpi_handle_by_name("!\"escaped\"!\\", scope); + if (variable == 0) { + vpi_printf("FAILED: failed to find !\"escaped\"!\\ by name\n"); + vpi_sim_control(vpiFinish, 1); + return 0; + } + + value.format = vpiStringVal; + value.value.str = "PASSED"; + + vpi_put_value(variable, &value, 0, vpiNoDelay); + + return 0; +} + +static void poke_escaped_register(void) +{ + s_vpi_systf_data tf_data; + + tf_data.type = vpiSysTask; + tf_data.tfname = "$poke_escaped"; + tf_data.calltf = poke_escaped_calltf; + tf_data.compiletf = 0; + tf_data.sizetf = 0; + vpi_register_systf(&tf_data); +} + +void (*vlog_startup_routines[])(void) = { + poke_escaped_register, + 0 +}; diff --git a/ivtest/vpi/poke_escaped.v b/ivtest/vpi/poke_escaped.v new file mode 100644 index 000000000..5fd8e6085 --- /dev/null +++ b/ivtest/vpi/poke_escaped.v @@ -0,0 +1,13 @@ +module test; + +reg [6*8-1:0] \!"escaped"!\ ; + +initial begin + \!"escaped"!\ = "FAILED"; + + $poke_escaped; + + $display("%s", \!"escaped"!\ ); +end + +endmodule diff --git a/ivtest/vpi_gold/poke_escaped.gold b/ivtest/vpi_gold/poke_escaped.gold new file mode 100644 index 000000000..f6b6d0be3 --- /dev/null +++ b/ivtest/vpi_gold/poke_escaped.gold @@ -0,0 +1,3 @@ +Compiling vpi/poke_escaped.c... +Making poke_escaped.vpi from poke_escaped.o... +PASSED diff --git a/ivtest/vpi_regress.list b/ivtest/vpi_regress.list index c3085accb..895a9ef23 100644 --- a/ivtest/vpi_regress.list +++ b/ivtest/vpi_regress.list @@ -109,6 +109,7 @@ mipname normal mipname.c mipname.log myscope normal myscope.c myscope.gold myscope2 normal myscope2.c myscope2.gold nulls1 normal nulls1.c nulls1.log +poke_escaped normal poke_escaped.c poke_escaped.gold pokevent normal pokevent.cc pokevent.log pokereg normal pokereg.cc pokereg.log ports_params normal ports_params.c ports_params.gold