Skip to content

Default VCS Python DUTs to no_save#87

Closed
Martinnn674 wants to merge 1 commit into
XS-MLVP:masterfrom
Martinnn674:codex/vcs-no-save-default
Closed

Default VCS Python DUTs to no_save#87
Martinnn674 wants to merge 1 commit into
XS-MLVP:masterfrom
Martinnn674:codex/vcs-no-save-default

Conversation

@Martinnn674
Copy link
Copy Markdown

Summary

  • default generated Python DUTs for VCS to pass -no_save when callers do not provide explicit simulator args
  • preserve existing explicit-args behavior by only adding the default when args is empty
  • add a render-level regression test for the VCS Python template and non-VCS output

Fixes #86.

Verification

  • NO_BUILD_XSPCOMM=1 cmake . -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_BUILD_PARALLEL=2
  • NO_BUILD_XSPCOMM=1 cmake --build build --target test_codegen_python_vcs_defaults -j2
  • ctest --test-dir build -R test_codegen_python_vcs_defaults --output-on-failure

@Sergeant-Salz
Copy link
Copy Markdown

Sergeant-Salz commented Jun 3, 2026

@Martinnn674 In your patch, the flag is only used when args is None, however I think it might make sense to also append it to a non-empty tuple? Is there a reason you would avoid that?

I suggest:

def __init__(self, *args, **kwargs):
        {% if __SIMULATOR__ == "vcs" %}
        # For VCS we need this workaround. See issue #86
        if not args or '-no_save' not in args:
            args = args if args else () + ('-no_save',)
        {% endif %}

@Martinnn674
Copy link
Copy Markdown
Author

Good point. I kept it empty only to avoid changing behavior for callers who already pass explicit VCS args, but I agree that if picker does not support VCS save/restore here, adding -no_save whenever it is absent is the better default.

Small note tho I think the suggested assignment would leave non empty args unchanged. I would update it to append while avoiding duplicates, something like:

if "-no_save" not in args:
    args = args + ("-no_save",)

That should preserve caller provided args and still make the workaround apply consistently.

@Martinnn674 Martinnn674 force-pushed the codex/vcs-no-save-default branch from 837dab4 to d8cb185 Compare June 3, 2026 14:53
@Makiras
Copy link
Copy Markdown
Contributor

Makiras commented Jun 5, 2026

Because #88 successfully launched VCS by disabling ASLR without using the -no_save option, we have decided to abandon this workaround and instead opt for the disable ASLR approach which retains more functionality.

Of course, we still appreciate your efforts in submitting the PR.

@Makiras Makiras closed this Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generated library hijacks execution, spawning an empty Python REPL

3 participants