Skip to content
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

ClockSignal/ResetSignal cannot be used on LHS #8

Closed
cr1901 opened this issue Dec 16, 2018 · 0 comments
Closed

ClockSignal/ResetSignal cannot be used on LHS #8

cr1901 opened this issue Dec 16, 2018 · 0 comments
Labels
Milestone

Comments

@cr1901
Copy link
Contributor

cr1901 commented Dec 16, 2018

The statement m.comb += ResetSignal().eq(0) can be used in principle to tie the reset signal of a clock domain low (and remove the rst signal from the top-level port list). However, as-is a backtrace similar to the following results:

William@William-THINK MINGW64 ~/src/migen_mercury/baseboard
$ python3 baseboard.py
Traceback (most recent call last):
  File "baseboard.py", line 373, in <module>
    m.comb += ResetSignal().eq(0)
  File "C:/msys64/home/william/src/nmigen\nmigen\tools.py", line 52, in wrapper
    return f(*args, **kwargs)
  File "C:/msys64/home/william/src/nmigen\nmigen\compat\fhdl\module.py", line 32, in __iadd__
    self._cm._module._add_statement(assigns, domain=None, depth=0, compat_mode=True)
  File "C:/msys64/home/william/src/nmigen\nmigen\hdl\dsl.py", line 248, in _add_statement
    for signal in assign._lhs_signals():
  File "C:/msys64/home/william/src/nmigen\nmigen\hdl\ast.py", line 813, in _lhs_signals
    return self.lhs._lhs_signals()
  File "C:/msys64/home/william/src/nmigen\nmigen\hdl\ast.py", line 194, in _lhs_signals
    raise TypeError("Value {!r} cannot be used in assignments".format(self))
TypeError: Value (rst sync) cannot be used in assignments

Workaround for the time being is to manually declare the clock domain with reset_less=True.

@whitequark whitequark added the bug label Dec 16, 2018
@whitequark whitequark changed the title Tying ResetSignal to Constant Value results in backtrace. Tying ResetSignal to Constant Value results in exception Dec 18, 2018
@whitequark whitequark changed the title Tying ResetSignal to Constant Value results in exception ClockSignal/ResetSignal cannot be used on LHS Jan 8, 2019
@whitequark whitequark added this to the 0.1 milestone Jun 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants