summaryrefslogtreecommitdiff
path: root/cpu8/cpu_add/cpu_and.hpp
blob: 0c78dc048302b483e1fbc8a61f08e47ed4e2dc1f (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_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