Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Yesterday
  3. Setting library path != Linking library. Also add -l systemc to g++ options.
  4. Hello again, I have set libraries path as well. But it does not work,what mistake I have?
  5. Without concete code it is hard to give any advise. But it looks like that you redeclare a member function of your original module. BR
  6. Last week
  7. This is both well known and well defined in the specification: sc_event only queues a single event for future notification notify immediate cancels the outstanding queued event and "happens" immediately. This is why it is called "immediate". If you attempt to queue non-zero notifications, only notifications nearer to the current time replace old ones. SC_ZERO_TIME can only be superceded by immediate notification. If you need to queue multiple notifications use the sc_event_queue.
  8. OK Thanks, I have been looking at some examples and trying to figure out how to code it. I guess the advantage of using the TLM Socket interface between to the C program and the Cycle accurate BFM is that it makes the BFM more generic then?
  9. Hi, I have two threads, one thread (thread2) waits on event 'e' and other thread (thread1) notifies event 'e' at different time instances. Please find the below code, void thread1() { for(int i=0;i!=3;i++) { wait(5,SC_NS); e.notify(0,SC_NS); e.notify(3,SC_NS); e.notify(); e.notify(3,SC_NS); e.notify(4,SC_NS); std::cout<<"I am called @ "<<sc_time_stamp()<<endl; } } void thread2() { static int i=1; while(1) { wait(e); std::cout<<"e"<<i++<<" @ "<<sc_time_stamp()<<std::endl; } } As per LRM 5.10.8, I would expect the following output, I am called @ 5 ns e1 @ 5 ns I am called @ 10 ns e2 @ 10 ns I am called @ 15 ns e3 @ 15 ns But, the actual output you get when you run is, I am called @ 5 ns e1 @ 5 ns e2 @ 8 ns I am called @ 10 ns e3 @ 10 ns e4 @ 13 ns I am called @ 15 ns e5 @ 15 ns e6 @ 18 ns This appeared bit strange to me and was just curious to know of what caused this behavior. Interestingly, this happens only when you position immediate notification in the middle of series of same event notifications. But, if you place the immediate notification at the very end, then the behavior is as per the expected output above. To add, event "e2" was triggered at 8 ns because we have e.notify(3,SC_NS) and e.notify(4,SC_NS) after immediate notify and the earliest time i.e e.notify(3,SC_NS) survived. Had there been e.notify(1,SC_NS), it prints "e2 @ 6ns" and so on. Appreciate any help. Thanks.
  10. Question is too generic. If you have cycle-accurate pin-level model you need to interface with, you will have to write a transactor class that converts functional TLM interface to pin-level protocol. Usually it is implemented as SC_THREAD process sensitive to clock edge.
  11. Thanks for the response. This would be for verifying RTL code, possibly also systemC.
  12. Hello, I am trying to create a TLM Initiator that includes an external function. The idea is that a test program can be implemented in the external file and thus replaced with other programs as required. The test program calls function X defined in the initiator module. if I add the function in line i.e. void test_prog { .... } it works properly However if I put it in an external file with a function declaration for X and include this in the SC_MODULE I get. error <module_name>::X cannot be overloaded. Any feedback on this would would be greatly appreciated. Thanks, Steve
  13. Hello Roman, I have changed settings of my IDE to g++ compiler driver and my previous error was solved, but I have got 23 new ones) Could you help me to understand why it has happened Thanks in advance, Fedor
  14. Again, in your case you model a burst read which means in reality data gets transfered in several beats (32 in your case). Since your model does not deal with timing you wont notice that, all you see is that your data gets transfered. Look, TLM2.0 implements a generic bus protocol. Most of the real-world protocols have a so called burst transfer (e.g. checkout the AMBA specs). So the way to model this in an abstract way is to have a bust with and the amount of bytes being transfered in on bus transaction not in one beat. This way it is also possible to describe byte and half-word transfers. HTH
  15. In my case: I bind directly initiator and target iSocket(tSocket); when target receive transaction, it will copy data to payload unsigned char data[1024]; for (unsigned int i = 0; i < NUM_MAX; i++) { data[i] = i ; } memcpy(trans.get_data_ptr(), &data, length); with length = 128, Initiator read 128 byte from "trans", and I get 0, 1, 2, 3, 4,...127 I think if BUSWIDTH = 32 then I only get 0 ,1 ,2, 3, 0, 0, 0, 0.... It is mean, Initiator can get 128 bytes, in spite of BUSWIDTH= 32, So, I'm not clarify about BUSWIDTH
  16. Well, as the name says it is the data transfer with of the bus you are using. So in your case sending 128byte of data across bus having 32bits means you model a burst access having 32beats. Having said this you should notice that the bus width determines mainly the timing of a transaction. Unless you use timing for your transaction and rely on it (e.g. for performance modeling) it should not bother you. Best regrads
  17. Note that negative field width specifiers, as proposed by @c4brian, are non-standard. "The automatic sizing of displayed data can be overridden by inserting a field width between the % character and the letter that indicates the radix. The field width shall be a *non-negative* decimal integer constant." (SV2017, p. 629)
  18. Hi all, I dont know what is mean using Bus width when declare a socket. eg: model A has an initiator socket : tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types,0> iSocket; //BUSWIDTH = 32 model B has a target socket : tlm::tlm_target_socket<32,tlm::tlm_base_protocol_types,0> tSocket; //BUSWIDTH = 32 iSocket will bind with tSocket. when I issue a transaction from model A to model B with trans.set_data_length(128); // 128 > BUSWIDTH I received 128 byte data, What is mean BUSWIDTH when I declare a socket?
  19. It is spelled 'sc_spawn_options' so you missed the trailing s
  20. According to log, you are using C compiler driver (/usr/bin/gcc). SystemC is C++, you should write your application in C++ and use C++ compiler driver (g++). Maybe your IDE automatically uses C compiler because you named your source file main.c
  21. Hi, in my SC_THREAD I want to start another thread and I am using the sc_spawn method for that. To make it sensitive to the clock, I want to use sc_spawn_options (quick question: If my main thread is sensitive to the same clock signal, do I even need the spawn options?). However, when I try to compile it, it throws an error: error: ‘sc_spawn_option’ was not declared in this scope. When I remove the spawn options (and simply spawn the new Thread without them), I do not get an error. Here is the code: sc_spawn_option spawnOption; spawnOption.set_sensitivity(clock.pos()); sc_spawn(sc_bind(&AtomicFunction::startWorkerThread, this), "testThread", &spawnOption); This is how I have included systemc: #define SC_INCLUDE_DYNAMIC_PROCESSES #include <systemc.h> This is my build command: g++ -g -std=c++14 -I include -I /usr/local/systemc-2.3.3/include -I/usr/include/hdf5/serial -Wl,-rpath=/usr/local/systemc-2.3.3/lib-linux64 -pthread -L. -L/usr/local/systemc-2.3.3/lib-linux64 -L/usr/lib/x86_64-linux-gnu/hdf5/serial -c src/virtual/atomicfunction.cpp -o src/virtual/atomicfunction.o -lsystemc -lm -lhdf5 I have already checked /usr/local/systemc-2.3.3/include/ and saw that in the folder sysc/kernel/ are the files sc_spawn_options.h. But even when I include them directly (#include "/usr/local/systemc-2.3.3/include/sysc/kernel/sc_spawn_options.h") it throws the exact same error. Do I overlook some minor error? Any help is appreciated 🙂 Best regards
  22. Hello Mr. Black, Unfortunately I do not have today my code with me. I have created a module with SC_THREAD process. And in this module this process is made with constructor. I have probably understood my mistake but I can check it only on Monday when I will have access to my code. Thanks for the help! P.S. How could I register on edaplayground? My e-mail is not accepted by a system check.
  23. Hello everybody, My question is about how to configure GCC compiler in CodeLite. I have already compiled my downloaded SystemC library, but I could not correctly configure my CodeLite IDE. I am using GCC compiler. My path with SystemC is located here: /home/leo/Desktop/systemc-2.3.3 I have decided that I should include library paths inside a CodeLite using global paths. Without changing Linker and Compiler options. On the last screenshot you can see the log. Please tell my what should I do to configure my IDE Thanks in advance, Fedor
  24. It is configurable, see SystemC standard "6.4.4 Reading and writing signals".
  25. Could you please elaborate more on your suggestion? i can find out the voltage of every power domain, and each port knows the domain where it belongs... but how can I see where the signal comes from ??? I mean, if the ModA has a signal conected to ModB.... how modB can realize that the signal comes from modA?
  26. It is unclear where your std::cout is located. The earliest I would expect is inside start_of_simulation() or as the first thing inside an SC_THREAD. But your code has another issue. You are declaring two independent variables. One in the struct, and the other as a stack located version with an initial value of 4 ms. Perhaps you meant to do something like: https://www.edaplayground.com/x/2c9j
  1. Load more activity
×
×
  • Create New...