NicoCaldo Posted May 16, 2020 Report Share Posted May 16, 2020 Hi, I'm trying to understand if there's the chance of bind a vector of 4 sc_signal<bool> with an sc_signal<sc_uint<4> > I have a Ripple Carry Adder composed of 4 1-bit Full Adder. I create and bind my RIpple Carry Adder with the below code sc_vector<sc_signal<bool> > Gen_1; Gen_1.init(N); sc_vector<sc_signal<bool> > Gen_2; Gen_2.init(N); sc_signal<bool > Cin; sc_vector<sc_signal<bool> > Out; Out.init(N); sc_signal<bool> Cout; Where Gen_1 and Gen_2 are the input signals, Cin and Cout are the carry IN and OUT and Out is the output signal I bind the ports with the following method sc_vector<sc_out<bool> >::iterator itout; sc_vector<sc_in<bool> >::iterator itin; RIPPLECARRYADDER fulladd_0("RIPPLECARRYADDER",N); itin = fulladd_0.FirstNum(Gen_1); itin = fulladd_0.SecondNum(Gen_2); itout = fulladd_0.AddOut.bind(Out); fulladd_0.Cin(Cin); fulladd_0.Cout(Cout); Where FIrstNum, SecondNum and AddOut are sc_vector<sc_in<bool> > FirstNum; sc_vector<sc_in<bool> > SecondNum; sc_vector<sc_out<bool> > AddOut; In the RippleCArryAdder.h Now, I have a module which has an input port in the form of sc_signal<sc_uint<4> > ALUout; Is there a way to bind Out with ALUout for example? Quote Link to comment Share on other sites More sharing options...
Eyck Posted June 25, 2020 Report Share Posted June 25, 2020 Not directly. You need to bind Out to a vector of signals of type bool and create a method being sensitive to all signals in the vector. This method then does the conversion and drives the ALUout signal. 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.