00001 // sampalib.org ESL library and tools 00002 // Copyright (C) 2007 Thierry Grellier 00003 // 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License version 2 as 00006 // published by the Free Software Foundation. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along 00014 // with this program; if not, write to the Free Software Foundation, Inc., 00015 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00016 // 00017 // contact: www.sampalib.org 00018 00019 #ifndef SAMPA_PERIODIC_TRAFFIC_GENERATOR_H 00020 #define SAMPA_PERIODIC_TRAFFIC_GENERATOR_H 00021 00022 #include "sampa/component/protocol.h" 00023 00024 namespace Sampa { 00025 00026 class PeriodicTrafficGenerator : public Module, public InitiatorResponseInterface { 00027 SAMPA_MODULE(PeriodicTrafficGenerator); 00028 public: 00029 PeriodicTrafficGenerator(const Name&); 00030 void bind_clock(Clock*); 00031 void bind_target(Target*); 00032 Initiator* get_initiator() { return &p_initiator; } 00033 bool recieve_response(const Response&); 00034 protected: 00035 void complete_restart(); 00036 bool check_binding(); 00037 private: 00038 void produce(); 00039 void consume(); 00040 void read(); 00041 void write(); 00042 00043 Clock* p_clock; 00044 Initiator p_initiator; 00045 IntParameter m_fifo_capacity; 00046 IntParameter m_burst_size; 00047 Address m_req_address; 00048 BoolParameter m_read; 00049 Time m_period; 00050 int m_burst; 00051 int m_fifo_size; 00052 int m_threshold; 00053 int m_num_outstanding_response; 00054 int m_max_fifo_size; 00055 int m_min_fifo_size; 00056 EventListener e_accepted; 00057 ClockedEventSingle e_read_threshold; 00058 ClockedEventSingle e_write_threshold; 00059 EventSingle e_read; 00060 EventSingle e_write; 00061 IntParameter m_word_size; 00062 AddressGenerator m_address_generator; 00063 Request m_request; 00064 }; 00065 00066 } 00067 00068 #endif
1.5.3