Search the Community
Showing results for tags 'systemc2.3'.
-
Hello, I have a system-under-test that can connect to one or more producers, as well as one or more consumers. I am currently writing a testbench for this system. I have a sequence of N test scenarios I would like to submit my SUT to, so I'd like phase through each in my testbench. I could instantiate N separate testbenches, but I am looking for a more elegant solution that only requires me to instantiate one testbench, and phase through the tests within it. I am looking for suggestions on how to do this. The primary concerns for me are that it should not be too difficult to understand the testing mechanism, and it should be as easy as possible to add new tests, or modify existing ones. To give this some substance, this is the solution I have design so far: class Producer : public sc_module { public: sc_event first_test_e; sc_event second_test_e; sc_mutex busy_lock; // ... void first_test() { wait(first_test_e); busy_lock.lock(); // ... busy_lock.unlock(); } void second_test() { wait(second_test_e); busy_lock.lock(); // ... busy_lock.unlock(); } }; class Consumer : public sc_module { public: sc_event first_test_e; sc_event second_test_e; sc_mutex busy_lock; // ... void first_test() { wait(first_test_e); busy_lock.lock(); // ... busy_lock.unlock(); } void second_test() { wait(second_test_e); busy_lock.lock(); // ... busy_lock.unlock(); } }; class tb_top : public sc_module { public: Producer prod_i; Consumer cons_i; // ... void top_test() { // First test starts... prod_i.first_test_e.notify(SC_ZERO_TIME); cons_i.first_test_e.notify(SC_ZERO_TIME); wait(SC_ZERO_TIME); wait(SC_ZERO_TIME); prod_i.busy_lock.lock(); cons_i.busy_lock.lock(); // First test done. prod_i.busy_lock.unlock(); cons_i.busy_lock.unlock(); // Go on to second test... // ... } }; Here, I use events owned by the producers/consumers to begin tests. I use locks to communicate to the top test thread when all producers/consumers are done. I created a rudimentary prototype for this with success. Do you have any feedback?
- 3 replies
-
- systemc2.3
- test
-
(and 2 more)
Tagged with:
-
Hello everyone, I’m new in systemc and in this forum. I successfully downloaded and installed systemc-2.3.0 on MSVC-2010 (Windows 7) I can compile and run the examples. BUT when I write an own program it doesn’t work. For example I wrote this simple program. #include "systemc.h"#define WIDTH 4 SC_MODULE(adder) { sc_in<sc_uint<WIDTH> > a, b; sc_out<sc_uint<WIDTH> > sum; void do_add() { sum.write(a.read() + b.read()) } SC_CTOR(adder) { SC_METHOD(do_add); sensitive << a << b; } }; systemc.lib(sc_main_main.obj) : error LNK2019: unresolved external symbol > _sc_main referenced in function _sc_elab_and_sim > Debug/addieren.exe : fatal error LNK1120: 1 unresolved externals It seems that the compiler can’t find systemc.lib, but I have add additional libraries in the properties and set the environment variable. I checked it many times but I always got the above-mentioned messages. Can you help me? Thanks in advance. Regards, Aydin Uni Bochum
- 2 replies
-
- msvs10
- visual studio 10
-
(and 3 more)
Tagged with: