ACEC/circuit.h

26 lines
491 B
C++

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