File tree 2 files changed +9
-8
lines changed
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -68,9 +68,14 @@ export default class ControlledInverter extends CircuitElement {
68
68
( 32 - this . bitWidth )
69
69
simulationArea . simulationQueue . add ( this . output1 )
70
70
}
71
- if ( this . state . value === 0 ) {
72
- this . output1 . value = undefined
71
+ else if (
72
+ this . output1 . value !== undefined &&
73
+ ! simulationArea . contentionPending . has ( this . output1 )
74
+ ) {
75
+ this . output1 . value = undefined ;
76
+ simulationArea . simulationQueue . add ( this . output1 ) ;
73
77
}
78
+ simulationArea . contentionPending . removeAllContentionsForNode ( this . output1 ) ;
74
79
}
75
80
76
81
/**
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ export default class Node {
396
396
this . parent . isResolvable ( ) &&
397
397
! this . parent . queueProperties . inQueue
398
398
) {
399
- if ( this . parent . objectType == 'TriState' ) {
399
+ if ( this . parent . objectType == 'TriState' || this . parent . objectType == 'ControlledInverter' ) {
400
400
if ( this . parent . state . value ) {
401
401
simulationArea . simulationQueue . add ( this . parent )
402
402
}
@@ -435,11 +435,7 @@ export default class Node {
435
435
`Contention Error: ${ this . value } and ${ node . value } at ${ circuitElementName } in ${ circuitName } `
436
436
)
437
437
} else if ( node . bitWidth == this . bitWidth || node . type == 2 ) {
438
- if (
439
- node . parent . objectType == 'TriState' &&
440
- node . value != undefined &&
441
- node . type == 1
442
- ) {
438
+ if ( ( node . parent . objectType == 'TriState' || node . parent . objectType == 'ControlledInverter' ) && node . value != undefined ) {
443
439
if ( node . parent . state . value ) {
444
440
simulationArea . contentionPending . push ( node . parent )
445
441
}
You can’t perform that action at this time.
0 commit comments