/* -*- c++ -*- * File : vci_traffic_generator.cpp * Date : 26/08/2010 * Copyright : UPMC / LIP6 * Authors : Christophe Choichillon * * SOCLIB_LGPL_HEADER_BEGIN * * This file is part of SoCLib, GNU LGPLv2.1. * * SoCLib is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 of the License. * * SoCLib is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with SoCLib; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA * * SOCLIB_LGPL_HEADER_END * * Maintainers: christophe.choichillon@lip6.fr */ #include "../include/vci_synthetic_initiator.h" namespace soclib { namespace caba { #define tmpl(x) template x VciSyntheticInitiator //using soclib::common::uint32_log2; //////////////////////////////// // Constructor //////////////////////////////// tmpl(/**/)::VciSyntheticInitiator( sc_module_name name, size_t length, // Packet length (flit numbers) float rho, // Packets ratio on the network size_t depth, // Fifo depth size_t x, // size_t y, // size_t xmesh, size_t ymesh, size_t bc_period, // Broadcast period, if no broadcast => 0 size_t xmin, size_t xmax, size_t ymin, size_t ymax ) : soclib::caba::BaseModule(name), p_clk("clk"), p_resetn("resetn"), p_vci("vci_ini"), m_srcid_ini( mtc.indexForId(vci_ini_index) ), // FIFOs m_date_fifo("m_date_fifo", depth), r_tgt_cmd_fsm("r_tgt_cmd_fsm"), { // Memory cache allocation & initialisation m_cache_data = new data_t**[nways]; for ( size_t i=0 ; i