Jump to content


  • Posts

  • Joined

  • Last visited

NicoCaldo's Achievements


Member (1/2)



  1. Thanks a lot but, your code use a bool as output. I need to put together all the bool line in input as one line in output. For istance if I have a vector of 2 bool input I want to took the two bit (i.e. a and b) and convert into a sc_uint<2> in out a*2^1+b*2^0 with 3 input, a,b, and c it would be a sc_uint<3> with a*2^2+b*2^1+c*2^0 and so on
  2. I was wondering if it's possible to create a module that given as input an sc_vector<sc_in<bool> > containing a known number of sc_in<bool> (let's say 2) it would convert into a sc_out<sc_uint<2> >
  3. 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?
  4. Hi, is there a function that return the actual time at which the simulation is? I know sc_time_stamp() but it actually returns a string with the measure unit. I would like something like int i; i = sc_time_stamp().time(ns); (where ns is, for istance, the measure unit)
  5. Ok find the issue. I needed to compile all the .cpp dependencies as well with g++ -I/usr/local/systemc-2.3.3/include -L/usr/local/systemc-2.3.3/lib-linux64/ -lsystemc -lm -o out counter.cpp shifter.cpp testbench.cpp main.cpp
  6. So, I'm trying to compile my main.cpp that includes three modules. For instance I got a module counter with this .h file #include <systemc.h> SC_MODULE(counter) { sc_in<bool> clk; //porta ingresso clock sc_in<bool> load; //porta ingresso load sc_in<bool> clear; //porta ingresso clear sc_in<sc_uint<8> > din; //porta ingresso dato (intero 8 bit) sc_out<sc_uint<8> > dout; //porta uscita dato (intero 8 bit) unsigned int countval; //valore del contatore (intero senza segno) void counting(); //funzione conteggio (il mio processo) SC_CTOR(counter) { //costruttore di counting() SC_METHOD(counting); //costruttore del mio processo attraverso metodo (meglio del thread) sensitive << clk.pos(); //sensibile al fronte del clock, positivo } }; now, when I run the compiler with g++ -I/usr/local/systemc-2.3.3/include -L/usr/local/systemc-2.3.3/lib-linux64/ -lsystemc -lm -o out main.cpp but I got this error /tmp/ccz92lN5.o: In function `counter::counter(sc_core::sc_module_name)': main.cpp:(.text._ZN7counterC2EN7sc_core14sc_module_nameE[_ZN7counterC5EN7sc_core14sc_module_nameE]+0xba): undefined reference to `counter::counting()' How do I fix it?
  • Create New...