katang Posted June 23, 2020 Report Share Posted June 23, 2020 In my main program, I have declared sc_signal<bool, SC_MANY_WRITERS> main_full("full"); later I attempt to bind it as main_fifo1.fifo_full(main_full); but my compiler keeps saying no match for call to ‘(sc_core::sc_signal<bool, (sc_core::sc_writer_policy)1>) (sc_core::sc_signal<bool, (sc_core::sc_writer_policy)1>&)’ My other module declares sc_signal<bool, SC_MANY_WRITERS> fifo_full; With the other policy, I have no problem with binding. What do I wrong? Quote Link to comment Share on other sites More sharing options...
maehne Posted June 23, 2020 Report Share Posted June 23, 2020 You cannot bind a signal to another signal. Instead, you have to bind one or more matching ports to your signal. Your sc_signal<bool, SC_MANY_WRITERS> implements sc_signal_inout_if<bool>. Therefore, ports of type sc_in<bool>, sc_out<bool>, and sc_inout<bool> may be bound to that signal. Due you specified the SC_MANY_WRITERS policy, There won't be an error to write to that signal from more than one processes during any given evaluation phase (see clause 6.4.4 of IEEE Std 1666-2011). So, declare fifo_full to be of type sc_out<bool>. Then, binding that port to the signal main_full should work as you stated: main_fifo1.fifo_full(main_full); You may also consider using sc_signal_resolved and its ports sc_in_resolved, sc_inout_resolved, and sc_out_resolved, which uses the sc_logic instead of bool (clause 6.13ff in IEEE Std 1666-2011). Quote Link to comment Share on other sites More sharing options...
David Black Posted June 24, 2020 Report Share Posted June 24, 2020 I strongly agree with @maehne that you should consider using sc_signal_resolved unless you guarantee that all the writers will be perfectly synchronized and never disagree with one another. If you don't, you risk race conditions. You might even want to consider using a pullup signal, which you can easily derive from sc_signal_resolved. 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.