Git Product home page Git Product logo

Comments (3)

cliffordwolf avatar cliffordwolf commented on July 19, 2024

It is not really doing anything here. The "removing top bits" does not actually remove the bits. It changes the wiring around and lets a later "clean" actually get rid of them. When you call "clean" between two calls to "wreduce" then the loop will stop. When you just call "wreduce" in a loop it will prepare this wires in a way that "clean" can get rid of them over and over again.. (It renames the wires, thus it looks like its a different wire in each iteration.)

I have now fixed this in commit 0748ef6. Now wreduce recognizes the already-prepared-for-deletion wires and does not touch them a second time.

from yosys.

jeremysalwen avatar jeremysalwen commented on July 19, 2024

Ah, I understand. Perhaps a note about this could be added to the wreduce documentation/output that it needs to be run in conjunction with clean?

while you're at it there is a typo in the title of this page as well (is->if)
http://www.clifford.at/yosys/cmd_wreduce.html

I am under the impression that you are looking for bug reports/typos etc for even minor things, but if you are not, let me know so you can focus on higher priorities.

from yosys.

cliffordwolf avatar cliffordwolf commented on July 19, 2024

Perhaps a note about this could be added to the wreduce documentation

This is a general theme in Yosys, not specific to the wreduce command. (The help message to opt_clean has something on it and I've now added some additional explanations to the CodingReadme file.)

while you're at it there is a typo in the title of this page as well

fixed. (webpage will be updated when I release yosys 0.6)

I am under the impression that you are looking for bug reports/typos etc for even minor things, ...

Yes. A steady flow of easy to fix bug reports is very welcome.. ;)


Let me just add a more detailed explanation of what was going on with wreduce (for the record):

Say you have a signal a[5:0] and only the lower 4 bits of it are used, so "wreduce" tries to "remove" the top two bits. I cannot remove a Wire object (or make it shorter, see the explanation in CodingReadme I mentioned above). So I instead create a new wire $temp42[3:0] and essentially add assign $temp42[3:0] = a[3:0] to the design. Finally I rename $temp42 to a and a to $temp42. The next call to "clean" will remove the wire $temp42.

Before my bugfix, if you called "wreduce" a 2nd time it looked at the $temp42[5:0] wire and said "hay - I can remove the two top bits from it", create a $temp43[3:0], assign $temp43[3:0] = $temp42[5:0] and flip the names. Now after the bugfix "wreduce" understands that it is operating on wires that "clean" would throw away anyways and simply skips them.

from yosys.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.