Deduplication and unused outputs of modules

21 views
Skip to first unread message

Øyvind Harboe

unread,
Feb 10, 2022, 8:43:46 AM2/10/22
to chisel-users
Deduplication doesn't take into account unused values.

So if I have module where an output is only used sometimes, then I don't get two verilog modules.

In the example below, is there a way to specify that I want unused outputs to be taken into account before de-duplication.

The motivation is to meet a requirement for no unused signals in a design prior to synthesis.


import chisel3._
import chisel3.util.experimental.BoringUtils

class Foo extends Module {
  val x = IO(Input(UInt()))
  val y = IO(Input(UInt()))
  val a = IO(Output(UInt()))
  val b = IO(Output(UInt()))
 
  a := x
  b := y
}

class Bar extends Module {
  val a = IO(Input(UInt(5.W)))
  val b = IO(Input(UInt(5.W)))
  val sum = IO(Output(UInt()))
 
  val one = Module(new Foo())
  one.x := a
  one.y := b
  val two = Module(new Foo())
  two.x := a
  two.y := b
  sum := one.a + two.b
}

Reply all
Reply to author
Forward
0 new messages