Jump to content

All Activity

This stream auto-updates

  1. Today
  2. Yesterday
  3. Hi, Does someone know if there is any free software available to write and explore PSS scenarios? All EDA vendors offer a complete tool to generate and schedule solutions in actual code. I am looking for a package that only represent the possible solution graphs without any exec bodies implemented. Is any freeware of any kind available? If I want to get started with PSS, without having to buy a EDA license, what is the best way forward? Regards Heino
  4. Use a proper OS mutex to lock OS processes during access to shared data. Never inject events into SystemC without using async_request_update in a custom primitive channel.
  5. Last week
  6. PSS 3.0 adds new features, corrects errors, clarifies aspects of the language and semantic definitions, removes some features, and reorganizes some sections relative to version 2.1 of the Portable Test and Stimulus Standard (October 2023). The most substantial feature added in 3.0 is support for Behavioral Coverage (Clause 19), which allows the user to identify a set of actions and data combinations that need to be observed to exercise key functionality. Other new features include: String methods, including size() and find(), and the sub-string operator to extract a sub-string from a given string (7.6) Support for collections of reference types (7.10) Platform qualifiers on function prototype declarations (22.2) Support for comments in target-template blocks (22.5) Support for yielding control with cooperative multitasking (22.7.14) Added an address space group to allow multiple address spaces to share common storage elements (24.9) Defined mapping between PSS lists and SystemVerilog Queues (D.5.5) Added Annex F to specify the formal semantics of behavioral coverage The PSS public review will be open through July 5, 2024. The public review draft can be downloaded here. Please post questions or comments in this forum.
  7. I have a multi-core C processor model, for each processor I use vcml:: sc_async(machineware-gmbh/Virtual Components Modeling Library) parallel simulation to execute ISS instructions to improve the performance of the simulation. about the memory accesses in ISS I used TLM socket accesses, but then TLM access have outside SC_THREAD problem so how to solve the problem that std::thread in sc_async switches to SC_THREAD for TLM accesses during accesses?
  8. Earlier
  9. Assuming your processes only write on the posedge clock, you could use an sc_buffer<bool> and make the last process sensitive to the buffer instead of the clock. Every time the queue is written, also write to the buffer (true). Since all the other processes will be enabled at the posedge clock, the buffer will not be processed until one delta-cycle after the clock has been processed. You would probably want to create a simple wrapper for the queue and processing. I suggest using an unbounded tlm_fifo<T> for the queue.
  10. This is not correct. since it is a sequence, it belongs to object class. So you should create it like an object class. reg_bitbash = reg_bit_bash_seq::type_id::create("reg_bitbash");
  11. Thanks a lot @AmeyaVS @Eyck. I will try to use SC in the same OS.
  12. Hi, As part of our development @AsFigo we developed a custom UVMLint for BCL and the results can be found at https://asfigo.blogspot.com/2024/03/customizing-uvmlint-for-ieee-18002-base.html Happy to share more details if anyone is interested. Ajeetha AsFigo
  13. Hi Eyck, thank you for the hint. Other processes may or may not write to the queue every cycle. Do you have in mind some mechanism which I could use to be sure that send_m is called when all of those who (potentially) write to the queue have written?
  14. There is no way to enforce an ordering on thread or method invokation. One way to achieve this is to make send_m sensitive on the queue (using sc_fifo or tlm_utils::peq*) and let the other processes write into this queue.
  15. They have been further developed and we moved them to github: https://github.com/Minres/TGC-VP https://github.com/Minres/HIFIVE1-VP
  16. Hello @Allen yang, As responded by @Eyck, it might work. But I would not recommend it. You might hit issues due to incompatibilities in OS, system libraries, compiler generated output, etc. You might get very hard to debug issues or random simulation crashes. It's better to recompile for the target platform if you can to have a chance of better compatibility. Regards, Ameya Vikram Singh
  17. Hi! I need a help with SystemC processes. If I have the design with several SC_THREADs/METHODs which are sensitive to the clk.posedge_event() (some of them are using non blocking transport), is there a way that we ensure one SC_METHOD to be scheduled "last" among them? All other threads should put some data to the queue, and then SEND thread should send it. Would this approach (with wait(SC_ZERO_TIME)) help? void send_m() { // should be called last wait(clk.posedge_event()); wait(SC_ZERO_TIME); // send things from the queue }
  18. Usually this does not work. There are quite a few dependenies to OS and compiler libraries which prevent this. If you build systemc as a shared library there is some chance to get it work.
  19. Hi, Everyone, I have download SC on github and compile install on el7 which runs well. I want to use formmer compile SC result and copy the sc.a and include to my new el8 OS. However, I get undefined error on new OS. ../include/systemc/sysc/datatypes/int/sc_uint_base.h:848: undefined referece to `sc_dt::sc_uint_base::to_string() const` Here's my quenction, can we reuse the compile result of other OS?
  20. Hi David Black, Thankyou for your response, I have good knowledge on basic UVM RAL and my requirement is about RAL implementation especially "accessing register from more than one master". From your response i got to know that is being covered as part of Doulos UVM Adopter course. Can you please share the course and Price details , i tried sending a enquiry form to doulous from link " https://www2.doulos.com/forms/enquiry " but it didn't work for some reason.
  21. #include <systemc.h> #include <pthread.h> #include <unistd.h> using namespace std; class ThreadSafeEventIf : public sc_interface { virtual void notify(sc_time delay = SC_ZERO_TIME) = 0; virtual const sc_event &default_event(void) const = 0; protected: virtual void update(void) = 0; }; class ThreadSafeEvent : public sc_prim_channel, public ThreadSafeEventIf { public: ThreadSafeEvent(const char *name = ""): event(name) {} void notify(sc_time delay = SC_ZERO_TIME) { this->delay = delay; async_request_update(); } const sc_event &default_event(void) const { return event; } protected: virtual void update(void) { event.notify(delay); } sc_event event; sc_time delay; }; sc_event GenScEvent; sc_event workingFinishEvent; // finish event int workingFlag = 0; // maybe dnot need a lock SC_MODULE(Foo) { public: SC_CTOR(Foo) { SC_THREAD(main); SC_METHOD(eventTriggered); sensitive << threadSafeEvent; dont_initialize(); } private: void main() { //extra forever thread to avoid simulation exit while (1) { usleep(1*1000*1000); // check if there is any instruction every one sec. wait(SC_ZERO_TIME); if(workingFlag){ // check working wait(workingFinishEvent); // wait the working finish } usleep(1*1000*1000); } } void eventTriggered() { // printf("Foo: Got event from pthread \n"); GenScEvent.notify(); } public: ThreadSafeEvent threadSafeEvent; }; void* PollingThread(void* arg) { int cnt = 0; while (1) { cnt++; printf("[POLL]: %d: Before generating event from PollingThread \n", cnt); usleep(3*1000*1000); Foo *foo = (Foo*)(arg); foo->threadSafeEvent.notify(); printf("[POLL]: %d: Event notified from PollingThread \n", cnt); } }; class sc_top : public sc_module { private: SC_HAS_PROCESS(sc_top); public: sc_top(sc_module_name name="SCTOP"): sc_module(name) { SC_THREAD(processing_thread); } void processing_thread(); }; void sc_top::processing_thread() { int cnt =0; while (1) { printf("[PROC]: processing_thread called \n"); cout << "[PROC]: Wait GenScEvent time: " << sc_time_stamp(); wait(GenScEvent); workingFlag = 1; cnt++; wait(10, SC_SEC); // advance simulation time cout << "[PROC]: Got and Finish "<<cnt << " GenScEvent time: " << sc_time_stamp(); workingFinishEvent.notify(); workingFlag = 0; } } int sc_main(int argc, char *argv[]) { Foo foo("foo"); sc_top u_sc_top("u_sc_top"); pthread_t thread; pthread_create(&thread, NULL, PollingThread, &foo); sc_start(); return 0; } this example is a better one. it won't destory simulation time.
  22. My use-case is in `SC_METHOD` or `SC_(C)THREAD` if exception caught I can see the ori stack trace with c++ not rethrow or caught by `sc_report`. The stack trace isn't my exception. I don't want to use `catch throw` to get stack trace which I really need.
  23. hi yaohe, I understand your question and I met same problem too. We want the simulation keep alive and wait asyn events, but the extra SC_THREAD "main"(as you said) destroy simulation time. Do you solve this problem now? Or I hope the example blew can solve it: #include <systemc.h> #include <pthread.h> #include <unistd.h> using namespace std; class ThreadSafeEventIf : public sc_interface { virtual void notify(sc_time delay = SC_ZERO_TIME) = 0; virtual const sc_event &default_event(void) const = 0; protected: virtual void update(void) = 0; }; class ThreadSafeEvent : public sc_prim_channel, public ThreadSafeEventIf { public: ThreadSafeEvent(const char *name = ""): event(name) {} void notify(sc_time delay = SC_ZERO_TIME) { this->delay = delay; async_request_update(); } const sc_event &default_event(void) const { return event; } protected: virtual void update(void) { event.notify(delay); } sc_event event; sc_time delay; }; sc_event GenScEvent; sc_event workingFinishEvent; // finish event int workingFlag = 0; // maybe dnot need a lock SC_MODULE(Foo) { public: SC_CTOR(Foo) { SC_THREAD(main); SC_METHOD(eventTriggered); sensitive << threadSafeEvent; dont_initialize(); } private: void main() { //extra forever thread to avoid simulation exit while (1) { usleep(1*1000*1000); // check if there is any instruction every one sec. wait(SC_ZERO_TIME); if(workingFlag){ // check working wait(workingFinishEvent); // wait the working finish } usleep(1*1000*1000); } } void eventTriggered() { // printf("Foo: Got event from pthread \n"); GenScEvent.notify(); } public: ThreadSafeEvent threadSafeEvent; }; void* PollingThread(void* arg) { int cnt = 0; while (1) { cnt++; printf("[POLL]: %d: Before generating event from PollingThread \n", cnt); usleep(3*1000*1000); Foo *foo = (Foo*)(arg); foo->threadSafeEvent.notify(); printf("[POLL]: %d: Event notified from PollingThread \n", cnt); } }; class sc_top : public sc_module { private: SC_HAS_PROCESS(sc_top); public: sc_top(sc_module_name name="SCTOP"): sc_module(name) { SC_THREAD(processing_thread); } void processing_thread(); }; void sc_top::processing_thread() { int cnt =0; while (1) { printf("[PROC]: processing_thread called \n"); cout << "[PROC]: Wait GenScEvent time: " << sc_time_stamp(); wait(GenScEvent); workingFlag = 1; cnt++; wait(10, SC_SEC); // advance simulation time cout << "[PROC]: Got and Finish "<<cnt << " GenScEvent time: " << sc_time_stamp(); workingFinishEvent.notify(); workingFlag = 0; } } int sc_main(int argc, char *argv[]) { Foo foo("foo"); sc_top u_sc_top("u_sc_top"); pthread_t thread; pthread_create(&thread, NULL, PollingThread, &foo); sc_start(); return 0; }
  24. Hi BR, I noticed that the two paths at minres are 404 errored now. Is the github path the replicate of that? https://github.com/vherdt/riscv-vp/tree/master Best Regards, User 128
  25. The difference between sc_buffer and sc_signal is that sc_buffer<T>::write issues an event on every write; whereas, sc_signal<T>::write only issues an event if the value changes (e.g., from 0 to 1 or 1 to 0). I would have to see all your code (preferably on EDA playground) to understand the issue.
  26. Something like the following might be a clue... uvm_reg regs[$]; regmodel.get_registers(regs); foreach( regs[i] ) begin `uvm_report_info("Register",regs[i].get_name()) end
  27. Hello @Allen yang, It is possible to get a stack trace, but then again what is your use-case? Regards, Ameya Vikram Singh
  28. Hi @AmeyaVS, When I try `vector::at` in `SC_METHOD` or `SC_(C)THREAD`, the stack can't be show. I try to rewrite `sc_except.cpp::sc_handle_exception`, it didn't work. Can you help me figure out this? Regards, Allen
  1. Load more activity
×
×
  • Create New...