radec/src/Simulation.h

37 lines
645 B
C
Raw Permalink Normal View History

#ifndef SIMULATION
#define SIMULATION
2017-04-23 20:15:12 -04:00
#include "Wire.h"
#include "Event.h"
#include "Gate.h"
#include "AndGate.h"
#include "NandGate.h"
#include "OrGate.h"
#include "NorGate.h"
#include "XnorGate.h"
#include "XorGate.h"
#include "NotGate.h"
#include <string>
#include <vector>
#include <fstream>
#include <iostream>
using namespace std;
class Simulation {
public:
bool parseCircuit(string fileName);
2017-04-23 20:15:12 -04:00
bool parseVector(string fileName);
2017-04-25 20:51:41 -04:00
void simulate(int);
void print(int);
private:
Wire* findWire(int n);
int getDelay(string d);
priority_queue<Event> e;
vector<Gate*> gates;
vector<Wire*> wires;
};
#endif // !SIMULATION