How to use string as event or as time?

I have a a transaction which contain:

string delay;
string delay_type;

If delay_type == “time” the delay will have the following structure “3ns” (number and time unit)

If delay_type == “event” the delay will have the following structure “@(posedge clk)” (@(posedge/negdge of signal))

How can I use this in the bfm?

For example in case of delay_type == “time” I want to be able to do: #3ns (where 3ns is the delay string)

And in case of delay_type == “event” I want to be able to wait for the event (for example for the posedge of some signal)

In reply to saritr:
You would be better off trying to convert the text file of transactions you are reading directly to SystemVerilog. Or if you have a limited number of events, encoding them into sothing you can branch into a case statement might be feasible.

In reply to dave_59:

Is there any option to pass a signal from component to componenet (for example from sequene/transaction to driver?

In reply to saritr:

If by signal, you mean an RTL variable or net, the answer is not directly. There are no pointers in SystemVerilog. You can only get handles to class objects and interface instances.

In reply to dave_59:

By signal I mean for vif.clk foe example (where vif is the virtual interface).

In reply to dave_59:

What do you mean by convert the text file of transactions you are reading directly to SystemVerilog?

In reply to saritr:

I was assuming you got those string values from reading some text file that was created before starting the simulation. It is going to be hard to explain what options you have without knowing more about those strings get generated in the first place. Unfortunately, it might be too difficult to have this discussion in this kins of forum. I suggest you look for some local expertise.