79095932

Date: 2024-10-16 22:01:45
Score: 1.5
Natty:
Report link

There is not a simple way to connect multiple signals to the input port.

The syntax for binding ports and signals is:

  port(signal)

That means to bind your two signals to a single port would look like this:

  port_in(m0_sig_in_s);
  port_in(m1_sig_in_s);

Unfortunately, this does not work because ports like sc_in can only have one binding.

The usual solution is to use an sc_method for the connectivity:

SC_CTOR(mymod) {
  SC_METHOD(connect_port_in);
  sensitive << port_in;
}
...
void connect_port_in() {
  m0_sig_in_s.write(port_in.read());
  m1_sig_in_s.write(port_in.read());
}

Another option is to create a custom port type that can accept more than one binding. An example can be found here: Is it possible to bind the output of a submodule to two different output ports?

Reasons:
  • Blacklisted phrase (1): Is it possible to
  • Whitelisted phrase (-1): solution is
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Mr Bone