back.pysim: allow suspending processes until a tick in a domain.
This commit is contained in:
parent
3e59d857e1
commit
d791b77cc8
3 changed files with 39 additions and 13 deletions
|
|
@ -10,7 +10,7 @@ from ..tools import *
|
|||
__all__ = [
|
||||
"Value", "Const", "Operator", "Mux", "Part", "Slice", "Cat", "Repl",
|
||||
"Signal", "ClockSignal", "ResetSignal",
|
||||
"Statement", "Assign", "Switch", "Delay", "Passive",
|
||||
"Statement", "Assign", "Switch", "Delay", "Tick", "Passive",
|
||||
"ValueKey", "ValueDict", "ValueSet",
|
||||
]
|
||||
|
||||
|
|
@ -704,6 +704,17 @@ class Delay(Statement):
|
|||
return "(delay {:.3}us)".format(self.interval * 10e6)
|
||||
|
||||
|
||||
class Tick(Statement):
|
||||
def __init__(self, domain):
|
||||
self.domain = str(domain)
|
||||
|
||||
def _rhs_signals(self):
|
||||
return ValueSet()
|
||||
|
||||
def __repr__(self):
|
||||
return "(tick {})".format(self.domain)
|
||||
|
||||
|
||||
class Passive(Statement):
|
||||
def _rhs_signals(self):
|
||||
return ValueSet()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue