Skip to content

Commit 60fbb6b

Browse files
committed
[cosim] Update comment on set_mip in Cosim interface
The concept of pre and post MIP values was introduced a while ago but the comments in the interface weren't updated to explain what they are.
1 parent d53035b commit 60fbb6b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

dv/cosim/cosim.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,15 @@ class Cosim {
8585

8686
// Set the value of MIP.
8787
//
88-
// At the next call of `step`, the MIP value will take effect (i.e. if it's a
88+
// Two versions of MIP must be supplied the `pre_mip` and the `post_mip`. The
89+
// `pre_mip` is the value of MIP that is used to determine if an interrupt is
90+
// pending. The `post_mip` is the value of MIP that the next instruction
91+
// executed (which will be the first instruction of the interrupt vector when
92+
// an interrupt ir triggered) observes. These will be different in the case
93+
// where an interrupt is raised triggering an interrupt handler but then
94+
// drops before the first instruction of the handler has executed.
95+
//
96+
// At the next call of `step`, the MIP values will take effect (i.e. if it's a
8997
// new interrupt that is enabled it will step straight to that handler).
9098
virtual void set_mip(uint32_t pre_mip, uint32_t post_mip) = 0;
9199

0 commit comments

Comments
 (0)