#ifndef __SYSC_CPU_CODE_REG_HPP #define __SYSC_CPU_CODE_REG_HPP #include "systemc.h" #include "../cpu_and/cpu_and.hpp" #include "../cpu_not/cpu_not.hpp" #include "../cpu_srlatch/cpu_srlatch.hpp" SC_MODULE (cpu_code_reg) { //Inputs sc_port,0> in_d; sc_port,0> in_e; //Outputs sc_port,0> out_q; //Internal variables bool bit=false; void do_code_reg() { //if enabled if (in_e[0]->read()) { //set data bit = in_d[0]->read(); } //no delay out_q[0]->write(bit); } SC_CTOR(cpu_code_reg) { SC_METHOD(do_code_reg); sensitive << in_d << in_e; } }; #endif