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

FSM abstraction have issue on priority condition #372

Closed quekyj closed 1 year ago

quekyj commented 1 year ago

Describe the bug

In the current implementation of the FSM, the generated system Verilog used unique case. Hence, it will throw error when there more than one event occurred at same clock.

To Reproduce

  1. Create FSM using ROHD abstraction
  2. Use Simulator() to simulate more than one event that occurred at the same flops.

Expected behavior

No response

Actual behavior

Alternative 1: Create a priority FSM that allows user to give priority of which one to execute in the case of two events happened at the same time.

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

No response

mkorbel1 commented 1 year ago

We should implement an ability to control different ConditionalTypes for FSM abstractions as well to support this type of use case.

There's two types of Case statement used in the FSM abstraction:

Perhaps the top-level one should always be unique? The nested ones definitely seem like having things like priority could be helpful. Perhaps we want the nested ones to be configurable on a per-state basis? Perhaps we want to have a configurable "default" type across states at the top-level of the state machine?