Minu Posted September 25, 2023 Report Share Posted September 25, 2023 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? Quote Link to comment Share on other sites More sharing options...
Eyck Posted September 26, 2023 Report Share Posted September 26, 2023 Without any code this is impossible to answer. You may use https://www.edaplayground.com/ for this or post it here. Quote Link to comment Share on other sites More sharing options...
Minu Posted September 26, 2023 Author Report Share Posted September 26, 2023 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. Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted September 26, 2023 Report Share Posted September 26, 2023 Hello @Minu, The shared code does not seem to be correct. Is it the same code you are trying to run? I don't seem to locate the initialization of the sc_vector correctly under testbench? It would be better if could also share some context about design along with the relevant source. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.