#ifndef _TESTBENCH_H_ #define _TESTBENCH_H_ #include #include #include using namespace sc_core; class testbench : public sc_core::sc_module { public: enum { DWIDTH = 32 }; sc_core::sc_time clk_period{10, sc_core::SC_NS}; sc_core::sc_clock clk{"clk", clk_period, 0.5, sc_core::SC_ZERO_TIME, true}; sc_core::sc_signal rst_n{"rst_n"}; // initiator side tlm::scc::initiator_mixin> isck{"isck"}; ahb::pin::initiator intor_bfm{"intor_bfm"}; // signal accurate bus sc_core::sc_signal> HADDR{"HADDR"}; sc_core::sc_signal> HBURST{"HBURST"}; sc_core::sc_signal HMASTLOCK{"HMASTLOCK"}; sc_core::sc_signal> HPROT{"HPROT"}; sc_core::sc_signal> HSIZE{"HSIZE"}; sc_core::sc_signal> HTRANS{"HTRANS"}; sc_core::sc_signal> HWDATA{"HWDATA"}; sc_core::sc_signal HWRITE{"HWRITE"}; sc_core::sc_signal> HRDATA{"HRDATA"}; sc_core::sc_signal HREADY{"HREADY"}; sc_core::sc_signal HRESP{"HRESP"}; sc_core::sc_signal HSEL{"HSEL"}; // target side ahb::pin::target tgt_bfm{"tgt_bfm"}; tlm::scc::target_mixin> tsck{"tsck"}; public: SC_HAS_PROCESS(testbench); testbench() : testbench("testbench") {} testbench(sc_core::sc_module_name nm) : sc_core::sc_module(nm) { intor_bfm.HCLK_i(clk); tgt_bfm.HCLK_i(clk); // bfm to signals isck(intor_bfm.tsckt); intor_bfm.HRESETn_i(rst_n); intor_bfm.HADDR_o(HADDR); intor_bfm.HBURST_o(HBURST); intor_bfm.HMASTLOCK_o(HMASTLOCK); intor_bfm.HPROT_o(HPROT); intor_bfm.HSIZE_o(HSIZE); intor_bfm.HTRANS_o(HTRANS); intor_bfm.HWDATA_o(HWDATA); intor_bfm.HWRITE_o(HWRITE); intor_bfm.HRDATA_i(HRDATA); intor_bfm.HREADY_i(HREADY); intor_bfm.HRESP_i(HRESP); // signals to bfm tgt_bfm.HRESETn_i(rst_n); tgt_bfm.HADDR_i(HADDR); tgt_bfm.HBURST_i(HBURST); tgt_bfm.HMASTLOCK_i(HMASTLOCK); tgt_bfm.HPROT_i(HPROT); tgt_bfm.HSIZE_i(HSIZE); tgt_bfm.HTRANS_i(HTRANS); tgt_bfm.HWDATA_i(HWDATA); tgt_bfm.HWRITE_i(HWRITE); tgt_bfm.HSEL_i(HSEL); tgt_bfm.HRDATA_o(HRDATA); tgt_bfm.HREADY_o(HREADY); tgt_bfm.HRESP_o(HRESP); tgt_bfm.isckt(tsck); } void run1() {} }; #endif // _TESTBENCH_H_