chipsalliance / chipsalliance/chisel

MonoConnect's canBulkConnectAggregate sinkCanBeDriven check isn't right

Open
#2,824 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
4.8k
Forks
658
Avg merge
18h 59m
Merged PRs (30d)
14

Description

**Type of issue**: Bug Report

**Please provide the steps to reproduce the problem:**

**What is the current behavior?**

I havent' shown that this actually causes a problem, but this code looks suspect:

https://github.com/chipsalliance/chisel3/blob/3aba755bdcf996c0fbd846d13268fd6641b29e96/core/src/main/scala/chisel3/internal/MonoConnect.scala#L361

```
// Check that the Aggregate can be driven (not bidirectional or an input) to match Chisel semantics
def sinkCanBeDrivenCheck: Boolean =
sink.direction == ActualDirection.Output || sink.direction == ActualDirection.Unspecified
```
This is ignoring the current module, and this check only makes sense from if the `sink` is in the current module.

**What is the expected behavior?**

This code would make sense.
IN practice I don't think this can cause problems because we'll just not actually handle cases where we could have bulk connected and we'll bust those out into Records anyway.

**Please tell us about your environment:**
- version: master (pre-3.6)

**Other Information**

**What is the use case for changing the behavior?**

this code is misleading to the reader.

Contributor guide

Open the contributing guide

Research direction

Start at core/src/main/scala/chisel3/internal/MonoConnect.scala around line 361 and inspect how sink direction and current-module context are represented. Confirm whether the check is misleading or behaviorally wrong, then verify the corrected semantics with relevant existing coverage; done means the check accurately reflects the intended Chisel behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.