1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#ifndef __SYSC_CPU_ADD_HPP #define __SYSC_CPU_ADD_HPP #include "systemc.h" SC_MODULE (cpu_and) { sc_in <bool> in_a; sc_in <bool> in_b; sc_out <bool> out_c; void do_and() { out_c.write( in_a.read() && in_b.read() ); } SC_CTOR(cpu_and) { SC_METHOD(do_and); sensitive << in_a << in_b; } }; #endif