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

The order in which `clock` is connected to module inputs affects how the circuit behaves #318

Open chykon opened 1 year ago

chykon commented 1 year ago

Describe the bug

The order in which clock is connected to module inputs affects how the circuit behaves.

The first screenshot shows the correct behavior, the second shows the wrong one:

SCREENSHOT 1

Снимок экрана от 2023-03-16 14-37-24

SCREENSHOT 2

Снимок экрана от 2023-03-16 14-38-52

The example itself is quite large, so perhaps others should be considered as “minimal examples” (the order of joins there affected the values of x/z):

To Reproduce

  1. Download code: bug_example.zip
  2. Run example.dart, open waves.vcd, check RegisterFileControllerUnit module signals - this is expected behavior
  3. Open bsm1d.dart, go to line 67 rfcu.clock <= intf.clock; and swap it with line 68.
  4. Run example.dart, open waves.vcd, check RegisterFileControllerUnit module signals - this is erroneous behavior

Expected behavior

The connection order does not affect the behavior of the circuit.

Actual behavior

The connection order affects the behavior of the circuit.

Additional: Dart SDK info

Dart SDK version: 2.19.3 (stable) (Tue Feb 28 15:52:19 2023 +0000) on "linux_x64"

Additional: pubspec.yaml

No response

Additional: Context

ROHD v0.4.2

mkorbel1 commented 1 year ago

Thank you for providing the detail and something to reproduce this. I haven't started debugging yet but from your description it does sound like a bug.