{"action":"created","comment":{"url":"https://api.github.com/repos/project-rig/rig/pulls/comments/25850177","id":25850177,"diff_hunk":"@@ -0,0 +1,179 @@\n+\"\"\"Constants used in the SCP protocol.\n+\"\"\"\n+import enum\n+\n+SCP_PORT = 17893  # TODO Reference spec\n+SCP_RECEIVE_LENGTH = 512\n+\"\"\"The smallest power of two large enough to handle the largest packet the\n+SpiNNaker SDP implementation can produce (256+8 bytes).\n+\"\"\"\n+\n+SCP_DATA_LENGTH = 256\n+\"\"\"Length of data that can be inserted into an SCP packet.\"\"\"\n+\n+SARK_DATA_BASE = 0x67800000\n+\"\"\"Base of buffer in SARK memory map.\"\"\"\n+\n+\n+class SCPCommands(enum.IntEnum):\n+    \"\"\"Command codes used in SCP packets.\"\"\"\n+    sver = 0  # Get the software version\n+    read = 2  # Read data\n+    write = 3  # Write data\n+\n+    nearest_neighbour_packet = 20  # Send a nearest neighbour packet\n+    signal = 22  # Transmit a signal to applications\n+    flood_fill_data = 23  # Transmit flood-fill data\n+\n+    led = 25  # Change the state of an LED\n+    iptag = 26  # Change/clear/get the value of an IPTag\n+\n+    alloc_free = 28  # Allocate or free SDRAM and routing_table entries\n+    router = 29  # Router related commands\n+\n+\n+class DataType(enum.IntEnum):\n+    \"\"\"Used to specify the size of data being read to/from a SpiNNaker machine\n+    over SCP.\n+    \"\"\"\n+    byte = 0\n+    short = 1\n+    word = 2\n+\n+\n+class LEDAction(enum.IntEnum):\n+    \"\"\"Indicate the action that should be applied to a given LED.\"\"\"\n+    on = 3\n+    off = 2\n+    toggle = 1\n+\n+\n+class IPTagCommands(enum.IntEnum):\n+    \"\"\"Indicate the action that should be performed to the given IPTag.\"\"\"\n+    set = 1\n+    get = 2\n+    clear = 3\n+\n+\n+class AllocOperations(enum.IntEnum):\n+    \"\"\"Used to allocate or free regions of SDRAM and routing table entries.\"\"\"\n+    alloc_sdram = 0  # Allocate a region of SDRAM\n+    free_sdram_by_ptr = 1  # Free a region of SDRAM with a pointer\n+    free_sdram_by_tag = 2  # Free a region of SDRAM with a tag and app_id\n+\n+    alloc_rtr = 3  # Allocate a region of routing table entries\n+    free_rtr_by_pos = 4  # Free routing table entries by index\n+    free_rtr_by_app = 5  # Free routing table entries by app_id\n+\n+\n+class RouterOperations(enum.IntEnum):\n+    \"\"\"Operations that may be performed to the router.\"\"\"\n+    init = 0\n+    clear = 1\n+    load = 2\n+    fixed_route_set_get = 3\n+\n+\n+class NNCommands(enum.IntEnum):\n+    \"\"\"Nearest Neighbour operations.\"\"\"\n+    flood_fill_start = 6\n+    flood_fill_end = 15\n+\n+\n+class NNConstants(enum.IntEnum):\n+    \"\"\"Constants for use with nearest neighbour commands.\"\"\"\n+    forward = 0x3f  # Forwarding configuration\n+    retry = 0x18  # Retry configuration\n+\n+\n+class AppFlags(enum.IntEnum):\n+    \"\"\"Flags for application loading.\"\"\"\n+    wait = 0x01\n+\n+\n+class AppState(enum.IntEnum):\n+    \"\"\"States that an application may be in.\"\"\"\n+    # Error states - further information may be available\n+    dead = 0\n+    power_down = 1\n+    runtime_exception = 2\n+    watchdog = 3\n+\n+    # General states\n+    init = 4  # Transitory \"(hopefully)\"\n+    ready = 5","path":"rig/machine_control/consts.py","position":104,"original_position":104,"commit_id":"c1f54b36bb1a3c056c3ca82db8fc4cd7549e6363","original_commit_id":"c1f54b36bb1a3c056c3ca82db8fc4cd7549e6363","user":{"login":"mossblaser","id":193514,"avatar_url":"https://avatars.githubusercontent.com/u/193514?v=3","gravatar_id":"","url":"https://api.github.com/users/mossblaser","html_url":"https://github.com/mossblaser","followers_url":"https://api.github.com/users/mossblaser/followers","following_url":"https://api.github.com/users/mossblaser/following{/other_user}","gists_url":"https://api.github.com/users/mossblaser/gists{/gist_id}","starred_url":"https://api.github.com/users/mossblaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossblaser/subscriptions","organizations_url":"https://api.github.com/users/mossblaser/orgs","repos_url":"https://api.github.com/users/mossblaser/repos","events_url":"https://api.github.com/users/mossblaser/events{/privacy}","received_events_url":"https://api.github.com/users/mossblaser/received_events","type":"User","site_admin":false},"body":"This state is called \"wait\" in sark.h. Further I would probably add:\r\n\r\n    # Awaiting SIG_START.","created_at":"2015-03-05T09:32:02Z","updated_at":"2015-03-05T09:32:02Z","html_url":"https://github.com/project-rig/rig/pull/29#discussion_r25850177","pull_request_url":"https://api.github.com/repos/project-rig/rig/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/project-rig/rig/pulls/comments/25850177"},"html":{"href":"https://github.com/project-rig/rig/pull/29#discussion_r25850177"},"pull_request":{"href":"https://api.github.com/repos/project-rig/rig/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/project-rig/rig/pulls/29","id":30086833,"html_url":"https://github.com/project-rig/rig/pull/29","diff_url":"https://github.com/project-rig/rig/pull/29.diff","patch_url":"https://github.com/project-rig/rig/pull/29.patch","issue_url":"https://api.github.com/repos/project-rig/rig/issues/29","number":29,"state":"open","locked":false,"title":"Refactor of SCP code","user":{"login":"mossblaser","id":193514,"avatar_url":"https://avatars.githubusercontent.com/u/193514?v=3","gravatar_id":"","url":"https://api.github.com/users/mossblaser","html_url":"https://github.com/mossblaser","followers_url":"https://api.github.com/users/mossblaser/followers","following_url":"https://api.github.com/users/mossblaser/following{/other_user}","gists_url":"https://api.github.com/users/mossblaser/gists{/gist_id}","starred_url":"https://api.github.com/users/mossblaser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossblaser/subscriptions","organizations_url":"https://api.github.com/users/mossblaser/orgs","repos_url":"https://api.github.com/users/mossblaser/repos","events_url":"https://api.github.com/users/mossblaser/events{/privacy}","received_events_url":"https://api.github.com/users/mossblaser/received_events","type":"User","site_admin":false},"body":"- [x] Application loading\r\n  - [x] Generating regions\r\n    - [x] Use lazy tree structure  -- __AM__: I don't remember this being a _requirement_\r\n    - [x] Have insane amounts of fun doing so -- This, of course, is\r\n  - [x] Loading from sets of applications\r\n  - [ ] **IMPORTANT** Test APLX and test suite with live board\r\n- [ ] Signal applications\r\n - [x] Change state\r\n - [ ] Query state\r\n- [ ] Load and retrieve router table entries\r\n - [x] Load\r\n - [ ] Retrieve\r\n- [x] Utility method for _reading_ struct values.","created_at":"2015-02-26T15:29:01Z","updated_at":"2015-03-05T09:32:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e329becaa81e07b8e664ada7fbc1768e7e7f142","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/project-rig/rig/pulls/29/commits","review_comments_url":"https://api.github.com/repos/project-rig/rig/pulls/29/comments","review_comment_url":"https://api.github.com/repos/project-rig/rig/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-rig/rig/issues/29/comments","statuses_url":"https://api.github.com/repos/project-rig/rig/statuses/c1f54b36bb1a3c056c3ca82db8fc4cd7549e6363","head":{"label":"project-rig:scp_refactor2","ref":"scp_refactor2","sha":"c1f54b36bb1a3c056c3ca82db8fc4cd7549e6363","user":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"repo":{"id":29497314,"name":"rig","full_name":"project-rig/rig","owner":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-rig/rig","description":"A set of tools for rigging SpiNNaker programs.","fork":false,"url":"https://api.github.com/repos/project-rig/rig","forks_url":"https://api.github.com/repos/project-rig/rig/forks","keys_url":"https://api.github.com/repos/project-rig/rig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-rig/rig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-rig/rig/teams","hooks_url":"https://api.github.com/repos/project-rig/rig/hooks","issue_events_url":"https://api.github.com/repos/project-rig/rig/issues/events{/number}","events_url":"https://api.github.com/repos/project-rig/rig/events","assignees_url":"https://api.github.com/repos/project-rig/rig/assignees{/user}","branches_url":"https://api.github.com/repos/project-rig/rig/branches{/branch}","tags_url":"https://api.github.com/repos/project-rig/rig/tags","blobs_url":"https://api.github.com/repos/project-rig/rig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-rig/rig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-rig/rig/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-rig/rig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-rig/rig/statuses/{sha}","languages_url":"https://api.github.com/repos/project-rig/rig/languages","stargazers_url":"https://api.github.com/repos/project-rig/rig/stargazers","contributors_url":"https://api.github.com/repos/project-rig/rig/contributors","subscribers_url":"https://api.github.com/repos/project-rig/rig/subscribers","subscription_url":"https://api.github.com/repos/project-rig/rig/subscription","commits_url":"https://api.github.com/repos/project-rig/rig/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-rig/rig/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-rig/rig/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-rig/rig/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-rig/rig/contents/{+path}","compare_url":"https://api.github.com/repos/project-rig/rig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-rig/rig/merges","archive_url":"https://api.github.com/repos/project-rig/rig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-rig/rig/downloads","issues_url":"https://api.github.com/repos/project-rig/rig/issues{/number}","pulls_url":"https://api.github.com/repos/project-rig/rig/pulls{/number}","milestones_url":"https://api.github.com/repos/project-rig/rig/milestones{/number}","notifications_url":"https://api.github.com/repos/project-rig/rig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-rig/rig/labels{/name}","releases_url":"https://api.github.com/repos/project-rig/rig/releases{/id}","created_at":"2015-01-19T21:20:40Z","updated_at":"2015-02-27T22:24:14Z","pushed_at":"2015-03-04T17:27:21Z","git_url":"git://github.com/project-rig/rig.git","ssh_url":"git@github.com:project-rig/rig.git","clone_url":"https://github.com/project-rig/rig.git","svn_url":"https://github.com/project-rig/rig","homepage":"","size":976,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"project-rig:master","ref":"master","sha":"cbbc13dfc286685109fbf8715b8d4cc895609c1c","user":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"repo":{"id":29497314,"name":"rig","full_name":"project-rig/rig","owner":{"login":"project-rig","id":11227885,"avatar_url":"https://avatars.githubusercontent.com/u/11227885?v=3","gravatar_id":"","url":"https://api.github.com/users/project-rig","html_url":"https://github.com/project-rig","followers_url":"https://api.github.com/users/project-rig/followers","following_url":"https://api.github.com/users/project-rig/following{/other_user}","gists_url":"https://api.github.com/users/project-rig/gists{/gist_id}","starred_url":"https://api.github.com/users/project-rig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-rig/subscriptions","organizations_url":"https://api.github.com/users/project-rig/orgs","repos_url":"https://api.github.com/users/project-rig/repos","events_url":"https://api.github.com/users/project-rig/events{/privacy}","received_events_url":"https://api.github.com/users/project-rig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-rig/rig","description":"A set of tools for rigging SpiNNaker programs.","fork":false,"url":"https://api.github.com/repos/project-rig/rig","forks_url":"https://api.github.com/repos/project-rig/rig/forks","keys_url":"https://api.github.com/repos/project-rig/rig/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-rig/rig/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-rig/rig/teams","hooks_url":"https://api.github.com/repos/project-rig/rig/hooks","issue_events_url":"https://api.github.com/repos/project-rig/rig/issues/events{/number}","events_url":"https://api.github.com/repos/project-rig/rig/events","assignees_url":"https://api.github.com/repos/project-rig/rig/assignees{/user}","branches_url":"https://api.github.com/repos/project-rig/rig/branches{/branch}","tags_url":"https://api.github.com/repos/project-rig/rig/tags","blobs_url":"https://api.github.com/repos/project-rig/rig/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-rig/rig/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-rig/rig/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-rig/rig/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-rig/rig/statuses/{sha}","languages_url":"https://api.github.com/repos/project-rig/rig/languages","stargazers_url":"https://api.github.com/repos/project-rig/rig/stargazers","contributors_url":"https://api.github.com/repos/project-rig/rig/contributors","subscribers_url":"https://api.github.com/repos/project-rig/rig/subscribers","subscription_url":"https://api.github.com/repos/project-rig/rig/subscription","commits_url":"https://api.github.com/repos/project-rig/rig/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-rig/rig/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-rig/rig/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-rig/rig/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-rig/rig/contents/{+path}","compare_url":"https://api.github.com/repos/project-rig/rig/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-rig/rig/merges","archive_url":"https://api.github.com/repos/project-rig/rig/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-rig/rig/downloads","issues_url":"https://api.github.com/repos/project-rig/rig/issues{/number}","pulls_url":"https://api.github.com/repos/project-rig/rig/pulls{/number}","milestones_url":"https://api.github.com/repos/project-rig/rig/milestones{/number}","notifications_url":"https://api.github.com/repos/project-rig/rig/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-rig/rig/labels{/name}","releases_url":"https://api.github.com/repos/project-rig/rig/releases{/id}","created_at":"2015-01-19T21:20:40Z","updated_at":"2015-02-27T22:24:14Z","pushed_at":"2015-03-04T17:27:21Z","git_url":"git://github.com/project-rig/rig.git","ssh_url":"git@github.com:project-rig/rig.git","clone_url":"https://github.com/project-rig/rig.git","svn_url":"https://github.com/project-rig/rig","homepage":"","size":976,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-rig/rig/pulls/29"},"html":{"href":"https://github.com/project-rig/rig/pull/29"},"issue":{"href":"https://api.github.com/repos/project-rig/rig/issues/29"},"comments":{"href":"https://api.github.com/repos/project-rig/rig/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/project-rig/rig/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/project-rig/rig/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-rig/rig/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/project-rig/rig/statuses/c1f54b36bb1a3c056c3ca82db8fc4cd7549e6363"}}}}