Jump to content

ANKUR SAINI

Members
  • Content Count

    20
  • Joined

  • Last visited

Everything posted by ANKUR SAINI

  1. Thanks for reverting back David.. Would it be possible for you to give few good pointers for - 'recasting threads into cthreads' to refer; since definitely it is something which I have to explore and don't know much right now..
  2. @Philipp A Hartmann @David Black : Quick help on this would be appreciated
  3. I am currently trying to implement some feature for which I need to reset/re-start a thread based on some event raised from other thread. I got to know that this type of behavior can be achieved by using async_reset_signal_is OR with help of enable/disable feature of thread handling. But the problem here is all these advanced features comes with SystemC 2.3 on wards, but because of some limitations and constraints, I have to stick to use SystemC 2.2 version. Is there any way to achieve this with SystemC 2.2 ? Please help me with this!!
  4. @Roman Popov: Thanks for the information.. Appreciate that.. I got your point that SystemC is basically running as single thread only on my OS. But how exactly SystemC threads are modeled then ? Also, what is the significance of sc_simcontext() in SystemC. What it means by having multiple contexts in a simulation. I know I am little confused with all these terms, but that's why I need some clarification on these..
  5. I have recently going through an online document centered on - "multi-threading of SystemC scheduler". Though I couldn't able to figure out the topic itself for initial time, but definitely it raised up lot of curiosity inside me to read it. While reading, there was a statement - "Single threaded simulation kernel inherent to SystemC prevents it from utilizing the computing power of multi-CPU machines to speed up the simulation." I would like to understand what it means by single threaded simulation kernel.
  6. @Eyck: Thanks for such a detailed info. This definitely has given a lot of insights. And I am really excited now to look at the pointer you mentioned above. I have ran through it and looks like this doc is really highlighting the important aspects of Virtual Platforms and their usage and applications. Once again thanks for sparing out time and sharing this knowledge.
  7. As we know, SystemC can be used to create system level models @ different abstraction levels. It could be either used for Architectural analysis, performance modeling or software development purposes. I would like to understand and want to get an insight on - what are the key differences while modeling these different models @ different levels. In what ways or context they differ !
  8. @AmeyaVS: Thanks for pointing out the document pointers. I will try to go through them. @David Black: Thanks for your detailed comment. I got your point on context switching with both sc_method and sc_thread and in either case it is unavoidable. But still, I think the best practice is to use sc_method wherever possible because that will definitely gonna aid us in debugging. As it gets executes in one shot, no suspend in between.
  9. I have been working on maintaining IP's that are written quite old (Legacy :-)). Most of the code use SC_THREAD extensively. I know that it's not a good practice to use sc_thread and we should minimize it's use wherever possible to avoid context-switching. But I would like to know what are the debugging techniques that can help in debug these multi threaded programs efficiently. As sometimes it's a nightmare to identify issues in a program surrounded by tons of threads running parallely. Regards, Ankur Saini
  10. Hello Roman, I have performed few other simulations as well using SystemC 2.0 build with this GCC version itself on my same platform. So, I guess there shouldn't be any issue with compiler. Regards, Ankur Saini
  11. Hello Ameya, Thanks for your prompt response. But I don't have cmake setup on my system. I have 'make' and 'gmake' build system. My GCC version is 4.3.5. Can you help me in the installation with this setup. Regards, Ankur Saini
  12. I am trying to install systemc 2.3.2 on my linux system (x86_64).I followed the steps mentioned here (http://rkrara.blogspot.in/2012/12/install-systemc-230-on-linux.html) But I am getting the errors while running make command. (PFA the error log) Please help me with the installation. make.log
  13. @David Black: Hello David.. Nice solution.. just one comment.. as you mentioned the usage of callbacks -"before_end_of_elaboration" and "end_of_elaboration", I guess we can use the "start_of_simulation" and "end_of_simulation" also to do the same stuff you written in the code above. Correct me if I am wrong anywhere.
  14. If I am right, with SystemC 2.x onwards, it gave us a flexibility to still leave the ports unbound if they are defined with SC_ZERO_OR_MORE_BOUND binding policy. Correct me in-case I am wrong.
  15. @maehne: I got your point to some extent. So that means this callback is just provided to bind/create additional hierarchy which is not part of the actual design but rather helpful for debugging and understanding !! Apart from this is there any other use-case of this callback which you think is worth explaining its existence inside the standard (Just to get little insight)
  16. @Philipp A Hartmann: I really want to know the significance of "before_end_of_elaboration" callback in SystemC. On Doulos website (https://www.doulos.com/knowhow/systemc/new_standard/), it is mentioned that it can be used in the scenarios where we bind the module monitor ports to the top level singleton monitor channel. Referring to the attached example, why are we not binding the module monitor ports to the top level monitor channel in the top level constructor ? Why the binding of ports is done in the particular module callback function ? Also, what is the need of providing an additional callback function to instantiate module/ports when we can do the same thing in the constructor itself ?
  17. @Philipp A Hartmann: Thanks for the short summary. It really gave me a good understanding from the top level.
  18. How "sc_main" works in SystemC ? I mean what I understood from library is that - there is a main function defined in library which calls the sc_elab_and_sim which in turns calls the sc_main function. But my question is SystemC library is distributed as source which user builds at his end; and links to his application. And if SystemC has main inside it then it should have got compiled into exe! Am I right ? Can somebody help me in understanding this flow ?
  19. @Philipp A Hartmann: Thanks a lot Philipp for the clarification.. understood the point now..
  20. I created a simple example to see how the callbacks are being called by the systemc simulation kernel. But I am little surprised with the output. Can somebody explain or justify the output ? CODE: ============================= class analyzer : public sc_module { public: sc_out<bool> out_portA; sc_in<bool> in_portA; analyzer(sc_module_name nm) : out_portA("OUT_PORT_A"),in_portA("IN_PORT_A") { std::cout << "I am in analyzer constructor " << std::endl; } void before_end_of_elaboration(){ std::cout << "I am in before_end_of_elaboration of " << name() << std::endl; } }; class producer : public sc_module { public: sc_out<bool> out_portP; producer(sc_module_name nm) : out_portP("OUT_PORT_P") { std::cout << "I am in producer constructor " << std::endl; } void before_end_of_elaboration(){ std::cout << "I am in before_end_of_elaboration of " << name() << std::endl; } }; class consumer : public sc_module { public: sc_in<bool> in_portC; consumer(sc_module_name nm) : in_portC("IN_PORT_C") { std::cout << "I am in consumer constructor " << std::endl; } void before_end_of_elaboration(){ std::cout << "I am in before_end_of_elaboration of " << name() << std::endl; } }; class top_module : public sc_module { public: sc_signal<bool> sig1; producer p1; consumer c1; top_module(sc_module_name nm):sig1("SIG1"),p1("P1"),c1("C1") { std::cout << "I am in top constructor " << std::endl; p1.out_portP(sig1); c1.in_portC(sig1); } void before_end_of_elaboration(){ std::cout << "I am in before_end_of_elaboration of " << name() << std::endl; analyzer a1("A1"); //p1.out_portP(sig1);a1.in_portA(sig1); //sc_signal<bool> sig2; //a1.out_portA(sig2);c1.in_portC(sig2); } }; int sc_main(int argc, char *argv[]) { top_module top("TOP"); sc_start(1,SC_MS); sc_stop(); return 0; } OUTPUT: ============================= SystemC 2.3.0-ASI --- Feb 1 2014 18:12:06Copyright (c) 1996-2012 by all Contributors,ALL RIGHTS RESERVEDI am in producer constructor I am in consumer constructor I am in top constructor I am in before_end_of_elaboration of TOPI am in analyzer constructor I am in before_end_of_elaboration of TOP.P1I am in before_end_of_elaboration of TOP.C1Info: /OSCI/SystemC: Simulation stopped by user. Why it has not called the analyzer before_end_of_elaboration() callback ? Also, can I alter/modify/redefine the port bindings in the top level before_end_of_elaboration callback (see the commented lines in top level callback)?
×
×
  • Create New...