karandeep963 Posted June 29, 2013 Report Share Posted June 29, 2013 Hello All, It would be really appreciable if anyone could authenticate my learning on difference of sc_signal and sc_buffer? I have found many differences mentioned below , please check and add if I could have missed any important one: 1. sc_buffer does not support the specialization supported for sc_signal: like sensitive << signame.posedge_event(); wait << signame.posedge_event(); 2. sc_buffer does'nt used for sensitivity of process. 3. There is difference of evaluate-update phase of sc_buffer to that of sc_signal? if yes, whats that please elaborate. 4. sc_signal would only generate update request to scheduler in case of different value needs to be updated , while sc_buffer generates the request all the time if even is the same value is written again on it. Please confirm the above and relevant contents. other queries: Qa: what is significance of sc_buffer? Qb: "sensitive << signame.posedge_event()" , does it mean that the respective process would be sensitive to posedge of signal ? or if something different then what does .posedge_event(); meant for ? Regards, KS Quote Link to comment Share on other sites More sharing options...
dakupoto Posted June 30, 2013 Report Share Posted June 30, 2013 Hello, "sensitive" indicates that the thread will always respond to any changes in the data coming in via a specified port. Note the word "any". You could restrict what changes the thread would respond to, e.g., to the positive edge of the signal, by specifying : "sensitive << <signal_name>.pos();" As for the other points that you wish to clarify/verify, please create small examples, compile and run them and see what the output is, or what the error messages are. This will be the best way to get a grip on how things work internally. Hope that helps. karandeep963 1 Quote Link to comment Share on other sites More sharing options...
karandeep963 Posted June 30, 2013 Author Report Share Posted June 30, 2013 Hello dakupoto, Thanks for your prompt reply. Please let me know : How you relate signame.pos() and signame.posedge_event(); ??? Regards, KS Quote Link to comment Share on other sites More sharing options...
apfitch Posted June 30, 2013 Report Share Posted June 30, 2013 Hi Karandeep, sc_buffer is a derived class of sc_signal, so it supports all of sc_signal's features. The only difference is that the write() method of sc_buffer creates an event even if the buffer hasn't changed (your point 4). As the only change is to override the write() method, I thought you'd still get the correct behaviour in specialisations of the sc_signal class (e.g. sc_signal<sc_logic>, sc_signal(bool)) - but perhaps I should check. Regarding some of your examples pos() returns an event finder and should only be used on ports e.g. sc_in, sc_inout. It is used only in sensitivity. posedge_event() returns an sc_event, and may be used in wait, e.g. wait(sig.posedge_event()); It may also be used in a sensitivity, but only for an instance of sc_signal, not sc_in/inout. posedge() returns a bool and may be used inside a process to see if a signal triggered your process. It should not be used for sensitivity or wait, as it's just a value, not an event. regards Alan karandeep963 and maehne 2 Quote Link to comment Share on other sites More sharing options...
karandeep963 Posted June 30, 2013 Author Report Share Posted June 30, 2013 Thanks Alan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.