Jump to content

ElliottCB

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. ElliottCB

    Process sensitivity with sc_vector

    Philipp, This is 100% perfect. Thank you so much. Elliott
  2. Greetings everyone, I have a process that is sensitive to an sc_vector (specifically a vector of input ports) and was curious about how to handle the fact that values are maintained on each port in that vector on subsequent iterations of the process. This makes it very difficult to determine which values are actually new when the process is executed. I was hoping there would be a way to clear the value on a port once it had been read, but I could not find anything like this. The closest thing to a solution is to "latch" the value each time the process gets triggered and then compare the latch value with the port value to determine if anything new has arrived. Is there a better way to do this? Thanks a bunch in advance.
  3. ElliottCB

    SC_THREAD and sensitivity

    Thanks everyone for the replies. I ended up following Alan's tutorial and simply made a separate module which generates stimulus as having such a module seemed like an inevitability. Everything is working as I expect now. Thanks again!
  4. ElliottCB

    SC_THREAD and sensitivity

    Thanks everyone for the quick responses. I believe my confusion arises from what should be done in sc_main() in regards to providing stimulus for a module. Currently my sc_main() simply consists of instantiating a module and attacing sc_signals to each of its ports. My hope was that I could write to these ports to see how the module reacts. How I (incorrectly) did this was shown in my initial post. Is it a requirement to create a separate module which creates and issues stimulus to the my module being tested as shown in the tutorial that Alan posted, or is there a way to provide stimulus to my module directly within sc_main()? Again, very sorry for these uninformed questions. Moving from C++ to SystemC has been a rather large paradigm shift Thanks for everyone's help.
  5. ElliottCB

    SC_THREAD and sensitivity

    Hey Everyone, I'm very new to SystemC so this might sound like a pretty trivial question, but I'm not really sure what specifically to look for in order to resolve this issue. I have a simple module with 2 input ports and an SC_THREAD method which is sensitive to these inputs. The function assigned to this SC_THREAD is : void test() { while(true) { wait(); cout<<"received"<<endl; } } In sc_main where I instantiate this module, I attach 2 signals (laneA and laneB) to its 2 input ports and execute the following : sc_start(); laneA.write(testA); laneB.write(testB); My assumption was that the output printed in test() would be called twice (once for each of the writes). Unfortunately, it is only printed once. I'm sure there must be some underlying misunderstanding here, but hopefully it is something trivial. Another clue that I've misunderstood something is that if I print the contents of both the ports within the while(true){} block, both of the values written in sc_main appear. So, what exactly am I missing about the overall flow of execution? Any help would be greatly apprecaited. Thanks in advance! Elliott
×