summaryrefslogtreecommitdiff
path: root/cpu8/cpu_nand/cpu_nand.hpp
blob: 819499802a7770db1f418e052c3410435a3c01ac (plain) (blame)
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_NAND_HPP
#define __SYSC_CPU_NAND_HPP

#include "systemc.h"

SC_MODULE (cpu_nand) 
{
	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_nand()
	{
		out_c[0]->write( !(in_a[0]->read() && in_b[0]->read()) );
	}

	SC_CTOR(cpu_nand)
	{
		SC_METHOD(do_nand);
		sensitive << in_a << in_b;
	}

};

#endif