SILICON
Loading...
Searching...
No Matches
logic.cpp File Reference
#include "tests.hpp"
#include <core/circuit.hpp>
#include <core/flipflops.hpp>
#include <core/io.hpp>
#include <core/simulator.hpp>
#include <functional>
#include <limits>
#include <string>
#include <tuple>
#include <utility>
Include dependency graph for logic.cpp:

Go to the source code of this file.

Functions

 TEST (SimulatorTest, CyclicComponentsReadOneSnapshotPerDeltaCycle)
 TEST (SimulatorTest, IndependentCyclicStepsKeepSeparateStagingBuffers)
 TEST (SimulatorTest, CancelledCyclicPassDiscardsStagedWrites)
 TEST (SimulatorTest, CyclicConflictingDriversLeaveWireInError)
 TEST (SimulatorTest, RepeatedCyclicWritesByOneSourceKeepItsLastValue)
 TEST (SimulatorTest, PositiveDelayInsideSccUsesEventQueue)
 TEST (ConstantComponentTest, DrivesAndResizesBinaryBusValue)
 TEST (DummyBusInputComponentTest, ResizesValuesWithoutIntegerConversion)
 TEST (BusValueArithmeticTest, AddsKnownAndFourStateValues)
 TEST (BusValueArithmeticTest, TwosComplementUsesFourStateOperators)
 TEST (BusValueArithmeticTest, DivisionPreservesOperandWidths)
 TEST (BusValueArithmeticTest, DivisionSupportsArbitraryPrecision)
 TEST (BusValueArithmeticTest, DivisionPropagatesErrorBeforeUnknown)
 TEST (BusValueArithmeticTest, DivisionRejectsEmptyOperandsAndZeroDivisors)
 TEST (LogicTest, And)
 TEST (SimulatorTest, CancelledRunCanResumePendingEvents)
 TEST (SimulatorTest, CancellationStopsBusPropagation)
 TEST (SimulatorTest, PassesSimulationContextToComponents)
 TEST (SimulatorTest, DelayedEventBatchCapturesPreviousStateBeforeApplyingEvents)
 TEST (SimulatorTest, SimulatesInternalInputWaveform)
 TEST (SimulatorTest, WaveformInputSampleCapturesPreviousWireStates)
 TEST (SimulatorTest, WaveformDoesNotPropagateWhenNormalizedValueIsUnchanged)
 TEST (SimulatorTest, UpdateBusRequiresExactWidthForImmediateAndDelayedValues)
 TEST (SimulatorTest, DelayedGateRejectsShortInputPulse)
 TEST (SimulatorTest, DelayedGateReplacesPendingTransition)
 TEST (SimulatorTest, DelayedGateReevaluationDoesNotPostponePendingTransition)
 TEST (SimulatorTest, ForwardPropagationDoesNotRescheduleIndependentDelayedBranch)
 TEST (SimulatorTest, RunUntilIdlePropagatesThroughLongDelayChain)
 TEST (SimulatorTest, RunUntilIdleStopsAtStepLimitForDelayedFeedback)
 TEST (FlipFlopTest, DFlipFlopCapturesOnPositiveEdge)
 TEST (FlipFlopTest, DFlipFlopCapturesOnNegativeEdge)
 TEST (FlipFlopTest, EFlipFlopHonorsEnable)
 TEST (FlipFlopTest, DLatchIsTransparentWhileEnabledAndHoldsWhileDisabled)
 TEST (FlipFlopTest, DLatchUnknownEnableInvalidatesStoredState)
 TEST (FlipFlopTest, DLatchPropagationDelayDefersTransparentUpdates)
 TEST (FlipFlopTest, JKFlipFlopImplementsTruthTable)
 TEST (FlipFlopTest, AsyncClearAndPresetOverrideInputs)
 TEST (FlipFlopTest, UnconnectedAsyncControlsDefaultInactive)
 TEST (FlipFlopTest, UnconnectedAsyncControlsRemainInactiveAfterClearingWires)
 TEST (FlipFlopTest, UnknownDataCapturesAsUnknown)
 TEST (FlipFlopTest, ZeroPropagationDelayUpdatesImmediately)
 TEST (FlipFlopTest, ZeroDelayChainCapturesFromPreEdgeSnapshot)
 TEST (FlipFlopTest, ZeroDelayChainSamplesPreEdgeCombinationalValue)
 TEST (FlipFlopTest, DefaultPropagationDelayDefersOutputUpdates)
 TEST (FlipFlopTest, SetupViolationCapturesUnknown)
 TEST (FlipFlopTest, HoldViolationInvalidatesLatchedState)
 TEST (FlipFlopTest, EnabledFlipFlopAppliesSetupTimeToEnable)
 TEST (FlipFlopTest, JKFlipFlopAppliesHoldTimeToInputs)
 TEST (FlipFlopTest, TimingPropertiesAreValidated)
 TEST (SimulatorTest, InteractiveSettlingKeepsWaveformChangesAtDistinctTimes)
 TEST (SimulatorTest, WaveformAppliesSameTimestampInputsTogether)
 TEST (LogicTest, Nand)
 TEST (LogicTest, Or)
 TEST (LogicTest, Nor)
 TEST (LogicTest, Xor)
 TEST (LogicTest, CircuitEditing1)
 TEST (LogicTest, CircuitEditing2)
 TEST (LogicTest, TopologyEditUsesNewSimulator)
 TEST (LogicTest, BusSettingReading)
 TEST (LogicTest, BusSettingReadingAtUnsignedIntWidth)
 TEST (LogicTest, BusAssignmentsNormalizeWidthAndReportMeaningfulOverflow)
 TEST (LogicTest, DisconnectedBusStateQueriesDoNotDereferenceNullWires)
 TEST (LogicTest, GateBitwiseDefaultsAndValidation)
 TEST (LogicTest, GateBitwiseReshapesIO)
 TEST (LogicTest, ReductionGatesMatchSeparateScalarInputs)
 TEST (LogicTest, AndBitwiseSimulation)
 TEST (LogicTest, OrBitwiseSimulation)
 TEST (LogicTest, NandBitwiseSimulation)
 TEST (LogicTest, NorBitwiseSimulation)
 TEST (LogicTest, XorBitwiseSimulationPreservesUnknownAndErrorPerBit)
 TEST (LogicTest, NotGateSimulatesVectorAndLogicalInputs)
 TEST (ComponentTest, SetAndGetIntProperty)
 TEST (ComponentTest, UnconnectedInputMayDeclareDefaultState)
 TEST (ComponentTest, SetAndGetIntPropertyTemplated)
 TEST (ComponentTest, SetAndGetBoolProperty)
 TEST (ComponentTest, SetAndGetStringProperty)
 TEST (ComponentTest, SetAndGetBusValueProperty)
 TEST (ComponentTest, SetAndGetStringListProperty)
 TEST (ComponentTest, StringListPropertyRejectsInvalidValues)
 TEST (ComponentTest, StringListPropertyRejectsInvalidDefault)
 TEST (ComponentTest, StringListPropertyRejectsInvalidCallbackResult)
 TEST (ComponentTest, GetPropertyNotFound)
 TEST (ComponentTest, SetPropertyTypeMismatch)
 TEST (ComponentTest, SetPropertyUndefined)
 TEST (ComponentTest, GetProperties)

