Jump to content

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


Recommended Posts

Posted
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

Posted

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.

 

Posted

I do not intend to bind 15-bit port to 17-bit port

 

I would like to create a 32-bit (uint32_t) port which contains two fields, one is 15-bit, and the other is 32-bit,

anyway to do that?

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...