Skip to content

Commit

Permalink
fixup! Add host SNIP for faster communication
Browse files Browse the repository at this point in the history
  • Loading branch information
hunse committed Oct 30, 2019
1 parent 5af0888 commit df56f68
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
47 changes: 0 additions & 47 deletions nengo_loihi/hardware/tests/test_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,50 +131,3 @@ def test_snip_input_count(Simulator, seed, plt):
with Simulator(model) as sim:
with pytest.warns(UserWarning, match="Too many spikes"):
sim.run(0.01)


@pytest.mark.target_loihi
def test_no_hang_on_exception(Simulator, seed):
def input_fn(t):
if 0.03 < t < 0.05:
raise RuntimeError("test_no_hang")

return t

with nengo.Network(seed=seed) as net:
u = nengo.Node(input_fn)
a = nengo.Ensemble(100, 1)
nengo.Connection(u, a)
nengo.Probe(a)

with pytest.raises(RuntimeError, match="test_no_hang"):
with nengo_loihi.Simulator(net, precompute=False) as sim:
sim.run(0.1)


@pytest.mark.target_loihi
def test_multiple_run_calls(Simulator, seed, plt):
"""Test that we can re-start the SNIPs for a second `run` call"""
# NOTE: probe synapses get applied at the end of `run`, so we keep probe
# synapses off and do our own filtering.

f = lambda t: np.sin(8 * np.pi * t)

with nengo.Network(seed=seed) as net:
nengo_loihi.set_defaults()

u = nengo.Node(f)
a = nengo.Ensemble(100, 1)
nengo.Connection(u, a, synapse=None)
ap = nengo.Probe(a)

with nengo_loihi.Simulator(net, precompute=False) as sim:
sim.run(0.1)
sim.run(0.15)

t = sim.trange()
x = f(sim.trange())
y = nengo.synapses.Alpha(0.01).filt(sim.data[ap], dt=sim.dt)
plt.plot(t, x)
plt.plot(t, y)
assert signals_allclose(t, x, y, atol=0.07, rtol=0.07, delay=0.024, plt=plt)
1 change: 0 additions & 1 deletion nengo_loihi/tests/test_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ def test_interface(Simulator, allclose):
sim.run(1e-8)


@pytest.mark.hang
@pytest.mark.target_loihi
def test_loihi_simulation_exception(Simulator):
"""Test that Loihi shuts down properly after exception during simulation"""
Expand Down

0 comments on commit df56f68

Please sign in to comment.