Function Documentation

◆ TEST() [1/85]

TEST ( BusValueArithmeticTest ,
AddsKnownAndFourStateValues  )

Definition at line 362 of file logic.cpp.

◆ TEST() [2/85]

TEST ( BusValueArithmeticTest ,
DivisionPreservesOperandWidths  )

Definition at line 383 of file logic.cpp.

◆ TEST() [3/85]

TEST ( BusValueArithmeticTest ,
DivisionPropagatesErrorBeforeUnknown  )

Definition at line 415 of file logic.cpp.

◆ TEST() [4/85]

TEST ( BusValueArithmeticTest ,
DivisionRejectsEmptyOperandsAndZeroDivisors  )

Definition at line 429 of file logic.cpp.

◆ TEST() [5/85]

TEST ( BusValueArithmeticTest ,
DivisionSupportsArbitraryPrecision  )

Definition at line 402 of file logic.cpp.

◆ TEST() [6/85]

TEST ( BusValueArithmeticTest ,
TwosComplementUsesFourStateOperators  )

Definition at line 374 of file logic.cpp.

◆ TEST() [7/85]

TEST ( ComponentTest ,
GetProperties  )

Definition at line 2243 of file logic.cpp.

◆ TEST() [8/85]

TEST ( ComponentTest ,
GetPropertyNotFound  )

