0

I want to make instance with array in SystemC.

I want to write as follows:

module name = new module[10];

or

for(int i = 0; i < 10; i++){
    module name[i]("any names")
}

However, I did this, the compiler said:

error: no matching function for call to 'module::module()'

Please tell me how to make an instance with array.

Kevin
  • 16,549
  • 8
  • 60
  • 74
Hero
  • 3
  • 1

1 Answers1

2

In SystemC, you can use sc_vector instead of a plain C array, see e.g.

SC_MODULE(top)
{
  sc_vector<module> m; // e.g. class member

  SC_CTOR(top)
    : m("modules", 10) // constructor
  {}
}; 
pah
  • 313
  • 1
  • 10