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.

PadWidths: generates illegal widths for Dshl

See original GitHub issue

This line in PadWidths ensures that the argument e width of a dshl is the same as its result width: https://github.com/freechipsproject/firrtl/blob/master/src/main/scala/firrtl/passes/PadWidths.scala#L46

    case Dshl =>
        // special case as args aren't all same width
        ex copy (op = Dshlw, args = Seq(fixup(width(ex.tpe))(ex.args.head), ex.args(1)))

(i.e. Result Width == w_e instead of Result Width == w_e + 2^(w_n) - 1)

This is incorrect according to the firrtl spec: Dynamic Shift Left Operation

I would suggest just removing this case altogether. However, I am not sure why it was added in the first place.

@donggyukim and @jackkoenig, maybe you can comment on this.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
jackkoenigcommented, Sep 4, 2019

IMO we just need to move the dshlw injection into the Verilog emitter

1reaction
ekiwicommented, Sep 4, 2019

Are you sure? It’s taking the width of ex, which should already include the +2^n-1, since this runs after InferWidths.

The problem is that after we extend e to be the same width as the result (i.e., e_w == Result Width) the equation given in the spec (Result Width == w_e + 2^(w_n) - 1) is no longer true.

In other words, once we extend w such that w_e is equivalent to the Result Width, w_n must be 1 in order for the equation from the spec to hold true. Of course w_n is not always 1, thus we get an ill-typed expression for any n that is wider than 1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lateral Flow Immunochromatography Assay for Detection of ...
Although no positive sample was found in this survey due to the sample size and strict supervision in Guangzhou, the results still indicate...
Read more >
7 mistakes EVERY new camper makes with their SLEEP ...
Use coupon code 'BECKER15' at Backcountry to get 15% off your first purchase on backcountry.com (exclusions may apply)Thermarest Neo Air ...
Read more >
Small Form-Factor Pluggable (SFP) Transceiver Multisource ...
Adopting a common industry size simplifies the integration of small drives (2. 1/2" or less) into such systems. Board-board connectors carrying power and....
Read more >
On the Launch Pad: A Counting Book About Rockets
In award-winning author Michael Dahl's, On the Launch Pad: A Counting Book About ... Product dimensions: 11.00(w) x 9.00(h) x 0.12(d).
Read more >
A Review of Road Traffic-Derived Non-Exhaust Particles
Overview of reported mode diameters of size distributions based on different measurement methods for (a) brake wear particle number distribution ...
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