-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsim.h
More file actions
42 lines (35 loc) · 1.05 KB
/
Copy pathsim.h
File metadata and controls
42 lines (35 loc) · 1.05 KB
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
#ifndef SIM_H
#define SIM_H
#include "event.h"
#include "router.h"
#include <vector>
#include <memory>
void fatal(const char *fmt, ...);
typedef struct ChannelMap {
int key;
Channel *value;
} ChannelMap;
typedef struct Sim {
Sim(bool verbose_mode, int debug_mode, Topology top, int terminal_count,
int router_count, int radix, int vc_count, double mean_interval,
long input_buf_size);
EventQueue eventq; // global event queue
Stat stat;
int debug_mode;
Topology topology;
TrafficDesc traffic_desc;
RandomGenerator rand_gen;
long input_buf_size; // router input buffer size
long channel_delay;
long packet_len; // length of a packet in flits
ChannelMap *channel_map;
std::vector<Channel> channels;
std::vector<std::unique_ptr<Router>> routers;
std::vector<std::unique_ptr<Router>> src_nodes;
std::vector<std::unique_ptr<Router>> dst_nodes;
} Sim;
void sim_run(Sim *sim, long until);
void sim_process(Sim *sim, Event e);
void sim_report(Sim *sim);
void sim_destroy(Sim *sim);
#endif