Jump to content

feron_jb

Members
  • Content Count

    14
  • Joined

  • Last visited

  1. Hi everyone, For a processor model, I need to be able to reset or kill a transaction sent across an interface and stored in a Payload Event Queue. How can I do that? If I initiate a transaction like this : tlm::tlm_generic_payload* trans = new tlm::tlm_generic_payload; tlm::tlm_phase* trans_phase = new tlm::tlm_phase; sc_time* delay = new sc_time; tlm::tlm_sync_enum* transStatus = new tlm::tlm_sync_enum; *trans_phase = tlm::BEGIN_REQ; *delay = SC_ZERO_TIME; // Or any delay trans->set_command(tlm::TLM_WRITE_COMMAND); trans->set_dmi_allowed(false); trans->set_response_status(tlm
  2. Hello, I have a SystemC program encapsulated into a C++ class allowing to interact with a SystemC model. In order to easily call that program from a scripting language, I would like to generate a shared-library containing all my SystemC program and the SystemC library. Is it different from generating a classical C/C++ shared-library? How can you deal with the sc_main required by the SystemC? Can you point me to some documentation about that topic, I didn't find anything about it for SystemC on the internet... Thank you! Regards! J-B
  3. Hi, I have some problems with exceptions thrown inside systemC modules and catched in a classical C++ class, parent of the systemC one. The codes shown here only illustrate the structure of my program and are not intended to be compiled. I defined my own exception class, extending the standard exception class : #include "systemc.h" class customException : public std::exception{ // Constructor customException{ // Instance variables with information about the error std::string message; std::string fileInfo; sc_time time; };
  4. I finally found a bug caused by an uninitialized pointer. I had to extensively use the command line GDB and discovered a really powerful debug tool, more reliable than the graphical GDB integrated to Eclipse CDT. Thank you also for your useful advices about GDB use, pointer initialization, etc.
  5. Hi, Thank you for your answers. @dakupoto : I noticed your advices about Eclipse. I am using it for its dynamic error detection which is really useful and makes me gain a lot of time. If you have lighter solution, please share. Regarding my example, I am indeed using a lot of pointers which make it difficult to understand and debug. However, as I said in my initial post, I initialize my table of pointers itemArray correctly as I can read the content, I just do not show the initialization code in the example. The error is not in my pointer use, I think, but instead in my use of some syst
  6. Hello, I have a strange beahavior of a systemC program caused by a debug function. This function (called memItemExamine) allows to read a memory cell in a sub-module (memDev in the example) from the top level class (Model_top in the example). The particularity of that error lies in the fact that I can read the memory cell (content is correctly displayed in terminal), but when later a process comes to read the memory cell again, the program fails with a segmentation fault. Please find a simplified example of my codes hereunder, they illustrate the hierarchy of my program and the methodol
  7. You are right, declaring my two threads in my class definition and then instanciating it in the constructor fixed my problem. A stupid basic C++ error... Thank you for your solution!
  8. Hello everyone, I have a runtime error when trying to simulate the top level of a system containing 2 sc_threads. An example of my code architecture is presented hereunder, do you see any problem? Here is my error : Error: (E519) wait() is only allowed in SC_THREADs and SC_CTHREADs: in SC_METHODs use next_trigger() instead In file: ../../../../src/sysc/kernel/sc_wait.cpp:166 In process: Test_top.th1.Thread_test @ 0 s TB_test_top.cpp: #include "Test_top.h" int sc_main(int argc, char* argv[]) { Test_top topLevel("topLevel"); sc_start(70, SC_NS); }; Test_top.h: #inclu
  9. I am now effectively initializing my SystemC object in the user classe constructor. My question about dynamic allocation, pointer and array of systemC objects is more for syntaxic interest and to be able to implement it. Who knows, one day, it might be necessary.
  10. Hi Philipp, Thank you for your quick answer and interesting remarks. I think my main problem is my misunderstanding of the SystemC constructor. I though the string passed as argument was used as instance name in simulation, I'm now doubting. Or maybe it is not necessary in a pointer to a SystemC object declaration. By this misunderstanding, I can't declare a pointer to the SystemC object MySC_obj (what I was trying to do, not to initialize the oblect in the class :-D ) Could you, please, explain (or point me to the documentation about) : the role of the string in the systemC constru
  11. Hello, I am trying to develop a service class allowing a user to interact with a SystemC model. I am in trouble during my SystemC object instanciation in the service class. Do you see any errors in my example codes hereunder? File sc_user.h #include "MySC_obj.h" class sc_user{ public : // Service class constructor sc_user(); // SC model instanciation MySC_obj* test("test"); } File MySC_obj.h #include <systemc.h> SC_MODULE(MySC_obj){ ... SC_HAS_PROCESS(MySC_obj); MySC_obj(sc_module_name instName) : sc_module(instName), ...{ SC_THREAD(...); ...
  12. Hi, I had the same problems as you and I could solve it with some documentation. I provide links in an answer of my own question here. Have a nice day, Regards, J-B
  13. I could finally make it using TLM docmentation (the IEEE 1666 standard might be useful). I had to implement a TLM transaction extension to fit the particular needs of some transactions between the pipeline and the file register. Useful examples for TLM transaction extensions are provided in a document from the university of Munich. Finally, the Doulos examples are also interesting (but less interesting than the last one). Hope this helped! J-B
  14. Hello, I'm developping a processor behavioural model using SystemC/TLM standard. I try to make the result cycle-accurate. I have some troubles for modelling the pipeline-file register communication with TLM. I want to to be able to write in a register but the new data must be available for a read only one clock cycle later (or 20ns later). I could do this by implementing sockets in my pipeline and my file register modules, using the available generic payload, as my file register is addressed. However, some of my registers are defined as structure containing boolean in order to read or
×
×
  • Create New...