Unused bits in Verilog

112 views
Skip to the first unread message

Øyvind Harboe

unread,
3 Apr 2021, 3:07:18 am3/4/21
to chisel-users
Unused outputs for a module are trimmed, but unused bits are not. At least not always.

Should Chisel by design trim unused bits as well as unused outputs of a module?

waleed....@iiu.edu.pk

unread,
3 Apr 2021, 8:00:15 am3/4/21
to chisel-users
I don't think Chisel should trim the unused bits from the output. Because it will cause very much distress in verification.
Also if you are worried from the perspective of hardware then synthesizer will do it.

On the unused output, on a personal point I think that too should not be trimmed.
But if Chisel sometimes does that, I have no problem with that ;)

Kevin Laeufer

unread,
5 Apr 2021, 5:40:49 pm5/4/21
to chisel...@googlegroups.com
Hi Øyvind,

Trimming unused bits is a bit harder to do then removing unused signals.
Especially if you allow trimming unused bits _inside_ a signal you would
have to split said signal into two (or more). This would leave us
without a clear path to giving the two new signals a decent name in the
generated Verilog.

If you only trim unused bits at the front or back of the signal, that
would be feasible but isn't really a priority since Synthesis tools will
probably do the same optimization and trimming those bits doesn't really
help that much with making the generated Verilog more readable.


Regards,
Kevin
> --
> You received this message because you are subscribed to the Google
> Groups "chisel-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to chisel-users...@googlegroups.com
> <mailto:chisel-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chisel-users/47ae348b-2c8a-4ae2-8d68-6cc7f714141dn%40googlegroups.com
> <https://groups.google.com/d/msgid/chisel-users/47ae348b-2c8a-4ae2-8d68-6cc7f714141dn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Øyvind Harboe

unread,
6 Apr 2021, 1:35:14 am6/4/21
to chisel...@googlegroups.com
Makes sense.

Trimming signals at the beginning or end would be adequate for the cases that I've run into. Especially most significant bits.

You received this message because you are subscribed to a topic in the Google Groups "chisel-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/chisel-users/csiRnQFgIBM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to chisel-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/3cc3f0dc-87f0-1981-a07b-1b626bcccbee%40berkeley.edu.


--
Øyvind Harboe
+4791786146

Øyvind Harboe

unread,
6 Apr 2021, 1:35:51 am6/4/21
to chisel...@googlegroups.com
The advantage of trimming the signals would be that the generated Verilog would be closer to hand-optimized code and it would reduce FUD (fear uncertainty doubt).
--
Øyvind Harboe
+4791786146
Reply all
Reply to author
Forward
0 new messages