question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Option to Disable Div(a, a) -> 1 Fold

See original GitHub issue

Checklist

  • Did you specify the current behavior?
  • Did you specify the expected behavior?
  • Did you provide a code example showing the problem?
  • Did you describe your environment?
  • Did you specify relevant external information?

What is the current behavior?

The following FIRRTL program

circuit top_mod :
  module top_mod :
    input inp_1: UInt<14>
    output tmp4: UInt<14>
    tmp4 <= div(inp_1, inp_1)

Compiled with firrtl-1.4.0 generates the following Verilog

module top_mod(
  input  [13:0] inp_1,
  output [13:0] tmp4
);
  assign tmp4 = 14'h1;
endmodule

What is the expected behavior?

Expected the following Verilog

module top_mod(
  input  [13:0] inp_1,
  output [13:0] tmp4
);
  assign tmp4 = inp_1 / inp_1;
endmodule

Formal tool Yosys (Yosys 0.9+3755 (git sha1 442d19f6, clang 11.0.0 -fPIC -Os)) reports mismatch between current and expected result:

ERROR: Found 13 unproven $equiv cells in 'equiv_status -assert'.

Steps to Reproduce

./firrtl-1.4.0 -i top_mod.fir

Your environment

Linux linux-sydi 5.9.14-1-default #1 SMP Sat Dec 12 06:57:32 UTC 2020 (c648a46) x86_64 x86_64 x86_64 GNU/Linux

External Information

https://twitter.com/wavedrom/status/1342932252531945472

https://github.com/llvm/circt/issues/363

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
jackkoenigcommented, Jan 4, 2021

Looking at the CIRCT issue, it looks like we’re all on the same page that this is a desirable optimization despite it being a LEC failure. It would be nice if we had a way of expressing LEC-failing optimizations in a way that we could waive such differences but still check the rest of the design.

0reactions
dromcommented, Jan 5, 2021

Perhaps the simplest solution would be to provide an option to disable LEC-violating optimizations.

After running my FIRRTL fuzzer, I have found only one optimization that breaks Yosys LEC beyond repair, so far. It would help me a lot having an option to disable A / A -> 1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to disable DIV element and everything inside [duplicate]
I'm just trying to disable everything inside a DIV and it's handlers. · 3 · 1 · Actually in Quirks-mode IE can disable...
Read more >
Enable & Disable a div and all of its elements in it. (#66713)
need a feature to disable div and all element in it. like if i have a div ... [folding] Folding HTML tags should...
Read more >
LibreOffice 7.1 Community: Release Notes
Added a new Writer outline folding mode (as experimental feature). You should enable ... Added an option to disable paste with Enter key....
Read more >
Unreal Engine 5.0 Release Notes
Unreal Engine 5.0 introduces a new Post-Motion Blur Translucency pass that gives artists a way to create translucent Materials that are not affected...
Read more >
llvm-rtdyld - manual page for llvm-rtdyld 12 - Ubuntu Manpage
OVERVIEW: llvm MC-JIT tool USAGE: llvm-rtdyld [options] <input files> --args <program ... --amdgpu-use-aa-in-codegen - Enable the use of AA during codegen.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found