Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented PLUSARGS for FLI #1424

Merged
merged 2 commits into from Feb 21, 2020
Merged

Conversation

ktbarrett
Copy link
Member

@ktbarrett ktbarrett commented Feb 19, 2020

Fixed version of b283b48. Uses Tcl_GetStringResult instead of accessing the internal result field, this works on TCL 8.5 and 8.6. Fixes #1404.

Finally got 2019.1 setup and tested this PR against it as well as 10.5c and 10.7c.

I tried using Tcl_GetVar2Ex to grab a reference to argv, then do processing on it, but there is something weird about how Questa maintains its TCL interpreter because it returns a message that the variable isn't defined. mti_Cmd seems to work.

@eric-wieser
Copy link
Member

Can you use return -level 0 $argv in place of GetVar2Ex, and then extract items from the output of GetObjResulr?

@ktbarrett
Copy link
Member Author

Don't merge just yet, need to update newsfragment to right PR and add some deallocation.

@eric-wieser That seems like it would work, I'll try it.

@ktbarrett ktbarrett force-pushed the questa_plusargs branch 2 times, most recently from 88f927f to e224169 Compare February 20, 2020 03:20
Copy link
Contributor

@themperek themperek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks OK now on my side.

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, thanks - one possible bug, and some other small comments.

The FLI does not offer any utility to easily grab the argc/argv from the
simulator. I use Questa's included TCL interpreter C API to access the
TCL 'argv' variable.

The 'argv' variable references the outer vsim call's arguments due to how
the current makefiles are setup, so the PLUSARGS variable was added back
to the outer call. PLUSARGS must also remain on the inner call for the
VPI implementation to work.
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@eric-wieser eric-wieser added the type:feature new or enhanced functionality label Feb 21, 2020
@imphil imphil merged commit e9b6c5d into cocotb:master Feb 21, 2020
@imphil imphil added this to the 1.4 milestone Feb 21, 2020
@ktbarrett ktbarrett deleted the questa_plusargs branch February 21, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature new or enhanced functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passing plusargs to FLI: Find code that works with different TCL versions
4 participants