Search the Community
Showing results for tags 'systelc'.
-
Hi all , pls who can expain to me the reson of this warning even my code is too simple warning C4407: cast impossible between different representation of pointer , lthe complier may generate a wrong code #ifndef ALARM_H_ #define ALARM_H_ #include <systemc> #include <iostream> SC_MODULE(Alarm) { sc_core::sc_in<bool> i; SC_CTOR(Alarm) : i("i") { SC_METHOD(AlarmMethod); sensitive << i.pos(); dont_initialize(); } void AlarmMethod(); }; // Alarm #endif // ALARM_H_ ---------------------------------------------------------- #include "alarm.h" void Alarm::AlarmMethod() { bool temp = i.read(); std::cout << sc_core::sc_time_stamp() <<std::boolalpha << " i: " << temp << std::endl; } ------------ #include "detect.h" void Detect::DetectThread() { // Open CV setup // required only once. while(1) { // Call OpenCV motion detection // Compare with threshold // if greater then write true // else // false if (!s) { s = true; } else { s = false; } std::cout <<sc_core::sc_time_stamp() << std::boolalpha << " s: " << s << std::endl; o.write(s); wait(50, sc_core::SC_MS); } } ------------------------------------------------ #include "top.h" int sc_main(int argc, char **argv) { Top t("t"); sc_core::sc_start(1000, sc_core::SC_MS); sc_core::sc_stop(); return 0; }