Power annotation of the TLM2.0 bus multiplexor:
busmux64::busmux64(sc_module_name name, u64_t threshold): sc_module_pr(name), targ_socket("targ_socket"), init_socket("init_socket"), threshold(threshold) { #ifdef PRAZOR op_energy = PR_PICOJ(8 * 64); prazor_energy_t static_power = PR_NANOW(8 * 64); pr_static_power(static_power); pr_size(PR_MICRON(3),PR_MICRON(10)); #endif // Register callbacks for incoming interface method calls targ_socket.register_b_transport(this, &busmux64::b_transport); } // TLM-2 blocking transport method void busmux64::b_transport(int id, tlm::tlm_generic_payload &trans, sc_time &delay) { u64_t adr = (u64_t) trans.get_address() & ~(0xFFLLU << 56LLU); if (adr < threshold) init_socket[0]->b_transport(trans, delay); else { u64_t adr = ((u64_t)trans.get_address()); trans.set_address(adr - threshold); init_socket[1]->b_transport(trans, delay); trans.set_address(adr); } #ifdef PRAZOR pr_dynamic_event(op_energy); #endif }
(MPhil: Checkout from /usr/groups/han/cvs/prazor)