Skip to content

pysim: Throw Error or Warning on writing to non-port variable #318

Closed
@mszep

Description

@mszep

As a beginner, this tripped me up:

I was changing a Signal's value both in the module's internal logic and in my sync process during simulation, and wondering why I was getting nondeterministic results.

If there are legitimate reasons to drive internal (non-port) Signals from a test bench, perhaps throwing a Warning is sufficient, or allowing an optional parameter allow_drive_internal_signal=True passed to the simulator constructor?

Activity

whitequark

whitequark commented on Feb 10, 2020

@whitequark
Member

This is indeed a serious issue that I was considering as a part of #228, but it's important enough to have its own bug too. What you suggest would work, but I have in mind a plan for a more flexible approach; I haven't yet described it in detail though.

added this to the 0.5 milestone on Jun 11, 2024
whitequark

whitequark commented on Jun 11, 2024

@whitequark
Member

In the 0.5 release this will raise a DriverConflict error with the message "Combinationally driven signals cannot be overriden by testbenches".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @whitequark@mszep

        Issue actions

          pysim: Throw Error or Warning on writing to non-port variable · Issue #318 · amaranth-lang/amaranth