-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not check contention on downstream values #4903
base: master
Are you sure you want to change the base?
Conversation
We define an output node value to be upstream if it is given to it by its parent element. All other values are downstream values. In the case that a node gives an output node value (while the parent does not drive the output value. e.g. Tristate with control bit 0), and then the same node gives another value to the output node, earlier it would cause contention since the output node is said to [before the propagation from the other node] still have the former value. This is a downstream value and post this commit will be overwritten. Contention will only be checked at upstream valued output nodes.
@@ -103,6 +103,8 @@ export default class AndGate extends CircuitElement { | |||
result &= this.inp[i].value || 0; | |||
this.output1.value = result >>> 0; | |||
simulationArea.simulationQueue.add(this.output1); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed.
@@ -82,6 +82,8 @@ export default class Buffer extends CircuitElement { | |||
|
|||
this.output1.value = this.state; | |||
simulationArea.simulationQueue.add(this.output1); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed.
} | ||
|
||
/** | ||
* @memberof ConstantVal | ||
* updates state using a prompt when dbl clicked | ||
*/ | ||
dblclick() { | ||
this.state = prompt("Re enter the value") || "0"; | ||
const state_ = prompt("Re enter the value") || "0"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected dangling '' in 'state'.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 'this' to be used by class method 'isValidState'.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { | ||
for (const c of state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { | ||
for (const c of state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected { after 'for-of'.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { | ||
for (const c of state) | ||
if (c != "0" && c != "1") return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected no linebreak before this statement.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { | ||
for (const c of state) | ||
if (c != "0" && c != "1") return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '!==' and instead saw '!='.
this.newBitWidth(this.state.toString().length); | ||
} | ||
|
||
isValidState(state) { | ||
for (const c of state) | ||
if (c != "0" && c != "1") return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected '!==' and instead saw '!='.
@@ -232,6 +232,8 @@ export default class RGBLedMatrix extends CircuitElement { | |||
colors[rowNodeValue][columnNodeValue] = colorValue; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed.
Code Climate has analyzed commit 6c369c0 and detected 25 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
We define an output node value to be upstream if it is given to it by its parent element. All other values are downstream values.
In the case that a node gives an output node value (while the parent does not drive the output value. e.g. Tristate with control bit 0), and then the same node gives another value to the output node, earlier it would cause contention since the output node is said to [before the propagation from the other node] still have the former value.
This is a downstream value and post this commit will be overwritten. Contention will only be checked at upstream valued output nodes.