diff options
Diffstat (limited to 'cpu8/cpu_and/cpu_and.hpp')
-rw-r--r-- | cpu8/cpu_and/cpu_and.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cpu8/cpu_and/cpu_and.hpp b/cpu8/cpu_and/cpu_and.hpp new file mode 100644 index 0000000..0c78dc0 --- /dev/null +++ b/cpu8/cpu_and/cpu_and.hpp @@ -0,0 +1,25 @@ +#ifndef __SYSC_CPU_ADD_HPP +#define __SYSC_CPU_ADD_HPP + +#include "systemc.h" + +SC_MODULE (cpu_and) +{ + sc_port<sc_signal_in_if<bool>,0> in_a; + sc_port<sc_signal_in_if<bool>,0> in_b; + sc_port<sc_signal_out_if<bool>,0> out_c; + + void do_and() + { + out_c[0]->write( in_a[0]->read() && in_b[0]->read() ); + } + + SC_CTOR(cpu_and) + { + SC_METHOD(do_and); + sensitive << in_a << in_b; + } + +}; + +#endif
\ No newline at end of file |