From a75cd9ee0471258cc03f2a75c49f60ee733e25da Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sun, 23 Apr 2017 20:32:31 -0400 Subject: [PATCH 1/4] actually update readme --- readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/readme.md b/readme.md index 2d5f839..ceaba4d 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,8 @@ # RADEC # TODO +* implement printing +* debug: circuit parsing +* debug: vector parsing +* debug: simulation +* debug: printing From 1431660328b27f0059f6dcab6bd65080680200af Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sun, 23 Apr 2017 20:37:16 -0400 Subject: [PATCH 2/4] rewrite Radec.cpp --- src/Radec.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/Radec.cpp diff --git a/src/Radec.cpp b/src/Radec.cpp new file mode 100644 index 0000000..0a73a41 --- /dev/null +++ b/src/Radec.cpp @@ -0,0 +1,28 @@ +#include "Simulation.h" + +using namespace std; + +int main() { + // 1. Parse circuit file to create in-memory data structure of Gates and Wires + // to simulate + string fileName; + Simulation e; + + getline(in, fileName); + e.parseCircuit(fileName); + + // 2. Parse the vector file to initialize the simulation Queue with initial + // Wire state (i.e., value) changes + e.parseVector(fileName); + + // 3. Simulate the circuit using Event-driven control + // first, remove the top Event e in the Queue + // second, determine if e causes a future Wire state change + // third, create and queue any future Wire state changes as new Events + // fourth, apply e's effects + e.simulate(); + + // 4. Print the results of the simulation + e.print(); + } +} From 2a697fecbf88cc82ed95f5a744b2b913a27d2323 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sun, 23 Apr 2017 20:39:39 -0400 Subject: [PATCH 3/4] remove unneeded constructor --- src/Gate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/Gate.cpp diff --git a/src/Gate.cpp b/src/Gate.cpp new file mode 100644 index 0000000..dca2bca --- /dev/null +++ b/src/Gate.cpp @@ -0,0 +1,6 @@ +#include "Gate.h" + +void Gate::setOut(int newValue, int setTime) +{ + out->setValue(newValue, setTime); +} From dd7fb5120010733ea32789a2c5524fd3865d2061 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Sun, 23 Apr 2017 20:40:16 -0400 Subject: [PATCH 4/4] fix bracket error --- src/Radec.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Radec.cpp b/src/Radec.cpp index 0a73a41..c271844 100644 --- a/src/Radec.cpp +++ b/src/Radec.cpp @@ -8,7 +8,7 @@ int main() { string fileName; Simulation e; - getline(in, fileName); + getline(cin, fileName); e.parseCircuit(fileName); // 2. Parse the vector file to initialize the simulation Queue with initial @@ -24,5 +24,4 @@ int main() { // 4. Print the results of the simulation e.print(); - } }