2017-04-20 12:41:43 -04:00
|
|
|
#ifndef SIMULATION
|
|
|
|
#define SIMULATION
|
|
|
|
|
|
|
|
#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:
|
2017-04-20 13:01:04 -04:00
|
|
|
bool parseCircuit(string fileName);
|
2017-04-20 12:41:43 -04:00
|
|
|
void simulate();
|
|
|
|
void print();
|
|
|
|
private:
|
2017-04-20 13:01:04 -04:00
|
|
|
wire* findWire(int n);
|
|
|
|
int getDelay(string d);
|
|
|
|
|
2017-04-20 12:41:43 -04:00
|
|
|
priority_queue<event> e;
|
|
|
|
vector<gate*> gates;
|
|
|
|
vector<wire*> wires;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // !SIMULATION
|