rohd
rohd copied to clipboard
Add reset signal to `FlipFlop`
Motivation
It would be nice to use FlipFlop with a reset signal (optionally synchronous or asynchronous)
Desired solution
Add optional named parameter(s) to FlipFlop that, when specified, add reset behavior.
Alternatives considered
People can already achieve this using the Sequential block, but FlipFlop is convenient.
i can do this
While we're at it, we should really make d and clk private in FlipFlop
But then the use of FlipFlop will become not so convenient: you will have to use input(). Or am I not understanding something?
UPDATE: Yes, I misunderstood this. The clk and d inputs can be hidden since we connect to them in the FlipFlop constructor.