Jump to content

How to create a port that is equivalent to the combination of multiple ports


hhq

Recommended Posts

sc_signal<sc_int<17>> signal_a;
sc_signal<sc_int<15>> signal_b;

I want to create a port which can handle both of these signals, for example

sc_inout<uint32_t> port

Write to this port is equivalent to write both of these signals.

Read from this port is equivalent to read from both of these signals

Wait value_changed_event() is equivalent to wait any of their value_changed_event();

 

Anyway to do it? Thanks

Link to comment
Share on other sites

SystemC ports are designed to bind to a very specific signature. The idea that a 15-bit port could bind to a 17-bit port is considered dangerous. That was an intentional design decision of the design committee. The goal was to avoid mismatched signals in hardware that would be synthesized from SystemC. In a similar vein, some folks want to split out bits and write to single bits, but cannot that directly.

It is possible to write channels that make the conversion.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...