update scc, add minimal test for ordered_semaphore
This commit is contained in:
		| @@ -19,6 +19,7 @@ | ||||
| #include "scc/scv_tr_db.h" | ||||
| #include "scc/report.h" | ||||
| #include "scc/value_registry.h" | ||||
| #include <chrono> | ||||
|  | ||||
| // text         11308µs/11602µs | ||||
| // compressed   10365µs/ 9860µs | ||||
| @@ -198,7 +199,7 @@ inline void test::main1() { | ||||
|     for (int i = 0; i < 3; i++) { | ||||
|         rw_task_if::addr_t addr = i; | ||||
|         rw_task_if::data_t data = transactor->read(&addr); | ||||
|         SCINFO(sc_get_current_object()->name())  << "received data : " << data; | ||||
|         SCCINFO(sc_get_current_object()->name())  << "received data : " << data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<rw_task_if::addr_t> addr; | ||||
| @@ -206,14 +207,14 @@ inline void test::main1() { | ||||
|  | ||||
|         addr->next(); | ||||
|         rw_task_if::data_t data = transactor->read(addr->get_instance()); | ||||
|         SCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data; | ||||
|         SCCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<rw_task_if::write_t> write; | ||||
|     for (int i = 0; i < 3; i++) { | ||||
|         write->next(); | ||||
|         transactor->write(write->get_instance()); | ||||
|         SCINFO(sc_get_current_object()->name()) << "send data : " << write->data; | ||||
|         SCCINFO(sc_get_current_object()->name()) << "send data : " << write->data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<int> data; | ||||
| @@ -232,7 +233,7 @@ inline void test::main2() { | ||||
|     for (int i = 0; i < 3; i++) { | ||||
|         rw_task_if::addr_t addr = i; | ||||
|         rw_task_if::data_t data = transactor->read(&addr); | ||||
|         SCINFO(sc_get_current_object()->name())  << "received data : " << data; | ||||
|         SCCINFO(sc_get_current_object()->name())  << "received data : " << data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<rw_task_if::addr_t> addr; | ||||
| @@ -240,14 +241,14 @@ inline void test::main2() { | ||||
|  | ||||
|         addr->next(); | ||||
|         rw_task_if::data_t data = transactor->read(addr->get_instance()); | ||||
|         SCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data; | ||||
|         SCCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<rw_task_if::write_t> write; | ||||
|     for (int i = 0; i < 3; i++) { | ||||
|         write->next(); | ||||
|         transactor->write(write->get_instance()); | ||||
|         SCINFO(sc_get_current_object()->name()) << "send data : " << write->data; | ||||
|         SCCINFO(sc_get_current_object()->name()) << "send data : " << write->data; | ||||
|     } | ||||
|  | ||||
|     scv_smart_ptr<int> data; | ||||
| @@ -298,7 +299,7 @@ inline void design::addr_phase() { | ||||
|  | ||||
|         outstandingAddresses.push_back(_addr); | ||||
|         outstandingType.push_back(_rw); | ||||
|         SCINFO(sc_get_current_object()->name())  << "received request for memory address " << _addr; | ||||
|         SCCINFO(sc_get_current_object()->name())  << "received request for memory address " << _addr; | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -312,7 +313,7 @@ inline void design::data_phase() { | ||||
|             wait(clk->posedge_event()); | ||||
|         } | ||||
|         if (outstandingType.front() == false) { | ||||
|             SCINFO(sc_get_current_object()->name()) << "reading memory address " << outstandingAddresses.front() << " with value " | ||||
|             SCCINFO(sc_get_current_object()->name()) << "reading memory address " << outstandingAddresses.front() << " with value " | ||||
|                  << memory[outstandingAddresses.front().to_ulong()]; | ||||
|             bus_data = memory[outstandingAddresses.front().to_ulong()]; | ||||
|             data_rdy = 1; | ||||
| @@ -320,7 +321,7 @@ inline void design::data_phase() { | ||||
|             data_rdy = 0; | ||||
|  | ||||
|         } else { | ||||
|             SCINFO(sc_get_current_object()->name()) << "writing memory address " << outstandingAddresses.front() << " with value " << bus_data; | ||||
|             SCCINFO(sc_get_current_object()->name()) << "writing memory address " << outstandingAddresses.front() << " with value " << bus_data; | ||||
|             memory[outstandingAddresses.front().to_ulong()] = bus_data; | ||||
|             data_rdy = 1; | ||||
|             wait(clk->posedge_event()); | ||||
| @@ -351,7 +352,7 @@ inline const char* init_db(char type){ | ||||
| int sc_main(int argc, char *argv[]) { | ||||
|     auto start = std::chrono::system_clock::now(); | ||||
|     scv_startup(); | ||||
|     scc::init_logging(scc::LogConfig().logLevel(logging::DEBUG)); | ||||
|     scc::init_logging(scc::LogConfig().logLevel(scc::log::DEBUG)); | ||||
|     const char *fileName = argc==2? init_db(argv[1][0]): "my_db.txlog"; | ||||
|     if(argc<2) scv_tr_text_init(); | ||||
|     scv_tr_db db(fileName); | ||||
| @@ -400,6 +401,6 @@ int sc_main(int argc, char *argv[]) { | ||||
|     sc_start(10.0, SC_US); | ||||
|     sc_close_vcd_trace_file(tf); | ||||
|     auto int_us = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now()-start); | ||||
|     SCINFO() << "simulation duration "<<int_us.count()<<"µs"; | ||||
|     SCCINFO() << "simulation duration "<<int_us.count()<<"µs"; | ||||
|     return 0; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user