ACEC/circuit.h

26 lines
491 B
C
Raw Normal View History

2022-10-23 15:29:41 +08:00
#pragma once
#include "bits/stdc++.h"
enum GateType {
XOR, MAJ, AND, OR
};
2022-10-23 16:14:11 +08:00
struct CircuitGate {
GateType type;
2022-10-23 15:29:41 +08:00
std::vector<int> inputs;
std::vector<int> output;
std::vector<int> fanouts;
2022-10-23 16:14:11 +08:00
int topo_index;
2022-10-23 15:29:41 +08:00
};
2022-10-23 16:14:11 +08:00
extern const char* GateName[4];
extern CircuitGate* Gates;
2022-10-23 15:29:41 +08:00
extern std::vector<int> circuit_inputs;
extern int circuit_output;
2022-10-23 16:14:11 +08:00
void read_verilog_from_file(const char *);
void print_circuit_structure();
void recalulate_fanouts();
void calulate_topo_index();