rohd icon indicating copy to clipboard operation
rohd copied to clipboard

Add reset signal to `FlipFlop`

Open mkorbel1 opened this issue 3 years ago • 1 comments

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.

mkorbel1 avatar Dec 16 '21 00:12 mkorbel1

i can do this

stephtancs avatar Sep 01 '22 16:09 stephtancs

While we're at it, we should really make d and clk private in FlipFlop

mkorbel1 avatar Mar 31 '23 00:03 mkorbel1

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.

chykon avatar Mar 31 '23 18:03 chykon