struct My_module : sc_module{
static const int NUM = 7;
sc_in< sc_uint<NUM> > a{"a"};
SC_CTOR(My_module);
My_module(const sc_module_name& name, int NUM):
sc_module(name), NUM(NUM)
{}
};
struct Top : sc_module{
SC_CTOR(top)
{
My_module* mod = new My_module("mode", 7);
}
};
Hello Ameya,
The code is as below. In fact, I would like to initialize the parameter NUM when instantiate 'My_module' in 'Top'. The problem is that constructor doesn't accept static parameter, and sc_uint<NUM> accept only static parameter... I appreciate a lot if you have some suggestions.
Best regards,
Songlin