-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathprintable.h
38 lines (27 loc) · 888 Bytes
/
printable.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
30
31
32
33
34
35
36
37
38
// Node implementation.
#ifndef CHDL_PRINTABLE_H
#define CHDL_PRINTABLE_H
#include <vector>
#include <set>
#include <iostream>
namespace chdl {
enum print_lang {
PRINT_LANG_NETLIST = 0,
PRINT_LANG_VERILOG = 1
};
typedef int print_phase;
struct printable;
std::set<printable*> &printables();
struct printable {
printable() { printables().insert(this); }
~printable() { printables().erase(this); }
static void register_print_phase(print_lang l, print_phase p);
virtual bool is_initial(print_lang l, print_phase p) = 0;
virtual void predecessors(print_lang, print_phase, std::set<printable *> &)
= 0;
virtual void print(std::ostream &out, print_lang l, print_phase p) = 0;
};
static void get_initial(print_lang l, print_phase p, std::set<printable*> &s);
void print_design(std::ostream &out, print_lang l);
}
#endif