Add support for method output port splitting#1
Open
krame505 wants to merge 57 commits into
Open
Conversation
krame505
commented
Jan 9, 2026
| filterZeroWidthPorts _ _ = error "filterZeroWidthPorts: non-empty port names list" | ||
|
|
||
| -- Helper class to conditionally convert Bit 0 to () | ||
| class NonEmptyBits n pb | n -> pb where |
Owner
Author
There was a problem hiding this comment.
@nanavati thinks this type class should have a different name. I'm unsure what to call it, though - maybeFilterEmptyBits? But that name sort of implies that we are filtering a tuple of Bit ns, while this actually deals with turning just a single Bit n into a ().
8ea4ba6 to
76a2d19
Compare
GitHub PR 729. Co-authored-by: Ravi Nanavati <ravi@matx.com> Co-authored-by: Julie Schwartz <quark@bluespec.com>
PR 883. Add Functor and Applicative type classes as superclasses of Monad. Remove 'return' from the Monad type class and make it an alias for 'pure'. Update b1894 test to not hardcode the def number. Co-authored-by: Julie Schwartz <quark@bluespec.com>
GitHub PR 893. reducePred optimization: filter out preds that can't possibly match before calling newInst. Sort preds by concreteness in satMany. Update test suite expected outputs due to sorted preds appearing in a different order.
- Include headers and footers when dumping to files, just like when dumping to stdout - Only overwrite a file the first time we dump to it in a run. Subsequent dumps append to the existing file. This means -dall=foo.txt collects everything instead of just the last dump.
so have them overwrite files to prevent double-dumps.
Some splitIf testcases compile a submodule. Previously, the submodule splitIf dump was overwritten so the testing code only saw the top-level dump. That changed when we started accumulating dumps, so we redirect each module's dump to a different file with %m.
FileName actually stores paths, so there is no need to make a distinction.
Previously, every file was parsed once to build the dependency graph and again for compilation. The dependency pass now returns the parsed packages so they can be passed directly to compilation. As part of this, parseFile is extracted into Depend.hs as a clean public API (no global side effects); parsing functions now return warnings instead of printing them directly; and compilePackage now owns setSyntax and the path encoding that used to live in compileFile. Side effects visible in test output: WFilePackageNameMismatch warnings now appear before "compiling ..." with a real source position instead of Unknown position, and duplicate warnings/dumps from the second parse are gone.
Dump headers and footers are now written unconditionally, whether a specific pass flag or -dall is in effect. This makes accumulated dumps in a single file readable without losing track of pass boundaries. Headers now include a coordinate (file, package, module, or package and module, whichever is most specific) so each section is identifiable.
(so the parse_pretty tests can share it)
So that generated CPP positions have an encoded absolute path. This also affects the macOS behavior, as the CPP parsers on various macOS versions handle relative paths differently.
The functions 'compile_with_deps' and 'compile_no_deps' are the two ways of compiling and they share the common 'compilePackage' function.
GitHub PR 888. Adds syntax for declaring type functions as members of typeclasses, based on the dependencies of the class. Re-implements SizeOf as a type function member of the Bits class, rather than as a primitive. Updates the evaluator to normalize types as it elaborates (as proposed in the closed GitHub PR 843), eliminating the need for a post-elaboration normalization pass (reverting GitHub PR 842). Refactors ISyntax substitution to provide a normalization function from the context. Adds a variety of tests for associated task functions, including new messages for error conditions. Documentation to come. Includes a cleanup for previous Functor PR, moving the Functor instance for Array into the Prelude, instead of the Array package.
GitHub PR 907. The Assert library now uses $fatal instead of $display and $finish. Bluesim tracks whether simulation terminated because of a call to $fatal, and has a new C API routine for testing this. It is exposed in the Bluetcl API and used to make the Bluetcl simulation exit with a failure status. The standalone template is similarly updated. Tests added, including a routine for checking the exit status of Verilog simulation.
This saves time when the evaluator needs to repeatedly evaluate undefined values at the same types.
…alues. Aggressively simplify empty tuples in ISimplify, remove unnecessary undefined values.
The .gitignore listed each generated pretty-out file individually, and TypeclassATF.bsv-pretty-out.bsv was missed when that test was added, causing it to be accidentally committed. Replace the per-file list with a *-pretty-out.bsv glob and remove the generated file.
Use the List_$Cons struct type with _1/_2 field IDs instead of PrimPair, and fix iConType arity from 2-arrow to 1-arrow to match the single struct argument.
This reverts commit 9d77afc.
GitHub PR 947 CtxReduce removes unnecessary contexts on top-level types. If the only uses of an imported package are in removed contexts, that should not trigger a warning. The check for uses needs to be before reduction. Testcase added for type alias, but the issue could occur for any type or typeclass defined in the imported package.
… ports. Everything but the vertices will be ignored when scheduling the uses.
The Bits#(i,_) provisos implied them and stating the proviso explicitly with a different type variable for the size relies on ctxreduce reducing the ZBit Bits proviso so that the typechecker doesn't complain about two bound variables being required to be equal.
The old lookup is still available with -legacy-inst-index for comparison
(and confirm the legacy lookup has exactly the same behavior)
b4653a8 to
7c3d707
Compare
7c3d707 to
a958c55
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request is based on the input port splitting branch on my fork of bsc, for the sake of reviewing without seeing the changes from B-Lang-org#729.