Skip to content

Commit

Permalink
Transition to Rig 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mundya committed Mar 29, 2016
1 parent 348303a commit 7e906ac
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 37 deletions.
Binary file modified nengo_spinnaker/binaries/nengo_ensemble.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_ensemble_profiled.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_filter.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_mc_player.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_rx.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_tx.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_value_sink.aplx
Binary file not shown.
Binary file modified nengo_spinnaker/binaries/nengo_value_source.aplx
Binary file not shown.
9 changes: 2 additions & 7 deletions nengo_spinnaker/scripts/nengo_spinnaker_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
# File automatically generated by nengo_spinnaker_setup.
[spinnaker_machine]
hostname: {hostname}
width: {width}
height: {height}
"""


def generate_config_file(filename, dimensions, ip_address):
def generate_config_file(filename, ip_address):
"""Generate a new config file with the specified filename and
parameters.
"""
Expand All @@ -32,8 +30,6 @@ def generate_config_file(filename, dimensions, ip_address):
with open(filename, "w") as f:
f.write(CONFIG_TEMPLATE.format(
hostname=ip_address,
width=dimensions[0],
height=dimensions[1],
))


Expand Down Expand Up @@ -65,8 +61,7 @@ def main(args=None):
"overwrite.".format(filename))
return 1

resp = wizard.cli_wrapper(wizard.cat(wizard.dimensions_wizard(),
wizard.ip_address_wizard()))
resp = wizard.cli_wrapper(wizard.ip_address_wizard())

if resp is None:
return 1
Expand Down
14 changes: 5 additions & 9 deletions nengo_spinnaker/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ def __init__(self, network, dt=0.001, period=10.0, timescale=1.0):

# Create a controller for the machine and boot if necessary
hostname = rc.get("spinnaker_machine", "hostname")
machine_width = rc.getint("spinnaker_machine", "width")
machine_height = rc.getint("spinnaker_machine", "height")

self.controller = MachineController(hostname)
self.controller.boot(machine_width, machine_height)
self.controller.boot()

# Create the IO controller
io_cls = getconfig(network.config, Simulator, "node_io", Ethernet)
Expand Down Expand Up @@ -171,12 +169,10 @@ def __init__(self, network, dt=0.001, period=10.0, timescale=1.0):
))

logger.info("Setting router timeout to 16 cycles")
for x in range(machine_width):
for y in range(machine_height):
with self.controller(x=x, y=y):
if (x, y) in system_info:
data = self.controller.read(0xf1000000, 4)
self.controller.write(0xf1000000, data[:-1] + b'\x10')
for x, y in system_info.chips():
with self.controller(x=x, y=y):
data = self.controller.read(0xf1000000, 4)
self.controller.write(0xf1000000, data[:-1] + b'\x10')

def __enter__(self):
"""Enter a context which will close the simulator when exited."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_new_url(url):
keywords="spinnaker nengo neural cognitive simulation",

# Requirements
install_requires=["nengo>=2.0.0, <3.0.0", "rig>=0.12.2, <1.0.0",
install_requires=["nengo>=2.0.0, <3.0.0", "rig>=1.0.0, <2.0.0",
"bitarray>=0.8.1, <1.0.0"],
zip_safe=False, # Partly for performance reasons

Expand Down
7 changes: 4 additions & 3 deletions spinnaker_components/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Code for SpiNNaker executables
==============================

The SpiNNaker executables require `spinnaker_tools` v1.3.3 as released by Steve
Temple to build. If this is available then, after sourcing the `setup` file in
the `spinnaker_tools` directory and making `sark` and `spin1_api` the Nengo
The SpiNNaker executables require [`spinnaker_tools`
v2.0.1](http://apt.cs.manchester.ac.uk/projects/SpiNNaker/downloads/) to build.
If this is available then, after sourcing the `setup` file in the
`spinnaker_tools` directory and making `sark` and `spin1_api` the Nengo
executables may be built by calling `make` in this directory.
11 changes: 0 additions & 11 deletions spinnaker_components/common/spin1_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@

uint32_t simulation_ticks = 0; // TODO: Remove this

// XXX: Will be included as part of next version of SCAMP/SARK
// Get a pointer to a tagged allocation. If the "app_id" parameter is zero
// uses the core's app_id.
void *sark_tag_ptr (uint tag, uint app_id)
{
if (app_id == 0)
app_id = sark_vec->app_id;

return (void *) sv->alloc_tag[(app_id << 8) + tag];
}

address_t system_load_sram()
{
// Get the block of SDRAM associated with this core and application ID.
Expand Down
8 changes: 2 additions & 6 deletions tests/scripts/test_nengo_spinnaker_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ def test_generate_config_file():
fileno, filename = tempfile.mkstemp()
print(filename)

generate_config_file(filename, dimensions=(4, 8),
ip_address="127.0.0.1")
generate_config_file(filename, ip_address="127.0.0.1")

with open(filename, "r") as f:
config = f.read()
os.remove(filename)

assert "[spinnaker_machine]\n" in config
assert "hostname: 127.0.0.1\n" in config
assert "width: 4\n" in config
assert "height: 8\n" in config


def test_bad_main(monkeypatch):
Expand All @@ -51,8 +48,7 @@ def test_bad_main(monkeypatch):

def test_main(monkeypatch):
# Check that questions are asked and a config file generated
mock_cli_wrapper = Mock(return_value={"dimensions": (2, 2),
"ip_address": "127.0.0.1"})
mock_cli_wrapper = Mock(return_value={"ip_address": "127.0.0.1"})
monkeypatch.setattr(wizard, "cli_wrapper", mock_cli_wrapper)

# Temporarily any existing project config file out of the way
Expand Down

0 comments on commit 7e906ac

Please sign in to comment.