Skip to content

Instantly share code, notes, and snippets.

@Arachnid
Created July 24, 2015 10:31
Show Gist options
  • Save Arachnid/82d48e56fd9ff231c747 to your computer and use it in GitHub Desktop.
Save Arachnid/82d48e56fd9ff231c747 to your computer and use it in GitHub Desktop.
def manipulate_signals(a, b):
sum = Signal(0)
product = Signal(0)
@logic
def add():
sum.value = a.value + b.value
@logic
def multiply():
product.value = sum.value * a.value
return product
def test_signals():
a = Signal(0)
b = Signal(0)
result = manipulate_signals(a, b)
a.value = 10
b.value = 20
assert result.value == 300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment