[ÅŻҹ©ºî]
¤Á¤ç¤Ã¤ÈÉÔ¿ÆÀڤʥá¥Ã¥»¡¼¥¸¤Ç¤¹¤¬¡¢¡Ö¥á¥â¥ê¤¬Â¤é¤Ê¤¤»þ¡×¤Ë½Ð¤Þ¤¹¡£
¥³¡¼¥É¤â¥Ç¡¼¥¿¤â¥³¥¢¤¢¤¿¤ê 64KB ¶¦Í¤Ê¤Î¤Ç¡¢
¥á¥â¥ê¤¬¥¹¥¿¥Ã¥¯Îΰè¤Þ¤Ç¹Ô¤¯¤È¡¢
Constraint check for node 0, core 0: Stack available: <00000000, used: 00000008 . FAILED Threads available: 8, used: 3 . OKAY Timers available: 10, used: 2 . OKAY Chanends available: 32, used: 0 . OKAY
¤Î¤è¤¦¤Ë¤ª¤³¤é¤ì¤Þ¤¹¡£
¥á¥â¥ê¤ò»È¤¤¤¹¤®¤Æ¤¤¤Ê¤¤¤«¡¢¸«Ä¾¤·¤Þ¤·¤ç¤¦¡£
chan ¤Ï´°Á´Æ±´ü¤Ç¡¢¼õ¤±¼è¤ê¦¤¬ÆþÎÏÂÔ¤Á¤Ç¤Ê¤¤¤È¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£°ìÊý¡¢streaming chan ¤Ï¥Ð¥Ã¥Õ¥¡¤ò»ý¤Ã¤Æ¤ª¤ê¡¢È󯱴ü¤Ç¥Ç¡¼¥¿¤ò¼õ¤±ÅϤ»¤Þ¤¹¡£
°ú¤¼è¤ê¦¤¬¤¤¤Ê¤¤¤È¤¤Î¥Ð¥Ã¥Õ¥¡¤ËÀè¹Ô¤·¤Æ²¡¤·¹þ¤á¤ë¥Ç¡¼¥¿¿ô¤Ï¡¢²¼µ¤Î¼Â¸³¤Ë¤è¤ë¤È¡¢2¥ï¡¼¥É(8 ¥Ð¥¤¥È)¤Þ¤Ç¤Ç¤¹¡£
¼Â¸³¥×¥í¥°¥é¥à
#include <xs1.h> #include <platform.h> #include <print.h> void produce(streaming chanend c) { int i=0 ; while(1) { c <: i ; printintln(i) ; i++ ; } } void consume(streaming chanend c) { int i=0 ; while(1){ i++ ; } } int main(void) { streaming chan c ; par { produce(c) ; consume(c) ; } return 0; }
¡¡¤³¤Î¥×¥í¥°¥é¥à¤Î½ÐÎÏ
0 1
¡¡¤ÇÄä»ß¤·¤Þ¤¹¡£
¡¡produce ¤Î c ¤Ë¥Ç¡¼¥¿¤ò¶ô¤ï¤»¤ë²Õ½ê¤ò
c <: (unsigned char) i ; ¢¨2013/1 (unsigned) ¤«¤é (unsigned char) ¤ËÄûÀµ
¡¡¤È¤¹¤ë¤È¡¢0...7 ¤ÇÄä»ß¤·¤Þ¤¹¡£
¡¡Í¾Ã̤Ǥ¹¤¬¡¢streaming channel ¤Ç 32bit ¤ò²¼²ó¤ë¥Ç¡¼¥¿¤ò¼è¤ê°·¤¦É½¸½¤ò select Æâ¤Ç»È¤¦¤È¡¢Exception ¤ÇÍî¤Á¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
¡¡¸½¥Ð¡¼¥¸¥ç¥ó(9.9.0)¤Î³«È¯´Ä¶¤¬ÅǤ¯¥³¡¼¥É¤Î¤»¤¤¤«¤È»×¤¤¤¬¤Á¤Ç¤¹¤¬¡¢¤É¤¦¤â»ÅÍͤΤ褦¤Ç¡¢»ñÎÁ¤Ë¤½¤ì¤é¤·¤µ½Ò¤¬¤¢¤ê¤Þ¤¹¡£¤¿¤À¤·¡¢¤³¤Á¤é¤Ë¤Ï "in the guard of a select statement." ¤È¸ÂÄêŪ¤Ë½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢»ä¤¬·Ð¸³¤·¤¿ Exception ¤È¤Ï°ã¤¦²ÄǽÀ¤â¤¢¤ê¤Þ¤¹¡£
Programming XC on XMOS Devices (2009/09/24 ÈÇ) ¤«¤é°úÍÑ
C.4 Channel Communication On some revisions of the XS1 architecture, it is not possible to input data of size less than 32 bits from a streaming channel in the guard of a select statement.
¡¡32bit °Ê²¼¤Î¥Ç¡¼¥¿¤ò¤ä¤ê¤È¤ê¤·¤Æ¤¤¤Æ¡¢¤É¤¦¤â¤¦¤Þ¤¯¤¤¤«¤Ê¤«¤Ã¤¿¤é¡¢¥Ç¥Ð¥Ã¥¬¤Ç¤½¤Î²Õ½ê¤Ç¤È¤Þ¤Ã¤Æ¤¤¤Ê¤¤¤«¡¢32bit ·¿¤Ë¤¹¤ë¤È¤¦¤Þ¤¯Æ°¤¤¤¿¤ê¤·¤Ê¤¤¤«¡¢»î¤·¤Æ¤ß¤ë¤È¤¤¤¤¤È»×¤¤¤Þ¤¹¡£
¥Á¥ã¥ó¥Í¥ë¤«¤é¤ÎÆþÎÏÂÔ¤Á¤Ï select ¤Ç¹Ô¤¨¤Þ¤¹¤¬¡¢½ÐÎϤ·¤Æ¤â¥Ö¥í¥Ã¥¯¤·¤Ê¤¤¤«¤É¤¦¤«¤Ï½ÐÎÏÊý¸þ¤Ë¤Ï select ¤¬»È¤¨¤Ê¤¤¤Î¤Ç¡¢¤ï¤«¤ê¤Þ¤»¤ó¡£
µÕÊý¸þ¤ÎÄÌ¿®¤¬¶õ¤¤¤Æ¤¤¤ë¤È¤¤Ï¡¢²¼µ¤ÎÎã¤Î¤è¤¦¤Ë¡¢¼õ¤±¤ë¦¤Ç¤¢¤é¤«¤¸¤áÆþÎϤǤ¤ë¤³¤È¤òÄÌÃΤ¹¤ë¤³¤È¤Ç¡¢½ÐÎϲÄǽ¸¡ºº¤òÆþÎÏÂÔ¤Á¤Î select ¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
[»²¹Í]http://www.xmoslinkers.org/forum/viewtopic.php?f=6&t=617
void consume( streaming chanend c ) { unsigned v; const unsigned ready = 0xff; while (1) { c <: ready; //ready to receive more c :> v; // get data now delay(100); // sample processing delay } } void produce( streaming chanend c ) { unsigned v = 100; while(1) select { case c :> int: c <: v; printstrln("Send"); break; default: /* put into buffer */ printstrln("buffer"); break; } }
¡Ö¤½¤Î£²¡×¤Ç²òÀ⤷¤¿¡¢£²¤Ä¤Î XS1-L1(XK1) ¤òÀܳ¤¹¤ë .XN ¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥³¡¼¥É¤¬¡¢9.9.1 ¤Ë´Þ¤Þ¤ì¤ë xflash ¤Î¥¨¥é¡¼¤Ç SPI ¥á¥â¥ê¤Ë¾Æ¤±¤Ê¤¤¤³¤È¤¬¤¢¤ë¤è¤¦¤Ç¤¹¡£
¶ñÂÎŪ¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Ç»ß¤Þ¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
portDeclsXC_a04656:32: error: use of `deviceSpecs' violates parallel usage rules portDeclsXC_a04656:28: error: previously used here (bytes 0..420) portDeclsXC_a04656:28: error: previously used here (bytes 0..420) Error: F03010 Failed to compile flasher app.
XMOS ¤Î¥µ¥Ý¡¼¥È¤ÎÊý¤Ë¥¨¥é¡¼Êó¹ðºÑ¤ß¤Ç¤¹(09/12/7)¡£
³Îǧ¤·¤Æ¤¤¤¿¤À¤¤¤¿¤è¤¦¤Ç¤¹¤Î¤Ç¡¢¼¡¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï²þÁ±¤µ¤ì¤Æ¤¤¤ë¤«¤È»×¤¤¤Þ¤¹¡Ê¡¦¢Ï¡¦¡Ë
¤¤¤Þ¤Þ¤Çµ¤¤Ë¤·¤Ê¤«¤Ã¤¿¤Î¤Ç¤¹¤¬¡¢¤Õ¤È¥¹¥¤¥Ã¥Á¤ò³°ÉÕ¤±¤·¤¿¤È¤¤Ë¡¢²£Ã夷¤Æ G ¤ÈƱÍÍ¤ËÆâ¢¥×¥ë¥¢¥Ã¥×¡Ê¥é¥¤¥Ö¥é¥ê¤Ë¥Ý¡¼¥È¤ËÂФ¹¤ëÁàºî¤¬Â¸ºß¤¹¤ë¡Ë¤ò»È¤ª¤¦¤È¤·¤Æ¡¢½é¤á¤Æµ¤¤Å¤¤Þ¤·¤¿¡£
¥é¥¤¥Ö¥é¥ê¥ê¥Õ¥¡¥ì¥ó¥¹¤Î set_port_pull_up() ¤Î¹à¤è¤ê°úÍÑ
On XS1-L devices no pull-up resistors are available and an exception will be raised if set_port_pull_up() is called.
µÕ¤Ë¡¢L ¤Ë¤Ï G ¤Ë¤Ï¸ºß¤·¤Ê¤¤Æâ¢¥×¥ë¥À¥¦¥ó¤¬¤¢¤ë¤è¤¦¤Ç¤¹¡£¥é¥¤¥Ö¥é¥ê¥ê¥Õ¥¡¥ì¥ó¥¹¤Î set_port_pull_down() ¤Î¹à¤è¤ê°úÍÑ
On XS1-G devices no pull-down resistors are¡¡ available and an exception will be raised if set_port_pull_down() is called.
Ãí°Õ¤¹¤Ù¤ÅÀ¤Ï¡¢L ¤Ç pull_up ¤ò¤·¤è¤¦¤È¤·¤¿¤ê¡¢G ¤Ç pull_down ¤ò¤·¤è¤¦¤È¤¹¤ë¤È Exception ¤¬È¯À¸¡á¥×¥í¥°¥é¥à¤¬Ää»ß¤·¤Þ¤¹¡£¤³¤ì¤Ï¥Ç¥Ð¥Ã¥¬¤Çư¤«¤·¤Æ¤¤¤Ê¤¤¤È¤Ê¤«¤Ê¤«µ¤¤Å¤«¤Ê¤¤¤Î¤Ç¡¢Í×Ãí°Õ¤Ç¤¹¡£
¡ã¡ãXMOS ¤Î XS1-G4 ¤Ç¤¢¤½¤Ö - ¤½¤Î£²¡¡|¡¡XMOS ¤Î XS1-G4,L1 ¤Ç¤¢¤½¤Ö - ¤½¤Î£´¡ä¡ä
¡¡¥«¥Æ¥´¥ê¡¡¡§¡¡¤â¤¯¤·¤¤¡Ã¥²¡¼¥à¡Ã¥ì¥·¥Ô¡Ã¥³¥ó¥Ô¥å¡¼¥¿¡Ã»¨Ê¸¡ÃÀ¸³è¡ÃÅŻҹ©ºî¡Ã¤ª¤¤¤·¤¤Å¹¥Þ¥Ã¥×
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Top¥Ú¡¼¥¸¤Ø¡¡|¡¡¤â¤Æ¤Ê¤¤SNS¡Ö¤â¤¯¤·¤¤¡×