Skip to content

Best Practice for Modeling W1S and W1C Access to Same Bits #270

Answered by amykyta3
vgaliCelero asked this question in Q&A
Discussion options

You must be logged in to vote

Ah i see what you mean. This is possible by creating separate trigger bits using a combination of the singlepulse, hwset, and hwclr properties.

See below:

reg {
    field {
        // Implements the actual storage element for the clock-enable field
        sw = rw; // Software can write this to 1 or 0 directly if desired
        hw = r; // provide state of this bit to hardware
    } clock_enable = 0;
} clock_ctrl;


reg {
    // Define a generic trigger bit
    field trigger_bit {
        sw = w; // write-only
        hw = na; // hwif does not need access
        singlepulse; // If software writes this to 1, clears back to 0 automatically on the next clock cycle.
    };

    // Instantiat…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@amykyta3
Comment options

Answer selected by amykyta3
@vgaliCelero
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants