-
Notifications
You must be signed in to change notification settings - Fork 58
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: m-labs/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8b05b28f5a7c
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75d0fcd639ae
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 2 commits
- 13 files changed
- 1 contributor
Commits on Oct 26, 2019
-
hdl.ir: allow disabling UnusedElaboratable warning in file scope.
This warning is usually quite handy, but is problematic in tests: although it can be suppressed by using Fragment.get on elaboratable, that is not always possible, in particular when writing tests for exceptions raised by __init__, e.g.: def test_wrong_csr_bus(self): with self.assertRaisesRegex(ValueError, r"blah blah"): WishboneCSRBridge(csr_bus=object()) In theory, it should be possible to suppress warnings per-module and even per-line using code such as: import re, warnings from nmigen.hdl.ir import UnusedElaboratable warnings.filterwarnings("ignore", category=UnusedElaboratable, module=re.escape(__name__)) Unfortunately, not only is this code quite convoluted, but it also does not actually work; we are using warnings.warn_explicit() because we collect source locations on our own, but it requires the caller to extract the __warningregistry__ dictionary from module globals, or warning suppression would not work. Not only is this not feasible in most diagnostic sites in nMigen, but also I never got it to work anyway, even when passing all of module, registry, and module_globals to warn_explicit(). Instead, use a magic comment at the start of a file to do this job, which might not be elegant but is simple and practical. For now, only UnusedElaboratable can be suppressed with it, but in future, other linter parameters may become tweakable this way.
whitequark committedOct 26, 2019 Configuration menu - View commit details
-
Copy full SHA for 9786d0c - Browse repository at this point
Copy the full SHA 9786d0cView commit details -
test: use
#nmigen:
magic comment instead of monkey patch.Also, fix missing and incorrect src_loc_at arguments where appropriate so the testsuite passes without warnings.
whitequark committedOct 26, 2019 Configuration menu - View commit details
-
Copy full SHA for 75d0fcd - Browse repository at this point
Copy the full SHA 75d0fcdView commit details
There are no files selected for viewing