Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked socket code for FpgaPesEnsembleNetwork #52

Merged
merged 1 commit into from
Mar 10, 2020
Merged

Conversation

xchoo
Copy link
Member

@xchoo xchoo commented Mar 6, 2020

Motivation and context:
Rewrote socket code to improve communication speed between host PC and board. Also addressed error handling issues between the board and PC (either side can now be terminated by the other side now).

How has this been tested?
Tested with the various examples in the examples folder. Also tested by modifying the board side script to terminate prematurely, and by prematurely terminating the PC simulation and checking if the board side script terminates as well.

How long should this take to review?

  • Average (neither quick nor lengthy)

Where should a reviewer start?
Start with reviewing the FPGAPesNetwork file.

Types of changes:

  • Breaking change (fix or feature that causes existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING.rst document.
  • I have updated the documentation accordingly.
  • I have included a changelog entry.
  • I have tested this with all supported devices.
  • I have added tests to cover my changes.
  • I have run the test suite locally and all tests passed.

Still to do:

xchoo added a commit that referenced this pull request Mar 6, 2020
- Corrected PR link from #51 to #52.
Copy link
Contributor

@bmorcos bmorcos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was much simpler than I thought it would be 👍

fpga_config Outdated Show resolved Hide resolved
- Simplified socket code for
  FpgaPesEnsembleNetwork. Now uses basic python
  sockets instead of the sockets class.
- Moved the socket connection logic to the
  `connect` function instead of it being in the
  socket_node function. This corrects the
  Nengo simulation time progress bar as the
  udp connection now happens before the simulation
  starts.
- Modified socket node to use SimPyFunc instead
  of Nengo processes (SimPyFunc is faster).
- Removed `seed` parameter from SSH command.
- Added a 0.1s delay between the SSH client
  invocation and sending the SSH command string
  to the board. This is to allow the client to be
  properly loaded before the string is sent.
  Multiple back-to-back runs were occasionally
  throwing errors (could not connect to SSH
  client) without this delay.
- Removed sockets.py file. No longer in use.
- Made separate function for extracting and saving
  the network parameters to files. This is to
  simplify the build_FpgaPesEnsembleNetwork
  function.
- Moved udp_comm_func out of build function
  context and used functools.partial to
  call it from SimPyFunc.
- Make changelog formatting consistent
@bmorcos bmorcos merged commit 9955721 into master Mar 10, 2020
@bmorcos bmorcos deleted the socket_rework branch March 10, 2020 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants