summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util
AgeCommit message (Collapse)Author
2018-02-02Autoclonetype will clone args that are of type data (#768)Richard Lin
2018-01-23Runtime API deprecation warnings (#761)Richard Lin
Add runtime warnings for use of deprecated Chisel methods. This is done using a macro that takes the message from a `@deprecated` annotation, and adds a call to `Builder.deprecated`. Reasoning is that by default, Scala doesn't print all deprecations, and that it's somewhat tricky to notice them - yet some support questions revolve around the use of deprecated and terribad API. This now prints warnings for uses of deprecated functions at runtime, and aggregates them by error and line to avoid spam. Also included is convenient information on enabling scalac deprecations. This also changes how line numbers for Chisel's error facility is determined, using prefix string comparison of the stack trace element classnames, instead of checking if the class is a subtype of UserModule. The previous one (specifically, calls to Class.forName) seems to interact badly with reflection-based cloneType when called at scale. This should also give more accurate reporting of errors that are in user code but outside of a UserModule. It turns out that `@deprecated` on macro functions don't do anything, so this changes the tags to the functions that the macros point to, which seems to work properly. It also turns out that there's a bunch of uses of deprecated functions in chiselTests which needs to be fixed. Not all `@deprecated` functions are also annotated with `@chiselRuntimeDeprecation`, because they're still used in Chisel internals, and we can't track whether they're called by the user or by Chisel and it will give a misleading error. These are a small amount of functions.
2017-12-13Improve some of the ScalaDoc in chisel3.utilJack Koenig
2017-11-23Change switch to emit when, elsewhen, instead of when, when (#720)Jack Koenig
Also enforce switch is conditions are mutually exclusive literals
2017-10-26Invalidateapi (#645)Adam Izraelevitz
* Require explicit connection to DontCare to generate "is invalid". * Add tests for RefNotInitializedException. Currently, we fail the when ... otherwise ... * Disable ScalaTest shrinking on error in ComplexAssignSpec. * fix broken merge; still some binding issues * cleanup DontCare connection checks; add missing directions to test module IOs * Have library code inherit compileOptions from the enclosing Module (if it exists). * work around current firrtl uninitialized references with Strict compile options and explicitInvalidate * more CompileOptions cleanup; move test-specific defines to package object * minimize differences with master * set default CompileOptions.explicitInvalidate to false until we fix the FIRRTL when issue * ignore the StrictCompiler property checks (until CompileOptions.explicitInvalidate is defaulted to true) * Revert "more CompileOptions cleanup; move test-specific defines to package object" This reverts commit e4486edcba990d150e76e08a2fc6abca033556e0. * Revert "work around current firrtl uninitialized references with Strict compile options and explicitInvalidate" This reverts commit 426faa430a62c3dac2dbdf33044d3386d4243157. * remove unused code * Convert to binding-based DontCare implementation * comment cleanup to minimize differences with master * Tentatively remove possibly redundant DefInvalid on module ports. * Respond to code review change request. - backout build.sbt change - correct indentation - handle bulk of DontCare semantics in elemConnect() - have DontCare extend Element, not Data (eliminate most Object specific methods - add comments indicating reason for explicit DontCare connections * Initialize test elements without requiring a DontCare. * Respond to review change requests. - DontCare should work on left or right side in BiDirectional connections - call bind() to set DontCare binding instead of messing with internal variables - DontCares are only equivalent with DontCares - clean up processWhens() definition * Eliminate DontCare connection to inputs in MonoConnect(). * Pull aggregates apart for the purpose of DontCare connections. * Restore the explicit (conditionally executed) ports DefInvalidin ImplicitModule() * Don't add DontCare's to the module list of _ids. * Add missing DefInvalid() to LegacyModule(). * Respond to review requests: add DontCare BiConnect Vec, remove null parent hack to avoid addId(), initialize singletons early in Builder * Move DontCare out of chisel3.experimental.
2017-10-05the cloneType and chiselCloneType hot mess 🔥 (#653)Richard Lin
Addresses #419 cloneType is now marked (through comments only) as an internal API. chiselCloneType deprecated (and changed to cloneTypeFull internally, analogous to cloneTypeWidth). chiselTypeOf(data) introduced as the external API to get a chisel type from a hardware object Intended usage: cloning is an implementation detail, and chisel types and hardware objects both should act as immutable types, with operations like Input(...), Reg(...), etc returning a copy and leaving the original unchanged. Hence, the clone operations are all deprecated. Deletes what appears to be an unused Bundle companion object. Input(...), Output(...), Flipped(...) require the object to be unbound
2017-10-03Remove warning in Queue for compatibility code (#702)Jack Koenig
2017-08-17More of the bindings refactor (#635)Richard Lin
Rest of the binding refactor
2017-08-01Address scalastyle issues, out of date comments, extraneous imports. (#658)Jim Lawson
No functional changes
2017-06-26Directions internals mega-refactor (#617)Richard Lin
Part 1 of mega-change in #578 Major notes: - Input(...) and Output(...) now (effectively) recursively override their elements' directions - Nodes given userDirection (Input, Output, Flip - what the user assigned to _that_ node) and actualDirection (Input, Output, None, but also Bidirectional and BidirectionalFlip for mostly Aggregates), because of the above (since a higher-level Input(...) can override the locally specified user direction). - DataMirror (node reflection APIs) added to chisel3.experimental. This provides ways to query the user given direction of a node as well as the actual direction. - checkSynthesizable replaced with requireIsHardware and requireIsChiselType and made available in chisel3.experimental. Internal changes notes: - toType moved into Emitter, this makes the implementation cleaner especially considering that Vec types can't be flipped in FIRRTL. This also more clearly separates Chisel frontend from FIRRTL emission. - Direction separated from Bindings, both are now fields in Data, and all nodes are given hierarchical directions (Aggregates may be Bidirectional). The actualDirection at the Element (leaf) level should be the same as binding directions previously. - Bindings are hierarchical, children (of a, for example, Bundle) have a ChildBinding that points to their parent. This is different than the previous scheme where Bindings only applied at the Element (leaf) level. - Lots of small misc clean up. Future PRs will address other parts of #578, including stricter direction checks that aren't a side-effect of this internal refactor, stricter checks and splitting of binding operations (Wire vs. WireInit), and node operations not introduced here (getType and deprecation of chiselCloneType). Since those shouldn't mess with internals, those should be much smaller.
2017-05-28Correct misleading example codeEdward Wang
2017-05-25Update internal Pipe wiring - fixes #615" (#616)Jim Lawson
Replace ambiguous bi-connect ("<>") with mono-connect (":=") for internal Pipe wiring.
2017-05-19Update comments describing Decoupled/ReadyValid - fix #437. (#493)Jim Lawson
* Update comments describing Decoupled/ReadyValid. It seems there is a valid use case for EnqIO/DeqIO and updating the comments may clear some of the confusion and encourage their usage. * Update comments - no functional changes. Re-flow comments for ReadyValidIO() Add gen param to DecoupledIO() and IrrevocableIO(). * Update code and comment now that #492 is resolved
2017-04-26Deprecate fromBits and clock/reset constructors (#583)Richard Lin
2017-04-26Dropimportnotstrict492 - More updates to get things through rocket-chip. (#592)Jim Lawson
* Remove explicit import of NotStrict - fixes #492 * Provide macro for MemBase.apply(). * Provide macro for MemBase.apply(). Since a macro cannot override an abstract method, provide a concrete apply method n VecLike() that we can override with a macro. * Remove concrete apply() in VecLike. Since MemBase no longer extends the trait VecLike, we do not require a concrete method to which we can apply a macro to extract the appropriate CompileOptions. * Add missing implicit compileOptions to do_pad() and do_zext(). The latter caused: ``` [error] /vm/home/jenkins/workspace/rocket-chip_with_chisel3/hardfloat/src/main/scala/MulAddRecFN.scala:205: too many arguments for method do_zext: (implicit sourceInfo: chisel3.internal.sourceinfo.SourceInfo)chisel3.core.SInt [error] val CDom_sExp = io.fromPreMul.sExpSum - io.fromPreMul.doSubMags.zext ``` * Add SourceInfoTransform macros to Vec methods in order to avoid apply() chain issues. Since utils methods are no longer NotStrict, Pipe objects need access to the client's compile options. There may be more. * Respond to review comments. Don't propagate SourceInfo through helper functions. Replace old usages of CompileOptionsTransform with the now equivalent SourceInfoTransform and redefine CompileOptionsTransform to only deal with CompileOptions. Just thread CompileOptions (not SourceInfo) through deprecated functions.
2017-04-25Remove explicit import of NotStrict - fixes #492 (#494)Jim Lawson
* Remove explicit import of NotStrict - fixes #492 * Provide macro for MemBase.apply(). * Provide macro for MemBase.apply(). Since a macro cannot override an abstract method, provide a concrete apply method n VecLike() that we can override with a macro. * Remove concrete apply() in VecLike. Since MemBase no longer extends the trait VecLike, we do not require a concrete method to which we can apply a macro to extract the appropriate CompileOptions.
2017-04-13Module Hierarchy Refactor (#469)Richard Lin
2017-04-07Change Enum to emit minimum widths of 1 (#574)Jack Koenig
Fixes #554
2017-03-08Deprecate old Reg with nulls constructor (#455)Richard Lin
2017-03-08Move log2Up and log2Down to compatibility wrapperAndrew Waterman
2017-03-08Improve UIntToOH behavior on incorrect inputs; avoid log2UpAndrew Waterman
The old implementation failed to check for width <= -2, and did the wrong thing when -1 was explicitly passed. Splitting into two methods avoids the latter issue. log2Ceil's argument might be 1, so employ a max operator.
2017-03-08In OHToUInt, use log2Ceil instead of log2UpAndrew Waterman
Since the argument is at least 2, this change has no semantic effect.
2017-03-08Use zero-width wire for 1-entry enumAndrew Waterman
2017-03-08In Counter, use log2Ceil instead of log2UpAndrew Waterman
Since the argument is at least 2, this change has no semantic effect.
2017-03-08Fix the widths of QueueIO.count and ArbiterIO.chosen for entries=0Andrew Waterman
Both should be zero-width wires.
2017-03-08Improve Reverse's exception behavior; avoid log2UpAndrew Waterman
Provide a better error message when length < 0. Change log2Up in log2Ceil, which has no effect, since the argument is always at least 2.
2017-03-08Correct Fill's exception behavior; avoid log2UpAndrew Waterman
It always should throw an exception when n < 0, but in the specific case of x.isWidthKnown && x.getWidth == 1, it failed to do so. This commit also changes log2Up in log2Ceil, which has no effect, since the argument is always at least 2.
2017-02-07Name all the thingsducky
2017-01-31Move blackbox verilog implementations within reach of verilator (#453)Chick Markley
* Move blackbox verilog implementations within reach of verilator Blackbox implementers can annotate the modules with information on where to get the source verilog This API is very lightweight, real work is done in firrtl in companion PR Added some verilog to BlackBoxTest.v resource for testing * if a file named black_box_verilog_files.f exists add a -f black_box_verilog_files.f to the verilog to cpp command
2017-01-30Add shift register with reset (#439)Stevo
* [stevo]: add reset initialization to shift register * [stevo]: better comment * [stevo]: add tests, fix bug
2017-01-27Make uselessly public fields in utils privatejackkoenig
2017-01-27Provide package-level text to reduce ScalaDoc white space. (#432)Jim Lawson
2016-12-14Change noenq in ReadyValid to use an uninitialized Wire instead of zero (#364)Jack Koenig
2016-12-06utils scaladoc examples for BitPat through CircuitMath (#398)Richard Lin
Add examples for utils, move examples from individual apply methods to class overview scaladoc
2016-11-29Add feature warnings to build, fix feature warnings, fix some documentation ↵Richard Lin
(#387)
2016-11-23Simplify Enum API (#385)Richard Lin
Get rid of some cruft exposed in #373 This also allows Bits.fromtInt(...) to be removed. Yay! All old APIs (with some new restrictions, rocket still works fine) are preserved without deprecation in Chisel._, aside from the non-compile-time-checkable Map[] enum constructor which probably should have been deprecated during chisel2. The Map[] enums have been removed from chisel3._ without deprecation. The new restriction is that nodeType (legacy API) may only be of UInt type with unspecified width. Note that Bits() creates a UInt, and if you can't control the enum values, it makes little sense to specify a bitwidth.
2016-11-21Fix Log2ducky
2016-11-21better styleducky
2016-11-21Restyle a lot of test code, mainly with regexducky
2016-11-18Shift register enable gates all stages, not just firstStevo
Also, remove no-longer-special case for n=1.
2016-11-17Eliminate some doc warningsducky
2016-10-24Merge pull request #246 from seldridge/issue-245Jim Lawson
Add a cloneType method to QueueIO
2016-10-19Deprecate "!=". (#323)Jim Lawson
2016-10-13Add cloneType method to QueueIOSchuyler Eldridge
Candidate fix for #245
2016-10-05TransitName comment change.Jim Lawson
This was originally mixed in with #199, Add Assert Data.
2016-09-29Consolidate CompileOptions and re-enable NotStrict pending macro work.Jim Lawson
2016-09-29Massive rename of CompileOptions.Jim Lawson
Massage CompileOption names in an attempt to preserve default (Strict) CompileOptions in the absence of explicit imports. NOTE: Since the default is now strict, we may encounter errors when we generate connections for clients (i.e., in Vec.do_apply() when we wire up a sequence). We should really thread the CompileOptions through the macro system so the client's implicits are used.
2016-09-28Don't use firrtlDirection for direction checks - fix #298.Jim Lawson
firrtlDirection should only be used for emitting firrtl. Any checks on the actual direction should use the bound Direction `dir`.
2016-09-23Merge branch 'master' into gsdtJim Lawson
2016-09-22Update rest of docsducky