Hi,
A class can have several constructors. Can a module have two constructors? I try to do that, but it fails. I don't know whether it is allowed or the code
is wrong:
#include <systemc.h>
SC_MODULE(myclk) {
sc_in<bool> reset, sig;
sc_in<bool> input_valid;
sc_in<bool> CLK;
SC_CTOR(myclk)
{
SC_METHOD(outp);
sensitive << CLK.pos();
}
SC_CTOR(myclk, sig)
{
input_valid = sig;
SC_METHOD(outq);
sensitive << CLK.pos();
}
void outp();
void outq(sc_signal<bool>, sc_signal<bool>);
};
The error message is:
# In file included from clk_g_head.cpp:2:
# myclk.h:18:21: error: macro "SC_CTOR" passed 2 arguments, but takes just 1
# In file included from clk_g_head.cpp:2:
# myclk.h:18: error: function definition does not declare parameters
# In file included from myclk.cpp:37:
# myclk.h:18:21: error: macro "SC_CTOR" passed 2 arguments, but takes just 1
# In file included from myclk.cpp:37:
# myclk.h:18: error: function definition does not declare parameters
# ** Error: (sccom-6142) Compilation failed.
#
#
# ** Error: C:/modeltech_10.1c/win32/sccom failed.
# Error in macro C:\Users\Jeff\modelsim_systemC\clk_gen\run1.do line 25
# C:/modeltech_10.1c/win32/sccom failed.
# while executing
# "sccom -g myclk.cpp clk_g_head.cpp"
I do not find the answer after to look it on the manual.
Thanks,