#ifndef __SYSC_CPU_GATEDLATCH_HPP #define __SYSC_CPU_GATEDLATCH_HPP #include "systemc.h" #include "../cpu_nand/cpu_nand.hpp" SC_MODULE (cpu_gatedlatch) { //Inputs sc_in in_d; sc_in in_e; sc_out out_q,out_nq; cpu_nand *nand1, *nand2, *nand3, *nand4, *nand5; sc_signal sig_nand1nand3; sc_signal sig_nand2nand4; sc_signal sig_nand3nand5; sc_signal sig_qnand5, sig_nqnand4; void do_gatedlatch() { } SC_CTOR(cpu_gatedlatch) { nand1 = new cpu_nand("NAND1"); nand2 = new cpu_nand("NAND2"); nand3 = new cpu_nand("NAND3"); nand4 = new cpu_nand("NAND4"); nand5 = new cpu_nand("NAND5"); nand1->in_a(in_d); nand1->in_b(in_d); nand1->out_c(sig_nand1nand3); nand2->in_a(in_d); nand2->in_b(in_e); nand2->out_c(sig_nand2nand4); nand3->in_a(in_e); nand3->in_b(sig_nand1nand3); nand3->out_c(sig_nand3nand5); nand4->in_a(sig_nand2nand4); nand4->in_b(sig_nqnand4); nand4->out_c(out_q); nand4->out_c(sig_qnand5); nand5->in_a(sig_qnand5); nand5->in_b(sig_nand3nand5); nand5->out_c(out_nq); nand5->out_c(sig_nqnand4); //SC_METHOD(do_gatedlatch); //sensitive << in_d << in_clk; } }; #endif