chipsalliance / chipsalliance/chisel

Overloading of printf

Open
#2,108 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**: other enhancement

**Impact**: API modification

I am not sure that overloading the Scala ```printf``` function by a Chisel ```printf``` object is a great idea. The issue pops up when using ChiselTest instead of PeekPokeTester as you need to import chisel3._. Then your testing code (not the hardware) has no simple access to Scala's ```printf```. The workaround is to call it as ```Predef.printf()```. This is not very nice.

Maybe this is more a ChiselTest issue. But you might use ```printf``` in your generator code for debugging at HW generation time.

I have no good solution, except not using the name ```printf``` in Chisel, but using a different name. Probably a bit hard to change.

Contributor guide

Open the contributing guide

Research direction

Start by reading the Chisel printf API and the ChiselTest usage described in the issue, focusing on how importing chisel3._ affects access to Scala's printf. Determine whether the naming conflict belongs in Chisel or ChiselTest. Done requires an agreed API direction that preserves practical access to both printf behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.