Definition at line 2203 of file logic.cpp.

◆ TEST() [9/85]

TEST ( ComponentTest ,
SetAndGetBoolProperty  )

Definition at line 2104 of file logic.cpp.

◆ TEST() [10/85]

TEST ( ComponentTest ,
SetAndGetBusValueProperty  )

Definition at line 2145 of file logic.cpp.

◆ TEST() [11/85]

TEST ( ComponentTest ,
SetAndGetIntProperty  )

Definition at line 2055 of file logic.cpp.

◆ TEST() [12/85]

TEST ( ComponentTest ,
SetAndGetIntPropertyTemplated  )

Definition at line 2085 of file logic.cpp.

◆ TEST() [13/85]

TEST ( ComponentTest ,
SetAndGetStringListProperty  )

Definition at line 2161 of file logic.cpp.

◆ TEST() [14/85]

TEST ( ComponentTest ,
SetAndGetStringProperty  )

Definition at line 2123 of file logic.cpp.

◆ TEST() [15/85]

TEST ( ComponentTest ,
SetPropertyTypeMismatch  )

Definition at line 2217 of file logic.cpp.

◆ TEST() [16/85]

TEST ( ComponentTest ,
SetPropertyUndefined  )

Definition at line 2230 of file logic.cpp.

◆ TEST() [17/85]

TEST ( ComponentTest ,
StringListPropertyRejectsInvalidCallbackResult  )

Definition at line 2192 of file logic.cpp.

◆ TEST() [18/85]

TEST ( ComponentTest ,
StringListPropertyRejectsInvalidDefault  )

Definition at line 2186 of file logic.cpp.

◆ TEST() [19/85]

TEST ( ComponentTest ,
StringListPropertyRejectsInvalidValues  )

Definition at line 2177 of file logic.cpp.

◆ TEST() [20/85]

TEST ( ComponentTest ,
UnconnectedInputMayDeclareDefaultState  )

Definition at line 2074 of file logic.cpp.

◆ TEST() [21/85]

TEST ( ConstantComponentTest ,
DrivesAndResizesBinaryBusValue  )

Definition at line 330 of file logic.cpp.

◆ TEST() [22/85]

TEST ( DummyBusInputComponentTest ,
ResizesValuesWithoutIntegerConversion  )

Definition at line 349 of file logic.cpp.

◆ TEST() [23/85]

TEST ( FlipFlopTest ,
AsyncClearAndPresetOverrideInputs  )

Definition at line 1087 of file logic.cpp.

◆ TEST() [24/85]

TEST ( FlipFlopTest ,
DefaultPropagationDelayDefersOutputUpdates  )

Definition at line 1304 of file logic.cpp.

◆ TEST() [25/85]

TEST ( FlipFlopTest ,
DFlipFlopCapturesOnNegativeEdge  )

Definition at line 870 of file logic.cpp.

◆ TEST() [26/85]

TEST ( FlipFlopTest ,
DFlipFlopCapturesOnPositiveEdge  )

Definition at line 832 of file logic.cpp.

◆ TEST() [27/85]

TEST ( FlipFlopTest ,
DLatchIsTransparentWhileEnabledAndHoldsWhileDisabled  )

Definition at line 945 of file logic.cpp.

◆ TEST() [28/85]

TEST ( FlipFlopTest ,
DLatchPropagationDelayDefersTransparentUpdates  )

Definition at line 1004 of file logic.cpp.

◆ TEST() [29/85]

TEST ( FlipFlopTest ,
DLatchUnknownEnableInvalidatesStoredState  )

Definition at line 981 of file logic.cpp.

◆ TEST() [30/85]

TEST ( FlipFlopTest ,
EFlipFlopHonorsEnable  )

Definition at line 905 of file logic.cpp.

◆ TEST() [31/85]

TEST ( FlipFlopTest ,
EnabledFlipFlopAppliesSetupTimeToEnable  )

Definition at line 1394 of file logic.cpp.

◆ TEST() [32/85]

TEST ( FlipFlopTest ,
HoldViolationInvalidatesLatchedState  )

Definition at line 1366 of file logic.cpp.

◆ TEST() [33/85]

TEST ( FlipFlopTest ,
JKFlipFlopAppliesHoldTimeToInputs  )

Definition at line 1428 of file logic.cpp.

◆ TEST() [34/85]

