bus_dmi.cpp revision 12855:588919e0e4aa
1/*****************************************************************************
2
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements.  See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License.  You may obtain a copy of the License at
9
10    http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied.  See the License for the specific language governing
16  permissions and limitations under the License.
17
18 *****************************************************************************/
19#define SC_INCLUDE_DYNAMIC_PROCESSES
20#include "tlm.h"
21
22#include "SimpleLTInitiator1_DMI.h"
23#include "SimpleLTTarget1.h"
24#include "SimpleLTInitiator2_DMI.h"
25#include "SimpleLTTarget2.h"
26#include "SimpleLTInitiator3_DMI.h"
27#include "SimpleATInitiator1.h"
28#include "SimpleATTarget1.h"
29#include "SimpleATInitiator2.h"
30#include "SimpleATTarget2.h"
31#include "CoreDecouplingLTInitiator.h"
32#include "ExplicitLTTarget.h"
33#include "ExplicitATTarget.h"
34#include "SimpleBusLT.h"
35
36int sc_main(int argc, char* argv[])
37{
38  SimpleLTInitiator1_dmi initiator1("initiator1", 10, 0x00000000);
39  SimpleLTTarget1 target1("target1");
40
41  SimpleLTInitiator2_dmi initiator2("initiator2", 10, 0x10000000);
42  SimpleLTTarget2 target2("target2");
43
44  SimpleLTInitiator3_dmi initiator3("initiator3", 10, 0x20000000);
45  SimpleLTTarget2 target3("target3");
46
47  SimpleATInitiator1 initiator4("initiator4", 10, 0x30000000);
48  SimpleATTarget1 target4("target4");
49
50  SimpleATInitiator2 initiator5("initiator5", 10, 0x40000000);
51  SimpleATTarget2 target5("target5");
52
53  CoreDecouplingLTInitiator initiator6("initiator6", 10, 0x50000000);
54  ExplicitLTTarget target6("target6");
55
56  CoreDecouplingLTInitiator initiator7("initiator7", 10, 0x60000000);
57  ExplicitATTarget target7("target7");
58
59  SimpleBusLT<7, 7> bus("bus");
60
61  initiator1.socket(bus.target_socket[0]);
62  initiator2.socket(bus.target_socket[1]);
63  initiator3.socket(bus.target_socket[2]);
64  initiator4.socket(bus.target_socket[3]);
65  initiator5.socket(bus.target_socket[4]);
66  initiator6.socket(bus.target_socket[5]);
67  initiator7.socket(bus.target_socket[6]);
68  bus.initiator_socket[0](target1.socket);
69  bus.initiator_socket[1](target2.socket);
70  bus.initiator_socket[2](target3.socket);
71  bus.initiator_socket[3](target4.socket);
72  bus.initiator_socket[4](target5.socket);
73  bus.initiator_socket[5](target6.socket);
74  bus.initiator_socket[6](target7.socket);
75
76  sc_core::sc_start();
77  sc_core::sc_stop();
78
79  return 0;
80}
81