OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_c/] [synfull/] [traffic-generator/] [src/] [TgenMain.cpp] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 alirezamon
/*
2
Copyright (c) 2014, Mario Badr
3
All rights reserved.
4
 
5
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
 
7
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
 
9
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
 
11
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12
*/
13
/*
14
 * main.cpp
15
 *
16
 *  Created on: Jan 7, 2013
17
 *      Author: mario
18
 */
19
 
20
#include <iostream>
21
#include <fstream>
22
#include <stdio.h>
23
 
24
#include "Global.h"
25
#include "ModelRead.h"
26
#include "TrafficGenerator.h"
27
 
28
using namespace std;
29
 
30
int main(int argc, char **argv) {
31
        if(argc != 5) {
32
                cerr << "Need 4 parameters: model file, number of cycles, exit at "
33
                                "steady state, number of packets" << endl;
34
                return -1;
35
        }
36
 
37
        ifstream modelFile(argv[1]);
38
        if(!modelFile.good()) {
39
                cerr << "Could not open file " << argv[1] << endl;
40
                return -1;
41
        }
42
 
43
        //Parses the file and stores all information in global variables
44
        ReadModel(modelFile);
45
 
46
        //Close the file stream
47
        modelFile.close();
48
 
49
        //The number of cycles to simulate for
50
        unsigned int numCycles = (int) strtoul(argv[2], NULL, 0);
51
 
52
        //Whether or not we should exit the simulation prematurely when steady
53
        //state is reached
54
        bool ssExit = ((int) strtoul(argv[3], NULL, 0)) == 1;
55
 
56
        //The number of packets to be injected
57
        unsigned int numPackets = (int) strtoul(argv[4], NULL, 0);
58
 
59
    //Run the traffic generator
60
        Run(numCycles, ssExit, numPackets);
61
 
62
        return 0;
63
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.