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

Locks and Multi fan-in and fan-out #195

Merged
merged 4 commits into from
Nov 10, 2022
Merged

Locks and Multi fan-in and fan-out #195

merged 4 commits into from
Nov 10, 2022

Conversation

Suhas-G
Copy link
Collaborator

@Suhas-G Suhas-G commented Oct 25, 2022

Issues:
Locks: When multiple writers are writing to same wire, its necessary to lock the shared memory while write is in progress.
Enable in FSM: In the case of FSMs, a block should be able to disable itself after it transitions to the next state. But the Enable wire of a block is an input block and not writeable by it. This PR changes this by giving a separate interface for enable wire as a property of the inputs block. And also allows the block to disable by setting inputs.enable = False to disable itself safely.
Multi Fan-in and Fan-out: When we have the scenario of multiple wires going to same input or same output having multiple wires to different inputs, we have to use the same underlying shared memory so that data can be modified correctly.

Copy link
Collaborator

@toshan-luktuke toshan-luktuke left a comment

Choose a reason for hiding this comment

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

Tested with:

  • Multiple inputs (2 - 3 wires coming in a single block)
  • Multiple outputs (2 - 3 wires going out of a single block)

Remaining:

  • FSM Testing with Enable

backend/staticfiles/synthesis/main.py Outdated Show resolved Hide resolved
@Suhas-G Suhas-G linked an issue Oct 27, 2022 that may be closed by this pull request
Co-authored-by: Toshan Luktuke <31101072+toshan-luktuke@users.noreply.github.com>
@toshan-luktuke
Copy link
Collaborator

I'm not able to figure out how the enable implementation is intended to work, I got it working but I had to make a few changes to the code here and there.
If possible can you give an example of the intended way to use it?

@Suhas-G
Copy link
Collaborator Author

Suhas-G commented Nov 4, 2022

Did the fsm structure with enable I showed work? Shall I merge this PR?

@toshan-luktuke
Copy link
Collaborator

Let's merge outputs.py and main.py. I've made some modifications to inputs.py to write to the Shared Memory like we discussed. Its better if I make a separate PR for that

@Suhas-G Suhas-G merged commit 88ceb49 into JdeRobot:master Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems with input/output when having multicable
2 participants