diff options
-rw-r--r-- | GateAnd.cpp | 2 | ||||
-rw-r--r-- | GateAnd.h | 5 | ||||
-rw-r--r-- | Node.cpp | 2 | ||||
-rw-r--r-- | Node.h | 2 | ||||
-rw-r--r-- | NodeInput.cpp | 6 | ||||
-rw-r--r-- | NodeInput.h | 2 | ||||
-rw-r--r-- | NodeOutput.cpp | 6 | ||||
-rw-r--r-- | NodeOutput.h | 2 |
8 files changed, 16 insertions, 11 deletions
diff --git a/GateAnd.cpp b/GateAnd.cpp index 6f19d61..93edacb 100644 --- a/GateAnd.cpp +++ b/GateAnd.cpp @@ -4,7 +4,7 @@ GateAnd GateAnd::instance(GateAnd::type); GateAnd::GateAnd(const char * type) : Node(type) { } -void GateAnd::compare() { +void GateAnd::sim() { SignalLevel new_out = HIGH; // TODO: fix segfault somewhere below for (int i = 0; i < this->inputs.size(); i++){ @@ -4,9 +4,10 @@ class GateAnd : public Node { public: + GateAnd() = default; GateAnd(const GateAnd * prototype); - virtual ~GateAnd() = default; - virtual void compare(); + ~GateAnd() = default; + virtual void sim(); virtual GateAnd * clone() const; private: @@ -18,6 +18,6 @@ void Node::setOutput(Net * net){ void Node::update(){ std::cout << "updated" << std::endl; - this->compare(); + this->sim(); } @@ -19,7 +19,7 @@ public: void update(); virtual void addInput(Net *); virtual void setOutput(Net *); - virtual void compare() = 0; + virtual void sim() = 0; int gert = 45; protected: diff --git a/NodeInput.cpp b/NodeInput.cpp index 046cd72..17f9ed5 100644 --- a/NodeInput.cpp +++ b/NodeInput.cpp @@ -1,10 +1,12 @@ #include "NodeInput.h" +#include <iostream> + NodeInput::NodeInput(const char * type) : Node(type) { } -void NodeInput::compare() { +void NodeInput::sim() { if (this->output == nullptr) return; - + std::cout << this->level << " bar\n"; this->output->setLevel(this->level); } diff --git a/NodeInput.h b/NodeInput.h index 73ef6e1..bcca8f4 100644 --- a/NodeInput.h +++ b/NodeInput.h @@ -7,7 +7,7 @@ public: NodeInput() = default; NodeInput(const NodeInput * prototype); ~NodeInput() = default; - virtual void compare(); + virtual void sim(); virtual NodeInput * clone() const; private: diff --git a/NodeOutput.cpp b/NodeOutput.cpp index cff66c0..d47b6a3 100644 --- a/NodeOutput.cpp +++ b/NodeOutput.cpp @@ -5,9 +5,11 @@ NodeOutput NodeOutput::instance(NodeOutput::type); NodeOutput::NodeOutput(const char * type) : Node(type) { } -void NodeOutput::compare() { +void NodeOutput::sim() { if (this->inputs.size() > 0) { - std::cout << this->inputs[0]->getLevel() << std::endl; + std::cout << this->inputs[0]->getLevel() << "foo" << std::endl; + } else { + std::cout << "err: No inputs on probe" << std::endl; } } diff --git a/NodeOutput.h b/NodeOutput.h index 4e7f742..2e92bf0 100644 --- a/NodeOutput.h +++ b/NodeOutput.h @@ -6,7 +6,7 @@ class NodeOutput : public Node { public: NodeOutput(const NodeOutput * prototype); ~NodeOutput() = default; - virtual void compare(); + virtual void sim(); virtual NodeOutput * clone() const; private: |