summaryrefslogtreecommitdiff
path: root/cpu8/cpu_nand/cpu_nand.hpp
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2018-10-15 20:46:48 +0100
committerFreeArtMan <dos21h@gmail.com>2018-10-15 20:46:48 +0100
commit835baba906728e7bfc8023a67fa1e42f6af03ba0 (patch)
tree43a9cea08288ba6998f5547775e7348df343737e /cpu8/cpu_nand/cpu_nand.hpp
parentcf62bb4ee147c5ab51ada2437ac876f627fbb542 (diff)
downloadcpu8-835baba906728e7bfc8023a67fa1e42f6af03ba0.tar.gz
cpu8-835baba906728e7bfc8023a67fa1e42f6af03ba0.zip
Add CPU NAND
Diffstat (limited to 'cpu8/cpu_nand/cpu_nand.hpp')
-rw-r--r--cpu8/cpu_nand/cpu_nand.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpu8/cpu_nand/cpu_nand.hpp b/cpu8/cpu_nand/cpu_nand.hpp
new file mode 100644
index 0000000..5e5e517
--- /dev/null
+++ b/cpu8/cpu_nand/cpu_nand.hpp
@@ -0,0 +1,25 @@
+#ifndef __SYSC_CPU_NAND_HPP
+#define __SYSC_CPU_NAND_HPP
+
+#include "systemc.h"
+
+SC_MODULE (cpu_nand)
+{
+ sc_in <bool> in_a;
+ sc_in <bool> in_b;
+ sc_out <bool> out_c;
+
+ void do_nand()
+ {
+ out_c.write( !(in_a.read() && in_b.read()) );
+ }
+
+ SC_CTOR(cpu_nand)
+ {
+ SC_METHOD(do_nand);
+ sensitive << in_a << in_b;
+ }
+
+};
+
+#endif \ No newline at end of file