Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Thank @Eyck and @David Black for your information, I tried with your method by change : sc_event ev_wait => ThreadSafeEvent ev_wait; but It still not work. notify() is called but update() function isn't called. Maybe something wrong. note: If I use ThreadSafeEvent instead of sc_event , I can't using wait(event). Do you have another way? Thanks for your kind words header.h pthread_function.c Source.cpp
  3. Yesterday
  4. Hello, I am trying to include scv.h in my project, but it is recognized. I got: "Cannot open source file scv.h". All other SystemC functions work fine. I am using Visual Studio. I would be very thankful for any help.
  5. Last week
  6. But fir_data.h in SystemC's example folder used similar coefficient declaration: SC_CTOR(fir_data) { SC_METHOD(entry); dont_initialize(); sensitive << reset; sensitive << state_out; sensitive << sample; #include "fir_const.h" }
  7. That's why it always better to use an unnamed enum as shown in the edaplayground example. This is typesafe and allows the compiler to check things.
  8. You are declaring angles local in the body of the constructor. Once this finishes they are destroyed as they are stack allocated. You are running into undefined behavior. This is basic C++, lifetime of variables. You need to declare angles as member of the class/SC_MODULE and only assign in teh constructor
  9. It seemed different behavior when putting a constant array inside the SC_CTOR vs. in process function. For example, SC_CTOR(ex) { ... double angles[28]; SC_METHOD(entry); double angles[28] = {...} } vs. void ex::entry() { double angles[...] = {...}; } When putting constant array inside SC_CTOR, the readout values aren't correct. They are like huge numbers to power of 63. The second way had correct readout values.
  10. Thanks again Eyck. I confirmed that #define N was the culprit. I can run the example after changing N to something else (along with a typo in the typedef line). This is a tricky one. But the errors made sense looking back as there is "int N" in sc_fixed template
  11. I concur with Eyck's comments. A few more thoughts: SystemC-processes are very different from OS processes. SystemC itself runs inside a single OS-thread. SystemC uses cooperative multitasking to simulate SystemC processes, which come in three flavors: SC_THREAD, SC_METHOD, and SC_CTHREAD (for synthesis). This is common among discrete event-driven simulators (e.g., Verilog, SystemVerilog, and VHDL use the same idea) Cooperative multitasking simplifies the coding a lot to make it easier for designers using these simulators. When documenting, I fin
  12. Just out of curiosity: did you consider/discuss to use XML as a data modeling language i.s.o. JSON, for example to ease integration into or connection with IP-XACT?
  13. Your problem is the #define N 25 before including systemc.h since N is used as template parameter name in some systemc class templates. I put your code on edaplayground: https://www.edaplayground.com/x/s6Fu with a few minor changes and there it compiles and works....
  14. SystemC is a single-thread simulator and moreover not thread-safe due to various reasons. The problem you are facing is that you modify datastructures in the SystemC kernel (by calling notify() ) asyncronously since you are running it in another (OS-)thread. This might work in some case but in most cases it will not. To cut a long story short you cannot use sc_event to syncronize os-threads. But there are means to handle this case namely async_request_update(). To see an example you might check out https://stackoverflow.com/questions/49814756/async-request-update-example-in-systemc esp.
  15. Hi all, I'm trying to build source code using pthread and SystemC ( SystemC build as quickThread) Step 1 : Create pthread tmodule->threadID[i] = i; result_code = pthread_create(&tmodule->thread[i], NULL, perform_func, (void*)tmodule); Step 2 : Kick a thread to wait event void wait_thread() { while (1) { wait(ev_wait); //wait(wait_time_val, SC_NS); cout << "@" << sc_time_stamp() << " :: " << "Waiting " << wait_time_val << " second." << endl; resume_thread(); } } In perform_func will call to void wa
  16. @Darren Galpin - Thank you for the feedback. I updated the standard to reflect your suggestions.
  17. Hi all, I want to add coloured noise to various blocks in my PLL system. Upon checking the manual I found this: In order to get colored noise, the output of the function gauss_rand can be filtered using appropriate transfer functions. I am new to SystemC/AMS and was wondering if any of you could provide the simplest example on how to implement that filter on the gauss_rand function output. Thanks!
  18. pg vi line 6 - should read "that identify" rather than "that identifies"? pg 9, #4 - all the examples seem to be more for off-chip communication. Shouldn't an example also be intra-chip such as AXI?
  19. Hi David, Thanks for explaining the issue and providing the fix. Yes, I do need to understand how the simulator handles this. Would you be able to provide any reading references?
  20. For my SystemC-Lecture, I wrote a simple DES simulator to reduce to the minimal mechanisms that are required to understand the DES concept. (https://github.com/myzinsky/des/tree/main/sw). For that I used C++20 co-routines for the 'processes'. Therefore, I was wondering if somebody has considered these co-routines also as co-routines for SystemC, instead of qt, pthreads or fibers?
  21. Earlier
  22. Your problem is in the verilog because you created a race condition. Replace the $display with $strobe to see the proper settled condition of the signals. See https://www.edaplayground.com/x/9KdZ Perhaps you have not been formally trained in the semantics of event driven simulation.
  23. I'm testing the instantiation of a SystemC module in a Verilog testbench using VCS. I expect to see a 1-cycle output delay due to flop latency. However, the SystemC module produces the output at the same cycle as the input. The module is a simple counter. The entire code is visible here: https://www.edaplayground.com/x/7reZ Thank you.
  24. @Bas Arts Thanks for the response. I'm not able to find it...but no worries...I was just trying to see the memory model sequence inside it to see how it was created.
  25. It is (typically) part of your vendor's tool installation. Inside the installation, look for "ubus" and/or "integrated". For example: $ find <path_to_vendor_installation> -name *ubus* If $UVM_HOME has been set correctly, you can also use $ find $UVM_HOME -name *ubus* Or simply use your favorite search engine on the web with terms "integrated", "ubus" and "uvm".
  26. Thank you, David! IMHO due to abstract nature of SystemC, handy implemented parallelism and signals, it could be used for simulation of software applications and systems of software applications on feasibility study. In current moment I am looking a bridge for transition from feasibility study to a SW development phase. Something, which could work like HLS, but on the output it will give (with some limitations) a C++ code where SC_METHODs of a model are represented as threads, signals as a glib event, Qt events or D-Bus signals and so on.
  27. Hi everyone...does anyone know where $UVM_Home/example/ubus source code is?
  28. With some corrections, it works on EDA playground <https://edaplayground.com/x/q3Ei>. Note: You do really don't need those deleted copy-constructors, etc. Rule of zero works. Also SC_HAS_PROCESS works best inside the thread. Also works on under Ubuntu with GCC 10.0.
  29. Thanks Eyck, I tried to use double input for an sc_fixed data type (see the attached example). Somehow the direct assignment didn't work. Or because the errors I got were from sc_port.h, which has not been used at all. So I wasn't sure the direct assignment actually works. #define SC_INCLUDE_FX #define N 25 #include <systemc.h> using namespace sc_core; using namespace sc_dt; typedef sc_fix<32, 16, SC_RND> fixed_type; double fix_fir(double _in[]) { fixed_type in[N], c[N], t[N], y; int i; double ct = 0.9987966; fo
  1. Load more activity
  • Create New...