From 4a111c26d5d1030669975700558799932b2d86bd Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Mon, 15 Oct 2018 21:22:42 +0100 Subject: Add CPU XOR --- cpu8/cpu_xor/cpu_xor.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 cpu8/cpu_xor/cpu_xor.hpp (limited to 'cpu8/cpu_xor/cpu_xor.hpp') diff --git a/cpu8/cpu_xor/cpu_xor.hpp b/cpu8/cpu_xor/cpu_xor.hpp new file mode 100644 index 0000000..855125c --- /dev/null +++ b/cpu8/cpu_xor/cpu_xor.hpp @@ -0,0 +1,25 @@ +#ifndef __SYSC_CPU_XOR_HPP +#define __SYSC_CPU_XOR_HPP + +#include "systemc.h" + +SC_MODULE (cpu_xor) +{ + sc_in in_a; + sc_in in_b; + sc_out out_c; + + void do_xor() + { + out_c.write( (in_a.read()^in_b.read()) ); + } + + SC_CTOR(cpu_xor) + { + SC_METHOD(do_xor); + sensitive << in_a << in_b; + } + +}; + +#endif \ No newline at end of file -- cgit v1.2.3