TEST ( FlipFlopTest ,
JKFlipFlopImplementsTruthTable  )

Definition at line 1028 of file logic.cpp.

◆ TEST() [35/85]

TEST ( FlipFlopTest ,
SetupViolationCapturesUnknown  )

Definition at line 1333 of file logic.cpp.

◆ TEST() [36/85]

TEST ( FlipFlopTest ,
TimingPropertiesAreValidated  )

Definition at line 1457 of file logic.cpp.

◆ TEST() [37/85]

TEST ( FlipFlopTest ,
UnconnectedAsyncControlsDefaultInactive  )

Definition at line 1120 of file logic.cpp.

◆ TEST() [38/85]

TEST ( FlipFlopTest ,
UnconnectedAsyncControlsRemainInactiveAfterClearingWires  )

Definition at line 1145 of file logic.cpp.

◆ TEST() [39/85]

TEST ( FlipFlopTest ,
UnknownDataCapturesAsUnknown  )

Definition at line 1170 of file logic.cpp.

◆ TEST() [40/85]

TEST ( FlipFlopTest ,
ZeroDelayChainCapturesFromPreEdgeSnapshot  )

Definition at line 1212 of file logic.cpp.

◆ TEST() [41/85]

TEST ( FlipFlopTest ,
ZeroDelayChainSamplesPreEdgeCombinationalValue  )

Definition at line 1262 of file logic.cpp.

◆ TEST() [42/85]

TEST ( FlipFlopTest ,
ZeroPropagationDelayUpdatesImmediately  )

Definition at line 1191 of file logic.cpp.

◆ TEST() [43/85]

TEST ( LogicTest ,
And  )

Definition at line 442 of file logic.cpp.

◆ TEST() [44/85]

TEST ( LogicTest ,
AndBitwiseSimulation  )

Definition at line 1921 of file logic.cpp.

◆ TEST() [45/85]

TEST ( LogicTest ,
BusAssignmentsNormalizeWidthAndReportMeaningfulOverflow  )

Definition at line 1793 of file logic.cpp.

◆ TEST() [46/85]

TEST ( LogicTest ,
BusSettingReading  )

Definition at line 1771 of file logic.cpp.

◆ TEST() [47/85]

TEST ( LogicTest ,
BusSettingReadingAtUnsignedIntWidth  )

Definition at line 1780 of file logic.cpp.

◆ TEST() [48/85]

TEST ( LogicTest ,
CircuitEditing1  )

Definition at line 1679 of file logic.cpp.

◆ TEST() [49/85]

TEST ( LogicTest ,
CircuitEditing2  )

Definition at line 1711 of file logic.cpp.

◆ TEST() [50/85]

TEST ( LogicTest ,
DisconnectedBusStateQueriesDoNotDereferenceNullWires  )

Definition at line 1810 of file logic.cpp.

◆ TEST() [51/85]

TEST ( LogicTest ,
GateBitwiseDefaultsAndValidation  )

Definition at line 1824 of file logic.cpp.

◆ TEST() [52/85]

TEST ( LogicTest ,
GateBitwiseReshapesIO  )

Definition at line 1852 of file logic.cpp.

◆ TEST() [53/85]

TEST ( LogicTest ,
Nand  )

Definition at line 1557 of file logic.cpp.

◆ TEST() [54/85]

TEST ( LogicTest ,
NandBitwiseSimulation  )

Definition at line 1957 of file logic.cpp.

◆ TEST() [55/85]

TEST ( LogicTest ,
Nor  )

Definition at line 1618 of file logic.cpp.

◆ TEST() [56/85]

TEST ( LogicTest ,
NorBitwiseSimulation  )

Definition at line 1975 of file logic.cpp.

◆ TEST() [57/85]

TEST ( LogicTest ,
NotGateSimulatesVectorAndLogicalInputs  )

Definition at line 2019 of file logic.cpp.

◆ TEST() [58/85]

TEST ( LogicTest ,
Or  )

Definition at line 1575 of file logic.cpp.

◆ TEST() [59/85]

TEST ( LogicTest ,
OrBitwiseSimulation  )

Definition at line 1939 of file logic.cpp.

◆ TEST() [60/85]

TEST ( LogicTest ,
ReductionGatesMatchSeparateScalarInputs  )

Definition at line 1886 of file logic.cpp.

◆ TEST() [61/85]

TEST ( LogicTest ,
TopologyEditUsesNewSimulator  )

