This question is on one feature mentioned in the early adapter release of the new portable stimulus specification standard.
Refering to examples 26, 30 and 32 (pdf pages 68, 70 and 72 respectively), the document says: “comp” is a handle to the component context in which the action is executing. I interpret this to mean the instance of the component (somewhat equivalent to “this” in C++ code), as in:
// from examples 26 and 32
component pss_top { multimedia_ss_c multimedia_ss; }
component multimedia_ss-c { codec_c codecs[4]; }
component codec_c {
vid_pipe_c pipeA, pipeB;
action decode {
… comp != pss_top.multimedia_ss.codecs[0]; // line-1
}
vid_pipe_c::program pipe_prog_a;
activity { … comp==this.comp.pipeA; } // line-2
}
In the line-1 above, the condition is possibly checking if the current instance has been instantiated from the path given in that line. Is my understanding correct?
But then, line-2 is not clear. What does “this.comp” mean here? And what is “this”?
If comp is an instance handle, then it is referring to an instance of codec_c. But pipeA is an instance of vid_pipe_c, so how can this condition match the different types?
Again, in the following code:
//from example-30
component sub_c {
bit[31:0] base_addr;
action A { … activate(comp.base_addr); } // line-3
}
In line-3 above, if I had instead coded: activate(base_addr)
What would have been the difference in semantics?
In addition, I don’t see “comp” and “this” in the table of keywords (on page 22 of pdf).