Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Storable Types
This PR defines a new term "Storable Type" which captures the class of FIRRTL types which are admissible inside of registers and memories.
Isn't this just like Passive?
Yes.
The definition has a large overlap with the term Passive Type. And that is not a coincidence.
The term Passive Type has been used to designate 'types without flips'. However, with the introduction of Probe Types and also Property types, more nuance is required to handle types. Arguments have been made both for and against the above types being allowed be passive.
In order to help resolve this tension, the new term Storable Type is intended to separate out one particular usage of Passive Types.
What is different between Passive and Storable?
Some notable differences between Passive and Storable:
const
disqualifies it from being Storable.No. 1 acknowledges the special nature of Clocks and Resets.
I would insist on No. 2 on the grounds that
Analog
isn't very well-specified. We can always add it in later once we have a better foundation for it.No. 3 and No. 4 are the primary motivation. Properties are easy to exclude, as we have stipulated they are not to affect the RTL, but rather serve as metadata to it. For probes, we use a similar appeal to the non-"hardware-y-ness" of probes, combined with the fact that storing a probe in a register requires a nontrivial encoding (and ultimately is likely to wind up meaningless).
No. 5 is a lesson from @darthscsi (feel free to forward attribution if needed) who pointed out to me that you can use
const
registers to create a mutatingconst
value. This PR removes the non-const
restriction from registers, as it is subsumed into this definition. (The spec seems to have forgotten to include aconst
restriction on memories).Why doesn't this PR remove the term Passive?
The term Passive still exists after this PR goes through. It still requires a bit of investigation to work out what role passivity plays in FIRRTL. There are only a handful of places in the spec Passive Types are referenced:
This gives us only a handful of places where we need to apply scrutiny. But none of these cases is so clear cut I feel I could change or remove them without changing the interpretation of the spec.