-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
executable file
·97 lines (82 loc) · 3.07 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
*
* Author: Tatiana Djaba Nya (Lead author)
* Author: Stephan C. Stilkerich
*
* Reference Architecture Model (EPiCS FP7 FET program, No. 257906)
* - Peter R. Lewis, University of Birmingham
* - Xin Yao, University of Birmingham
*
* Copyright (c) 2013, EADS Deutschland GmbH, EADS Innovation Works
*
*==============================================================================
*
*This file is part of ProprioSimEnv.
*
* ProprioSimEnv 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 3 of the License, or
* (at your option) any later version.
*
* ProprioSimEnv 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 ProprioSimEnv. If not, see <http://www.gnu.org/licenses/>.
*/
#define SC_INCLUDE_DYNAMIC_PROCESSES
#include <iomanip>
#include <stdio.h>
#include <time.h>
#include <math.h>
#include <vector>
#include "lt_top_one.h"
#include "stimulus.h"
#include "key_functions.h"
using namespace std;
static const char *filename = "main.cpp"; ///< filename for reporting
//======================================================================
/// @fn main
//
/// @brief This is the entry point of the model.
//
/// @details It should contain the nodes instantiation and bindings operations
/// among them. We recommend to do these in an extra module and
/// just instantiate this object here as shown in the commented code
//
//======================================================================
int sc_main(int argc, char *argv[]){
// current system time
std::time_t t;
time(&t);
std::cout<< "CURRENT DATE AND TIME: " << ctime(&t) << endl;
//variable for the report messsage
std::ostringstream msg;
//simulation_start
msg.str("");
msg << __FUNCTION__ << endl
<< setfill('*') << setw(80) << " " << endl
<< setfill(' ') << setw(31) << "SIMULATION: START "<<endl
<< setfill('*') << setw(80) << " ";
SC_REPORT_INFO( filename, msg.str().c_str() );
//****** Programm Start: Example *****///
// sc_core::sc_time global_quantum = sc_core::sc_time(2, node_time_unit);
// sc_core::sc_time simulation_time = sc_core::sc_time(14000, node_time_unit);
//Sim TOP("SYSTEM", global_quantum, simulation_time);
//sc_core::sc_start();
//****** INSTANTIATION*****///
msg.str("");
msg << __FUNCTION__ << endl
<< setfill('*') << setw(80) << " " << endl
<< setfill(' ') << setw(32) << "SIMULATION: END "<<endl
<< setfill('*') << setw(80) << " ";
SC_REPORT_INFO(filename, msg.str().c_str());
//delta cycles
std::cout << "NUMBER OF DELTA CYCLES: "<< sc_core::sc_delta_count() << endl;
// current system time
time(&t);
std::cout<< "CURRENT DATE AND TIME: " << ctime(&t);
return 0;
}