example_splitcomplete.cpp from GreenSocs at Krugle
Show example_splitcomplete.cpp syntax highlighted
// LICENSETEXT
//
// Copyright (C) 2005,2006 :
// GreenSocs Ltd
// (http://www.greensocs.com/),
//
// email: info@greensocs.com
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// ENDLICENSETEXT
#include <systemc.h>
#include "gstlm/router/genericRouter.h"
#include "gstlm/router/protocol/SimpleBus/simpleBusProtocol.h"
#include "gstlm/router/scheduler/fixedPriorityScheduler.h"
#include "sillysort.h"
#include "simplememory_sc.h"
// #define USE_DUST
#ifdef USE_DUST
#include "xml_log/static_model/model_builder.h"
#endif
////////////////////////////////////////
// main
////////////////////////////////////////
int sc_main(int, char**)
{
sillysort m1("MasterMark",0x4010, "Call me or I will call you");
sillysort m2("MasterWolle",0x00ff, "I want a faster bus");
sillysort m3("MasterRobert",0xffffff00, "My bus even can handle timeouts");
sillysort m4("MasterMarcus",0x1202, "TLM rocks");
sillysort m5("MasterOliver",0x4000, "We dumped the core");
simplememory_sc s1("Slave0",1);
s1.setAddress(0x4000, 0x4050);
simplememory_sc s2("Slave1",19);
s2.setAddress(0xffffff00, 0xffffffff);
simplememory_sc s3("Slave2",4);
s3.setAddress(0x1200, 0x120f);
simplememory_sc s4("Slave3",3);
s4.setAddress(0x0000, 0x11ff);
SimpleBusProtocol<GenericTransaction, GenericPhase> p("Protocol", sc_time(10, SC_NS));
fixedPriorityScheduler<GenericTransaction, GenericPhase> s("Scheduler");
GenericRouter<GenericTransaction, GenericPhase, GenericRouterAccess> r("Router");
r.protocol_port(p);
p.router_port(r);
p.scheduler_port(s);
m1.init_port(r.target_port);
m4.init_port(r.target_port);
m2.init_port(r.target_port);
m5.init_port(r.target_port);
m3.init_port(r.target_port);
r.init_port(s1.target_port);
r.init_port(s3.target_port);
r.init_port(s2.target_port);
r.init_port(s4.target_port);
#ifdef USE_DUST
model_builder xml(true);
#endif
sc_start(1, SC_MS);
cout<<"DONE"<<endl<<flush;
return 0;
}
See more files for this project here