forked from cdkersey/chdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsim.h
29 lines (22 loc) · 770 Bytes
/
sim.h
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
#ifndef __SIM_H
#define __SIM_H
#include <iostream>
#include <functional>
#include <vector>
#include "tickable.h"
#include "tap.h"
#include "cdomain.h"
namespace chdl {
typedef unsigned long long cycle_t;
extern std::vector<cycle_t> now;
cycle_t sim_time(cdomain_handle_t cd = 0);
void print_time(std::ostream&);
cycle_t advance(unsigned threads=1, cdomain_handle_t cd = 0);
void run(std::ostream &vcdout, bool &stop, unsigned threads = 1);
void run(std::ostream &vcdout, bool &stop, cycle_t max, unsigned threads = 1);
void run(std::ostream &vcdout, cycle_t time, unsigned threads = 1);
void run(std::ostream &vcdout, std::function<bool()> end, unsigned threads=1);
void finally(std::function<void()> f);
void call_final_funcs();
};
#endif