107 bool timingInputChanged)
const;
109 bool timingInputChanged)
const;
156 static constexpr std::string_view
Type =
"DFlipFlop";
165 return {
"D Flip Flop",
"Captures D on the configured clock edge.",
218 static constexpr std::string_view
Type =
"EFlipFlop";
227 return {
"Enabled D Flip Flop",
228 "Captures D on the configured clock edge while enable is HIGH.",
284 static constexpr std::string_view
Type =
"DLatch";
289 return {
"D Latch",
"Follows D while enable is HIGH and holds while disabled.",
337 static constexpr std::string_view
Type =
"JKFlipFlop";
346 return {
"JK Flip Flop",
"Stores, sets, resets, or toggles state from J and K.",
static constexpr unsigned int busIndex(Enum value)
Converts a component-local bus enum to its storage index.
std::vector< Bus > outputs
Output buses produced by this component.
std::vector< Bus > inputs
Input buses connected to this component.
static constexpr std::string_view Type
Serialization/type-registry identifier.
Inputs
Input bus indices for DFlipFlop.
@ Preset
Active-high asynchronous preset.
@ Clear
Active-high asynchronous clear.
@ D
Data input captured on the selected clock edge.
bool isTimingSensitiveInput(unsigned int inputIndex) const override
Returns true for synchronous pins governed by setup/hold timing.
DFlipFlop()
Constructs an unconnected D flip-flop.
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Returns the component type name.
State captureState() const override
Computes the state captured on the selected clock edge.
static constexpr std::string_view Type
Serialization/type-registry identifier.
bool usesStagedSequentialOutputs() const override
Whether zero-delay output writes should be staged during reactive passes.
Inputs
Input bus indices for DLatch.
@ Enable
Active-high transparency enable.
@ D
Data input followed while the latch is transparent.
uint64_t propagationDelay
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
void driveOutput(SILICON::simulation::Simulator &sim, State newState)
DLatch()
Constructs an unconnected D latch.
std::string_view typeName() const override
Gets the component type name.
void simulate(SILICON::simulation::Simulator &sim, const SILICON::simulation::Context &context) override
Executes the component's logic with simulator scheduling context.
void initializeProperties()
static constexpr std::string_view Type
Serialization/type-registry identifier.
Inputs
Input bus indices for EFlipFlop.
@ Enable
Capture enable input.
@ Preset
Active-high asynchronous preset.
@ Clear
Active-high asynchronous clear.
@ D
Data input captured when Enable is HIGH.
EFlipFlop()
Constructs an unconnected enabled D flip-flop.
bool isTimingSensitiveInput(unsigned int inputIndex) const override
Returns true for synchronous pins governed by setup/hold timing.
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Returns the component type name.
State captureState() const override
Computes the state captured on the selected clock edge.
FlipFlop(unsigned int clockIndex, unsigned int clearIndex, unsigned int presetIndex)
Constructs a flip-flop base with the input indices used for control pins.
bool violatesSetupTime(uint64_t currentTime, bool timingInputChanged) const
bool usesStagedSequentialOutputs() const override
Whether zero-delay output writes should be staged during reactive passes.
bool mayHaveSelectedEdge(State previousClock, State currentClock) const
Checks if an ambiguous clock transition occurred that might be the triggering edge.
uint64_t propagationDelay
std::optional< uint64_t > lastSelectedClockEdgeTime
bool hasTimingSensitiveInputChange(const SILICON::simulation::Context &context) const
void driveOutput(SILICON::simulation::Simulator &sim, State newState)
bool violatesHoldTime(uint64_t currentTime, bool timingInputChanged) const
void simulate(SILICON::simulation::Simulator &sim, const SILICON::simulation::Context &context) override
Evaluates async controls and selected clock edges.
virtual State captureState() const =0
Computes the state captured on the selected clock edge.
void initializeProperties()
State latchedState() const
Returns the currently stored state.
std::optional< uint64_t > lastTimingInputChangeTime
virtual bool isTimingSensitiveInput(unsigned int inputIndex) const =0
Returns true for synchronous pins governed by setup/hold timing.
SILICON::simulation::Simulator::EdgeType edgeType
void clearState()
Clear FF internal state (state, last transitions time, ...).
static constexpr std::string_view Type
Serialization/type-registry identifier.
Inputs
Input bus indices for JKFlipFlop.
@ Preset
Active-high asynchronous preset.
@ Clear
Active-high asynchronous clear.
bool isTimingSensitiveInput(unsigned int inputIndex) const override
Returns true for synchronous pins governed by setup/hold timing.
ComponentMetadata metadata() const override
Gets catalog metadata for this component type.
void serializeYosys(SILICON::yosys::SerializationContext &context) const override
Lower this component into native Yosys netlist cells.
std::string_view typeName() const override
Returns the component type name.
JKFlipFlop()
Constructs an unconnected JK flip-flop.
State captureState() const override
Computes the state captured on the selected clock edge.
Executes event-driven simulation of a Circuit.
EdgeType
Logical edge observed for one wire during a reactive evaluation.
Mutable module-building interface passed to component serializers.
std::shared_ptr< Wire > Wire_ptr
Context describing why a component is being evaluated.