-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
64d0914
commit 19a71fb
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
unittests/test_using_virtual_board/test_none_defaults/spynnaker.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Machine] | ||
version = None | ||
versions = ANY | ||
virtual_board = True | ||
machineName = None | ||
spalloc_server = None | ||
remote_spinnaker_url = None | ||
time_scale_factor = None | ||
enable_advanced_monitor_support = False | ||
|
||
[Buffers] | ||
use_auto_pause_and_resume = False | ||
|
||
[Mode] | ||
mode = All |
38 changes: 38 additions & 0 deletions
38
unittests/test_using_virtual_board/test_none_defaults/test_simple.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) 2017 The University of Manchester | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import pyNN.spiNNaker as sim | ||
from spinnaker_testbase import BaseTestCase | ||
|
||
|
||
class TestSimple(BaseTestCase): | ||
|
||
# NO unittest_setup() as sim.setup is called | ||
|
||
def test_simple(self): | ||
sim.setup(timestep=1.0, n_boards_required=1) | ||
machine = sim.get_machine() | ||
sim.set_number_of_neurons_per_core(sim.IF_curr_exp, 100) | ||
|
||
pop_1 = sim.Population(1, sim.IF_curr_exp(), label="pop_1") | ||
input_pop = sim.Population( | ||
1, sim.SpikeSourceArray(spike_times=[0]), label="input") | ||
input_proj = sim.Projection(input_pop, pop_1, sim.OneToOneConnector(), | ||
synapse_type=sim.StaticSynapse(weight=5, | ||
delay=1)) | ||
pop_1.record(["spikes", "v"]) | ||
simtime = 10 | ||
sim.run(simtime) | ||
pop_1.get_data(variables=["spikes", "v"]) | ||
sim.end() |