Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


AmeyaVS last won the day on June 22

AmeyaVS had the most liked content!


About AmeyaVS

  • Rank
    Advanced Member
  • Birthday 02/28/1989

Contact Methods

  • Skype

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

568 profile views
  1. Execution Trace Generation

    Hello @R.Adiga, I have developed something similar you can have a look here: https://github.com/AmeyaVS/trace-ninja (Still under development but basic functionality implemented for getting traces). If you are developing on Linux I would suggest of having a look here: https://github.com/namhyung/uftrace , which offers much better tracing capabilities and lower latencies. Both the methodologies are dependent on using GCC toolchain for building the SystemC library. The only advantage you get on using my project is that it would work under Cygwin/Windows with GCC compiler (Not tested under MinGW). Regards, Ameya Vikram Singh
  2. Temporal Decoupling

    Hi @darshanKM, This is a discussion forum, not your homework/assignment discussion platform. It would be better if you could show what you came up with and discuss anything that you are not able to understand. I would recommend exploring the SystemC documentation directory(i.e. docs directory when you would have installed the SystemC library or when you downloaded the SystemC library sources.). Regards, Ameya Vikram Singh
  3. systemC design

    Hello @yosri ben salah, As far as my experience is OpenCV image processing algorithms cannot be directly translated to synthesized design. It would involve manual translation of the algorithms in it's current form, but the work is progressing as mentioned here about utilizing the FPGA's. Regards, Ameya Vikram Singh
  4. Hi @Roman Popov, It is quite possible to have multiple installations of SystemC library. This is what I have in my development environment setup: # SystemC debug installation directory. $HOME/apps/systemc-2.3.1a_debug # SystemC release installation directory. $HOME/apps/systemc-2.3.1a_release I currently use a shell script to switch between the environments but it is quite easy to add the condition in CMakeLists.txt/FindSystemCLanguage.cmake script to support such behaviour. Regards, Ameya Vikram Singh
  5. How to define a FIFO of custom structure

    Hello @katang, You need to declare the method as a friend method and the definition has to be moved to corresponding source file. For e.g.: // scMWE.h #ifndef scMWE_h #define scMWE_h #include <systemc> #include <iostream> struct Transfer_Type { int Select; int Content; friend std::ostream& operator << (std::ostream& os, const Transfer_Type& I); //< Declaration for the friend method. }; SC_MODULE(scMWE) { scMWE(sc_core::sc_module_name nm); sc_core::sc_fifo<Transfer_Type> from; }; #endif scMwe.cpp: // scMWE.cpp #include "scMWE.h" // Definition for the friend method. std::ostream& operator << (std::ostream& os, const Transfer_Type& I) { return os; } Hope it helps. Regards, Ameya Vikram Singh
  6. Hello @katang, Can you provide the minimal code which reproduces this behaviour? Regards, Ameya Vikram Singh
  7. systemC

    @yosri ben salah, Unable to open the attachment. Kindly provide the necessary context for the attachment. What exactly is it providing for this discussion? Regards, Ameya Vikram Singh
  8. How to model a delay line in SystemC

    Hello @Roman Popov, You can have a look here: Hope it helps. Regards, Ameya Vikram Singh
  9. Hello @katang, In SystemC the parent and child relationship is intrinsically handled by the Kernel. Kindly refer the SystemC LRM Section for more details. Their should be no differences in stack and heap allocated objects. As for the last part it is not very clear what you are asking. Can you elaborate more on the last part? Regards, Ameya Vikram Singh
  10. Hello @katang, You can use: sc_core::sc_in<bool> clk; in your modules and bind them in the top module as a normal sc_in/out port binding operation. e.g: // In top module. // Clock is the system clock object. some_module_having.clk(Clock); some_other_module_having.clk(Clock); some_another_module_having.clk(Clock); Each of the modules will have public port interface mentioned above. Regards, Ameya Vikram Singh
  11. How to define constructor in cpp file?

    Hello @katang, The error spawns from not specifying the namespace resolution correctly. Following code compiles without errors: NAME.h: #ifndef NAME_H_ #define NAME_H_ #include <systemc> SC_MODULE(NAME) { SC_CTOR(NAME); }; #endif // NAME_H_ NAME.cpp: #include "NAME.h" SC_HAS_PROCESS(NAME); NAME::NAME(sc_core::sc_module_name nm) //< Added sc_core namespace resolution. : sc_core::sc_module(nm) //< Added sc_core namespace resolution. {} Regards, Ameya Vikram Singh
  12. How to define constructor in cpp file?

    Hello @katang, It seems the macro NAME has not been defined. From the book they have mentioned about the file "NAME.h". There recommendation on providing simpler and cleaner declarations. Regards, Ameya Vikram Singh
  13. motion detection source code

    Hello @yosri, This is mostly a discussion forum. In-case you need help while having issues in implementing your design, then do post your queries here. While assuming members to straight away help you in your homework is too much to ask. Kindly show us some research input about the project and some implementation that you have written, and facing issues with them. It would be unwise to comment since one can have multiple implementation of the said requirement as it is too vague, plus show us some due diligence in researching about the topic you are working on. Regards, Ameya
  14. Delaying simulated execution

    Hello @katang, Here is a modified source for Bit_Adder.h which emulates the delay between component/modules: #ifndef BIT_ADDER_H_ #define BIT_ADDER_H_ #include <systemc> #include <queue> template<typename T = bool> SC_MODULE(BIT_ADDER) { public: sc_core::sc_in<T> a, b, cin; sc_core::sc_out<T> sum, cout; SC_CTOR(BIT_ADDER): a("a") , b("b") , ci("cin") , sum("sum") , cout("cout") , delay(sc_core::sc_time(2, sc_core::SC_NS)) , eqSum("eqSum") , eqCarry("eqCarry") { SC_METHOD(do_add); sensitive << a << b << cin; dont_initialize(); SC_METHOD(drive_sum); sensitive << eqSum; dont_initialize(); SC_METHOD(drive_carry); sensitive << eqCarry; dont_initialize(); } void do_add(void) { T valA = a.read(); T valB = b.read(); T valCi = cin.read(); T tmpCo = (valA & valB) | (valB & valCi) | (valA & valCi); T tmpSum = valA ^ valB ^ valCi; coq.push(tmpCo); sumq.push(tmpSum); eqSum.notify(delay); eqCarry.notify(delay); } void drive_sum(void) { T valSum = sumq.front(); sum.write(valSum); sumq.pop(); } void drive_carry(void) { T valCarry = coq.front(); cout.write(valCarry); coq.pop(); } private: sc_core::sc_time delay; sc_core::sc_event_queue eqSum; sc_core::sc_event_queue eqCarry; std::queue<T> sumq; std::queue<T> coq; }; // BIT_ADDER #endif // BIT_ADDER_H_ This should be drop-in replacement for your module. One thing you will have to change is the declaration where it would change something from: BIT_ADDER bitAdder to: BIT_ADDER<sc_logic> bitAdder Let us know if you need further clarification on how the module behavior is modeled. Regards, Ameya Vikram Singh
  15. Hello @katang, The way the SystemC library is configured by default it doesn't create system threads(OS threads). That is it uses "user-space library" for creating the notion of parallel execution of threads(in user-space). This depends on the platform and configuration option provided to SystemC kernel while building it. e.g: In Windows under Visual Studio it uses the fiber user space threading library for execution of SC_THREAD's/CTHREAD's. In UNIX/Linux you can use QuickThreads (User-space threading) which is selected by default while running the configuration option for SystemC library. As per the OS it only sees one thread of execution for the whole simulation. Note: In-case you have configured the SystemC library with pthreads in Linux/UNIX like environment then the debugger will show you multiple threads of execution. Even in that scenario you can look here for reference on gdb and multi-threaded debugging, by default on most Linux systems the GDB suspends other threads making it easier to narrow down thread racing condition(the OSCI SystemC kernel sceduler implementation is already synchronized with the main execution thread of the SystemC application). As per your question The answer is: Yes it is possible to run the SystemC simulation stepwise while is debugging mode. In-case you need more clarification let us know. Regards, Ameya Vikram Singh