Skip to content

Update deprecations #150

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

Merged
merged 5 commits into from
Jul 1, 2019
Merged

Update deprecations #150

merged 5 commits into from
Jul 1, 2019

Conversation

ucbjrl
Copy link
Contributor

@ucbjrl ucbjrl commented Jun 28, 2019

Replace toBool with asBool.
Ensure each test run uses a fresh TesterOptionsManager so we don't end up with:

firrtl.options.OptionsException: Multiply defined input FIRRTL sources. More than one of the following was found:
    - an input file (0 times):  -i, --input-file,    FirrtlFileAnnotation
    - FIRRTL source (0 times):      --firrtl-source, FirrtlSourceAnnotation
    - FIRRTL circuit (2 times):                      FirrtlCircuitAnnotation

@ucbjrl ucbjrl added this to the 3.2.0 milestone Jun 28, 2019
@ucbjrl ucbjrl requested review from chick and edwardcwang June 28, 2019 17:30
@ucbjrl
Copy link
Contributor Author

ucbjrl commented Jun 28, 2019

We may want to hold off on committing these changes to release until we publish a 3.1.x version that supports asBool.
They should be fine for master

@@ -29,7 +29,7 @@ class Adder(val n:Int) extends Module {
FAs(i).b := io.B(i)
FAs(i).cin := carry(i)
carry(i+1) := FAs(i).cout
sum(i) := FAs(i).sum.toBool()
sum(i) := FAs(i).sum.asBool()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rule for .asBool vs .asBool() again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle it should be asBool since it doesn't modify the object, but this potentially runs afoul of apply chaining (or implicits?). I think @ducky64 can explain it better than I can.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the recommendation was, if any. No parens seems logical if it works. I can't think off the top of my head why the parens would affect implicit chaining.

Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The asBool() all looks correct.
I'm concerned that if the user passed in some args, say for the backend or something like that
The second optionsManager you create will not see those. I think you need to at least
re-parse the arguments. Your thoughts?

@ucbjrl
Copy link
Contributor Author

ucbjrl commented Jul 1, 2019

That's an excellent point. Let me try to address it.

@ucbjrl
Copy link
Contributor Author

ucbjrl commented Jul 1, 2019

Would it be better to address this by adding a copy method to TesterOptionsManager? Then we could copy it once the arguments have been parsed (instead of repeatedly parsing the arguments).

@chick
Copy link
Contributor

chick commented Jul 1, 2019

I'd say that would have been worth doing if we were sticking to OptionsManagers but given Stage/Phases I would say "no, it's not worth it". I'd just write a utility copy method of your own
like

object OptionsCopy {
  def apply(t: TesterOptionsManager): TesterOptionsManager = {
    new TesterOptionsManager {
      testerOptions = t.testerOptions.copy()
      interpreterOptions = t.interpreterOptions.copy()
      chiselOptions = t.chiselOptions.copy()
      firrtlOptions = t.firrtlOptions.copy()
      treadleOptions = t.treadleOptions.copy()
    }
  }
}

Copy link
Contributor

@chick chick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ucbjrl ucbjrl merged commit 5694d95 into master Jul 1, 2019
@ucbjrl ucbjrl deleted the update_deprecations branch July 1, 2019 23:38
ucbjrl added a commit that referenced this pull request Jun 1, 2020
* Update deprecations (#150)

* Update deprecations

* Ensure TesterOptionsManager isn't shared between tests.

* Respond to comments - remove () from asBool.

* Respond to comment - ensure testOptionsManager has parsed args.

* Provide a utility copy method to copy TesterOptionsManager state

* Fix some typos in tutorial.tex (#148) (#155)

(cherry picked from commit 2d43a86)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>

* Bump sbt and scala versions (#157)

* Bump SNAPSHOT versions for master branch (#156)

* Bump release versions

* Bump sbt to 1.3.7. (#154)

OpenJDK 13 causes problems with old versions of SBT. See [this issue](sbt/sbt#5093).

(cherry picked from commit d47fa0d)

Co-authored-by: Paul Rigge <rigge@berkeley.edu>

* Remove explicit chisel3 dependency (#158)

* Remove explicit chisel3 dependency
Rely on testers to pull in the correct version.

* Bump iotesters to correct SNAPSHOT version; simplify libraryDependencies.

* Use SNAPSHOT version (for master/SNAPSHOT branches)

* fix single port ram code (#160)

Co-authored-by: bqwer <liventsev@gmail.com>

* Bump sbt to 1.3.10 (#161)

Co-authored-by: Felix Yan <felixonmars@archlinux.org>
Co-authored-by: Paul Rigge <rigge@berkeley.edu>
Co-authored-by: bqwer <liventsev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy