Jump to content

Input port array and driving input port value on output pin


Minu

Recommended Posts

Suppose I have many input ports and one output port on which I want to drive the input port no which was selected.I wrote like this:

 Vector<sc_port<sc_signal_in_if<bool>>>input_port;

Sc_out<int>output_port;

After that applied for loop and write I index to output_port.

But here the problem is in one cycle if I selected 5th input port then on output port ,the 5 will display.In second cycle if I selected 2th import port then it will display 5 and 2.which is not correct it should be 2 only.

So how we can achieve  this functionality?

 

Link to comment
Share on other sites

Hi,

I have somehow  written code on eda playground

Link:https://www.edaplayground.com/x/PPW7

But here the problem is in one cycle if I selected 5th input port then on output port ,the 5 will display. In second cycle if I selected 2th import port then it will display 5 and 2.which is not correct it should be 2 only.

This scenario has been asked by one senior. I am unable to find out the exact way how this issue can be resolved.

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