Hi,
can I implement custom select cases e.g. by using inline assembly? I want to wait for a channel end to become ready but not let XC do the usual handshake (INCT, OUTCT...).
Thanks in advance.
Custom select cases
-
- Experienced Member
- Posts: 94
- Joined: Tue Apr 27, 2010 10:55 pm
-
- Respected Member
- Posts: 318
- Joined: Tue Dec 15, 2009 12:46 am
You can use the byref builtins defined in in xs1.h in select cases. This builtins translate directly to single instructons, there will be no handshake. For example:
What are you trying to achieve? Streaming channels also allow communication with handshaking. These may be more appropriate depending on what you want to do.
Code: Select all
case inuint_byref(c, value):
...
break;
-
- Experienced Member
- Posts: 94
- Joined: Tue Apr 27, 2010 10:55 pm
Thanks, I'll try it as soon as I finished the code snippet I'm working on. It seems it may be useful to dig a bit more in the header files :)
To make it shorter: I'll go on and play around with this stuff by myself. Don't want to keep you from you work with more questions, at least not now :)
Regards,
Thomas
To say it in BSD sockets words: Want to communicate not in the connect + send way but in the sendto way for IPC. I did it in assembly before, it worked very well. When I switched to XC (the select statement looks much better then assembly), I noticed that there is a handshake token sent be the receiver channel end to the other channel end. And if the sender is a third channel end, the response token goes to the "wrong" channel end.What are you trying to achieve?
To make it shorter: I'll go on and play around with this stuff by myself. Don't want to keep you from you work with more questions, at least not now :)
Regards,
Thomas
-
- Experienced Member
- Posts: 94
- Joined: Tue Apr 27, 2010 10:55 pm
Great, it works now, exactly what I want.
Still need some inline assembly for this and that, but xs1.h contains many functions which make it easier to use low-level features of the XMOS.
Regards,
Thomas
Still need some inline assembly for this and that, but xs1.h contains many functions which make it easier to use low-level features of the XMOS.
Regards,
Thomas