-
Notifications
You must be signed in to change notification settings - Fork 12
Value circuits new #36
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
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
36c873b
Fix dropping of error locations
cchalmers 6b88435
Add error-location regression test
cchalmers 4849612
First version of value circuits
cchalmers 7a02cb3
More testing of value circuits (with a bug fix)
cchalmers 7b428ff
Make sure the tests pass on all GHC versions
cchalmers e99bc83
Add the multi-domain to circuitS by minimally grouping
cchalmers 2aa3f11
Change name to circuitV
cchalmers 2a1bb94
Make a new SignalBus class for handling Fwd with circuitV
cchalmers 0e6d5d8
Fix poly-kinded issue
cchalmers f0c5fa0
Switch to using SignalV at the pattern instead of circuitV
cchalmers 0a88fdd
Add support for DSignalV
cchalmers f2643a8
Make Signal and DSignal enforce types
cchalmers 10ba3c1
Lower value-group inputs lazily
cchalmers 611c6e0
Trim the value-level ports changelog entry
cchalmers 58ff61d
Extend SignalBus and supporting instances to 12-tuples
cchalmers 17d3436
Blame whole-bundle type errors on the ports' span
cchalmers ff4075d
Add write-ghc-environment-files to cabal.project
cchalmers d69c300
Use register instead of Signal internals in error fixtures
cchalmers 231cf56
Refine value ports: dead groups, let pragmas, as-patterns
cchalmers 34d8e80
Fix AsPat arity for GHC < 9.12
cchalmers 89d84d0
Correct AsPat arity boundary to GHC 9.10
cchalmers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,54 @@ | ||
| # Revision history for `circuit-notations` | ||
|
|
||
| ## 0.3.0.0 -- Unreleased | ||
|
|
||
| * Add value-level ports via the new `SignalV` and `FwdV` markers in | ||
| `circuit` blocks. The circuit's logic is written over the values sampled | ||
| each clock cycle; the plugin lifts it back to the signal level with | ||
| `fmap`/`bundle`/`unbundle` and ties feedback loops with a lazy let | ||
| binding. The bus-level markers still bind the raw forward channel and mix | ||
| freely with value markers in one block; `Fwd` works on any bus, while the | ||
| bus-level `Signal` (and new `DSignal`) markers now additionally enforce | ||
| the bus type, which also drives type inference. See the README and | ||
| example/ValueCircuits.hs. | ||
|
|
||
| A block can span several clock domains: the value-level bindings are | ||
| split into groups connected by shared variables and each group is lifted | ||
| with its own `fmap`/`bundle`/`unbundle`, so only buses whose values | ||
| actually meet must share a domain. Sharing a value across domains is | ||
| rejected by the type checker. Lets that don't touch value land stay at | ||
| the bus level, so let-bound sub-circuits can be used with `-<`. | ||
|
|
||
| The value markers have distinct semantics: `SignalV x` asserts the | ||
| bus is a `Signal` (best inference — it works against fully generic | ||
| sub-circuits); `FwdV x` samples/drives the forward channel of any | ||
| signal-like bus via the new `SignalBus` class (`Signal`s, `Vec`s and | ||
| tuples of them, custom buses) but needs the bus type determined by | ||
| context; and `DSignalV x` is `SignalV` for delayed signals — the delay | ||
| index is part of the bus type, so a logic group's values must all sit at | ||
| the same pipeline depth, and its outputs are produced at that depth. | ||
| Mixing plain and delayed markers in one group is reported by the plugin. | ||
|
|
||
| The value boundary is generated with the new `SigTag`, `FwdTag` and | ||
| `DSigTag` pattern synonyms (`Circuit` module); `SigTag`/`DSigTag` pin the | ||
| bus type so that type inference survives nested circuits (the `Fwd` | ||
| family is not injective) and "too shallow" `SignalV` markers report a | ||
| direct `Vec`-vs-`Signal` style mismatch. **Breaking**: `ExternalNames` | ||
| gained `signalTagName`, `fwdTagName` and `dSignalTagName` fields, so | ||
| custom plugins (e.g. clash-protocols style) need to supply them — | ||
| `defExternalNames` is now exported so they can be record updates of the | ||
| defaults. | ||
| * Add a per-GHC `checks` output to the flake, so `nix flake check` (or | ||
| `nix build .#checks.<system>.<ghc>`) builds the package and runs all test | ||
| suites against every supported GHC. The CI nix job now uses it. The | ||
| error-location test suite skips itself (with a message) when the ambient | ||
| `ghc` has no circuit-notation package registered — as during a plain nix | ||
| build of the package, where it previously failed. | ||
| * Fix the source location of type errors on a bus. Since bus tagging was | ||
| introduced, such errors pointed at the end of the `circuit` block rather than | ||
| at the offending statement. Generated bindings are now located at their | ||
| circuit expression so GHC blames the right line. | ||
|
|
||
| ## 0.2.0.0 -- 2026-04-23 | ||
|
|
||
| * Start of the changelog | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.