-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmap.h
55 lines (36 loc) · 2.32 KB
/
map.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef MAP_H
#define MAP_H
#include "transistor.h"
#include <vector>
using namespace std;
//------------------------- CLI -------------------------------------------
void print_logo();
void print_transistor(Transistor& t1);
//------------------------- Pin Related -----------------------------------
vector<string> fetch_common_nets(vector<Transistor>& PDN, vector<Transistor>& PUN);
vector<string> remove_pin(vector<string> pin_list, string pin);
void distribute_pins(vector<string>& common_nets, vector<string>& in_pins, vector<string>& out_pins);
//-------------------------Checks------------------------------------------
bool check_parallel(Transistor& A, Transistor& B);
bool check_common_net(Transistor& T0, string& common_net);
bool check_pg_pin(string pin, vector<string> power_pins, vector<string> ground_pins);
bool check_series(Transistor& A, Transistor& B, vector<string> power_pins, vector<string> ground_pins);
//------------------------- Flattening ------------------------------------
//-- find and merge parallel
Transistor merge_parallel(Transistor& A, Transistor& B);
vector<Transistor> collapse_parallel(int circuit_columns, vector<Transistor>& transistor_network);
//-- find and merge parallel
Transistor merge_series(Transistor& A, Transistor& B, vector<string>& power_pins, vector<string>& ground_pins);
vector<Transistor> collapse_series(int circuit_columns, vector<Transistor>& transistor_network, vector<string>& power_pins, vector<string>& ground_pins);
// find the expression.
vector<string> find_expression(int circuit_columns, vector<string> common_nets, vector<Transistor> transistor_network, vector<string>& power_pins, vector<string>& ground_pins);
string flatten_expression(vector<string> common_nets, vector<string> expressions);
//------------------------- Boolean Solver --------------------------------
int solve_boolean_expression(string expression);
// ------------------------- Truth Table ---------------------------------
vector<string> truth_table(vector<string> in_pins, string expression);
// ------------------------- Finding ARCS ---------------------------------
vector<string> find_arcs(vector<string> in_pins, string expression);
// ------------------------- Misc ---------------------------------
void replace_all(std::string& s, std::string const& toReplace, std::string const& replaceWith);
#endif