I have a top level module with template like this:
template <int TOP_DEPTH=10> SC_MODULE(my_top){}
And I have several sub modules like this:
template <int DEPTH=10> SC_MODULE(sub_module_xxx>
I try to instantiate sub modules with the modified DEPTH from top level:
const int DEPTH_MODULE_A = <math1 on TOP_DEPTH> const int DEPTH_MODULE_B = <math2 on TOP_DEPTH> ... sub_module_a<DEPTH_MODULE_A> *pSubModuleA; sub_module_b<DEPTH_MODULE_B> *pSubModuleB; ...
I got compile error about "invalid use of non-static data member".
I am not sure what's the right way to do it in C++.
(I don't want DEPTH_MODULE_xxx to be static, because my top_module may be used as submodule in other project with different value of TOP_DEPTH. )