intel / rohd

The Rapid Open Hardware Development (ROHD) framework is a framework for describing and verifying hardware in the Dart programming language.
https://intel.github.io/rohd-website
BSD 3-Clause "New" or "Revised" License
374 stars 67 forks source link

Make a `flop`-like function that constructs a `FlipFlop` and gets the output #257

Closed mkorbel1 closed 1 year ago

mkorbel1 commented 1 year ago

Motivation

Similar to how mux creates a Mux and returns the output.

Currently, to make a flop requires FlipFlop(clk, d).q, but it would be nicer to write flop(clk, d) to get the same thing.

Desired solution

Implement a new globally visible function like

Logic flop(clk, d) { ... }

which performs the same functionality as getting q from a constructed FlipFlop.

Alternatives considered

No response

Additional details

No response