-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question about Firrtl(IR) optimization #142
Comments
While I'm not sure why FIRRTL generated |
But you cannot expect that synthesis tools will do these things. |
From our experience it usually does. Feel free to ask some others or try it yourself. |
@YingkunZhou it is definitely fair to say that _T_11 shouldn't be there, regardless of how it impacts final QoR. Is there firrtl output you can also post? It should be in the same directory as the verilog and have a ".fir" file extension. I think this is a backend problem more than a frontend problem, but having firrtl would be helpful in verifying that. Perhaps something is being const-prop'd and then DCE is not being run afterwards. |
;buildInfoPackage: chisel3, version: 3.1.5, scalaVersion: 2.11.12, sbtVersion: 1.1.1, builtAtString: 2018-12-14 23:45:23.572, builtAtMillis: 1544831123572
|
not familiar with firrtl, though |
My output is
Perhaps the tutorial is using an older version of firrtl? |
so you use master branch? I forget when and how I installed firrtl |
Did the default behavior of + change to +& instead of +%? By default firrtl
width inference adds an extra bit to the output of add and it has to trim
it back down to the original width (that you specified for the output). Was
it ever smart enough to get rid of the extra T? If you left the output
width as unknown, it wouldn’t generate the extra T, I think, and would give
you an output with width w + 1. I also don’t really like relying on tools
to be able to do optimization’s that firrtl should be able to take care of
either.
…On Saturday, December 22, 2018, YingkunZhou ***@***.***> wrote:
so you use master branch? I forget when and how I installed firrtl
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#142 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGTTFpk6nLrMrV9sseoCIBalhQfrwNiCks5u7tL1gaJpZM4ZfQ9k>
.
|
Oops didn’t see Paul’s last reply.
…On Saturday, December 22, 2018, Angie ***@***.***> wrote:
Did the default behavior of + change to +& instead of +%? By default
firrtl width inference adds an extra bit to the output of add and it has to
trim it back down to the original width (that you specified for the
output). Was it ever smart enough to get rid of the extra T? If you left
the output width as unknown, it wouldn’t generate the extra T, I think, and
would give you an output with width w + 1. I also don’t really like relying
on tools to be able to do optimization’s that firrtl should be able to take
care of either.
On Saturday, December 22, 2018, YingkunZhou ***@***.***>
wrote:
> so you use master branch? I forget when and how I installed firrtl
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#142 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGTTFpk6nLrMrV9sseoCIBalhQfrwNiCks5u7tL1gaJpZM4ZfQ9k>
> .
>
|
above is the scala code for Adder in $TUT_DIR/src/main/scala/problems/
when I run ./run-solution.sh Adder --backend-name verilator
I got the corresponding Verilog code
module Adder(
input clock,
input reset,
input [7:0] io_in0,
input [7:0] io_in1,
output [7:0] io_out
);
wire [8:0] _T_11; // @[Adder.scala 17:20]
assign _T_11 = io_in0 + io_in1; // @[Adder.scala 17:20]
assign io_out = io_in0 + io_in1; // @[Adder.scala 17:10]
endmodule
Here assign _T_11 = io_in0 + io_in1; // @[Adder.scala 17:20] is a line of deadcode, which in my eyes wastes a build-in adder thus should be eliminated. And it is easy to fulfill using dead code elimination for IR. So is it a bug for current chisel3 implementation?
The text was updated successfully, but these errors were encountered: