Reply To: Riviera / MATLAB Cosim with OSVVM Scripting

Why OSVVM™? Forums OSVVM Riviera / MATLAB Cosim with OSVVM Scripting Reply To: Riviera / MATLAB Cosim with OSVVM Scripting

#2468
Jim Lewis
Member

Hi Brad,
Cool. If we end up needing that, it will be added. However, that said, I am curious as to why it is needed. Normally variable expansion is done in the calling scripts.

So if I do:
SetExtendedSimulateOptions "-dbg -t 0 -ieee_nowarn -dataset {./sim} -datasetname {sim} -loadvhpi $aldec/bin/aldec_matlab_cosim.dll:ml2hdl"

Then I do:
GetExtendedSimulateOptions

The results are:
-dbg -t 0 -ieee_nowarn -dataset {./sim} -datasetname {sim} -loadvhpi C:/tools/Aldec/Riviera-PRO-2023.10-x64/bin/aldec_matlab_cosim.dll:ml2hdl

What I see here is that the $aldec variable was expanded when the parameter of the call referenced it.

If you are doing something that is deferring the variable expansion until later, then reference the aldec variable as $::aldec. The “::” prefix specifies to access the variable from the global space.

In a similar fashion, you can access any variable from the OSVVM space by prefixing it with ::osvvm. So the following does the same as GetExtendedSimulateOptions:
puts $::osvvm::ExtendedSimulateOptions

If that does not work for some reason, then we will add the variable to the aldec vendor script.

Best Regards,
Jim
P.S. Once you get the flow going, if you are interested in doing a blog post on OSVVM.org, just let me know.