Definition at line 1741 of file logic.cpp.

◆ TEST() [62/85]

TEST ( LogicTest ,
Xor  )

Definition at line 1636 of file logic.cpp.

◆ TEST() [63/85]

TEST ( LogicTest ,
XorBitwiseSimulationPreservesUnknownAndErrorPerBit  )

Definition at line 1993 of file logic.cpp.

◆ TEST() [64/85]

TEST ( SimulatorTest ,
CancellationStopsBusPropagation  )

Definition at line 505 of file logic.cpp.

◆ TEST() [65/85]

TEST ( SimulatorTest ,
CancelledCyclicPassDiscardsStagedWrites  )

Definition at line 213 of file logic.cpp.

◆ TEST() [66/85]

TEST ( SimulatorTest ,
CancelledRunCanResumePendingEvents  )

Definition at line 487 of file logic.cpp.

◆ TEST() [67/85]

TEST ( SimulatorTest ,
CyclicComponentsReadOneSnapshotPerDeltaCycle  )

Definition at line 135 of file logic.cpp.

◆ TEST() [68/85]

TEST ( SimulatorTest ,
CyclicConflictingDriversLeaveWireInError  )

Definition at line 254 of file logic.cpp.

◆ TEST() [69/85]

TEST ( SimulatorTest ,
DelayedEventBatchCapturesPreviousStateBeforeApplyingEvents  )

Definition at line 561 of file logic.cpp.

◆ TEST() [70/85]

TEST ( SimulatorTest ,
DelayedGateReevaluationDoesNotPostponePendingTransition  )

Definition at line 738 of file logic.cpp.

◆ TEST() [71/85]

TEST ( SimulatorTest ,
DelayedGateRejectsShortInputPulse  )

Definition at line 694 of file logic.cpp.

◆ TEST() [72/85]

TEST ( SimulatorTest ,
DelayedGateReplacesPendingTransition  )

Definition at line 716 of file logic.cpp.

◆ TEST() [73/85]

TEST ( SimulatorTest ,
ForwardPropagationDoesNotRescheduleIndependentDelayedBranch  )

Definition at line 764 of file logic.cpp.

◆ TEST() [74/85]

TEST ( SimulatorTest ,
IndependentCyclicStepsKeepSeparateStagingBuffers  )

Definition at line 173 of file logic.cpp.

◆ TEST() [75/85]

TEST ( SimulatorTest ,
InteractiveSettlingKeepsWaveformChangesAtDistinctTimes  )

Definition at line 1468 of file logic.cpp.

◆ TEST() [76/85]

TEST ( SimulatorTest ,
PassesSimulationContextToComponents  )

Definition at line 520 of file logic.cpp.

◆ TEST() [77/85]

TEST ( SimulatorTest ,
PositiveDelayInsideSccUsesEventQueue  )

Definition at line 303 of file logic.cpp.

◆ TEST() [78/85]

TEST ( SimulatorTest ,
RepeatedCyclicWritesByOneSourceKeepItsLastValue  )

Definition at line 280 of file logic.cpp.

◆ TEST() [79/85]

TEST ( SimulatorTest ,
RunUntilIdlePropagatesThroughLongDelayChain  )

Definition at line 792 of file logic.cpp.

◆ TEST() [80/85]

TEST ( SimulatorTest ,
RunUntilIdleStopsAtStepLimitForDelayedFeedback  )

Definition at line 814 of file logic.cpp.

◆ TEST() [81/85]

TEST ( SimulatorTest ,
SimulatesInternalInputWaveform  )

Definition at line 595 of file logic.cpp.

◆ TEST() [82/85]

TEST ( SimulatorTest ,
UpdateBusRequiresExactWidthForImmediateAndDelayedValues  )

Definition at line 671 of file logic.cpp.

◆ TEST() [83/85]

TEST ( SimulatorTest ,
WaveformAppliesSameTimestampInputsTogether  )

Definition at line 1520 of file logic.cpp.

◆ TEST() [84/85]

TEST ( SimulatorTest ,
WaveformDoesNotPropagateWhenNormalizedValueIsUnchanged  )

Definition at line 650 of file logic.cpp.

◆ TEST() [85/85]

TEST ( SimulatorTest ,
WaveformInputSampleCapturesPreviousWireStates  )

Definition at line 620 of file logic.cpp.