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

Submodule output name conflict #287

Closed chykon closed 1 year ago

chykon commented 1 year ago

Describe the bug

If submodules have the same output signal name, a conflict occurs. Because of this, the submodule itself must guard against such situations by generating a unique name (for example, using addOutput('out_${Logic().name}')).

To Reproduce

The problem is in the Nand2Gate module.

DartPad: https://dartpad.dev/?id=a384202f85517f4bc0191122a5ad180c

Expected behavior

A submodule can be used in any module without having to provide unique names.

Actual behavior

The submodule developer is required to provide unique names.

Additional: Dart SDK info

No response

Additional: pubspec.yaml

No response

Additional: Context

No response

chykon commented 1 year ago

Clearly, it was my fault. The problem was in the Nand2Gate constructor, namely that addInput used the names of input signals, which led to a conflict when receiving a signal named out.