±¾ÎÄÉè¼ÆÁË1553B×ÜÏßÉϵÄÍøÂç´æ´¢Æ÷¡£Õû¸öϵͳ»ùÓÚNIOS IIÄÚºËÉè¼Æ£¬ÀûÓÃSoPC¼¼Êõ½«½Ó¿Ú²¿·ÖµÄÂß¼¿ØÖÆÈ«²¿¼¯³ÉÓÚFPGAƬÄÚ£¬ÏµÍ³µÄ´æ´¢Á¿¡¢½áµãÊýÁ¿¾ù¿ÉÀ©Õ¹¡£
20ÊÀ¼Í70Äê´úµ®ÉúµÄ1553B×ÜÏߣ¬ÊÇÒ»ÖÖÖ÷´Óʽ¶àÓà¶È×ÜÏߣ¬¶Ô×ÜÏßÓ²¼þÓÐÑϸñµÄ¹æ¶¨£¬¿É¿¿ÐÔºÍʵʱÐԺã¬ÒѾ³ÉΪµ±½ñ¾üÓõç×Ó×ÜÏßµÄÊ×Ñ¡¡£ÀàËÆÓÚÒÔÌ«Íø£¬1553B×éÍøÖÐÒ²ÓГÍøÂçÓ²ÅÌ”ÕâÑùµÄ´æ´¢ÐèÇó£¬À´¼õÇá±¾µØµÄ´æ´¢Ñ¹Á¦£¬²¢¿É×÷ΪÊý¾ÝÖм̹©ÆäËû²¿·ÖÉõÖÁÆäËû×éÍøʹÓá£
Nios IIǶÈëʽ´¦ÀíÆ÷ÊÇAltera¹«Ë¾ÓÚ2004Äê6ÔÂÍƳöµÄµÚ¶þ´úÓÃÓڿɱà³ÌÂß¼Æ÷¼þµÄ¿ÉÅäÖõÄÈíºË´¦ÀíÆ÷£¬ÐÔÄܳ¬¹ý200 DMIPS¡£Nios IIÊÇ»ùÓÚ¹þ·ð½á¹¹µÄRISCͨÓÃǶÈëʽ´¦ÀíÆ÷ÈíºË£¬ÄÜÓëÓû§Âß¼Ïà½áºÏ£¬±à³ÌÖÁAlteraµÄFPGAÖС£´¦ÀíÆ÷¾ßÓÐ32λָÁ£¬32λÊý¾ÝͨµÀºÍ¿ÉÅäÖõÄÖ¸ÁîÒÔ¼°Êý¾Ý»º³å¡£ËüÌرðΪ¿É±à³ÌÂß¼½øÐÐÁËÓÅ»¯Éè¼Æ£¬Ò²Îª¿É±à³Ìµ¥Ð¾Æ¬ÏµÍ³£¨SoPC£©Éè¼ÆÁËÒ»Ì××ۺϽâ¾ö·½°¸¡£
ϵͳ×ÜÌå·½°¸
±¾ÏµÍ³µÄÖ÷Òª¹¦ÄÜΪ½ÓÊÕ1553BÍøÂç·¢À´µÄÃüÁî¡¢Êý¾Ý£¬¹ÜÀíºó¼¶´æ´¢Æ÷£¬Ìṩһ¸ö·Ã ÎÊ´æ´¢Æ÷µÄÍøÂç½Ó¿Ú¡£ÏµÍ³µÄ´æ´¢Æ÷½Ó¿Ú×÷Ϊ1553B×ÜÏßÖеĴӽáµã£¬Æ½Ê±´¦ÓÚ´ý»ú״̬£¬µ±×ÜÏßÉÏÓжÁдÃüÁî·¢À´Ê±£¬×ÜÏßת»»½Ó¿Ú¸ù¾ÝÃüÁî´Óºó¼¶´æ´¢Æ÷¶ÁÈ¡Êý¾Ý»òÏòÆäдÈëÊý¾Ý¡£¶ÔÓÚ×ÜÏßÐÒ飬×î·½±ãµÄÊÇʹÓÃÏֳɵÄÐÒéоƬ£¬µ«ÕâÑù×öµÄ³É±¾·Ç³£¸ß£¬1553BÐÒéоƬµÄµ¥Æ¬¼Û¸ñÔÚ6000ÔªÒÔÉÏ£¬Õâ¶ÔÓÚÆÕͨӦÓÃÀ´ËµÊÇÒ»¸ö²»Ð¡µÄ¸ºµ££¬Èç¹ûÄÜʹÓÃFPGA½øÐÐÐÒé¹ÜÀí£¬½«Ê¹³É±¾´ó´ó½µµÍ£¬ÁíÍ⣬QuartusÄÚ°üº¬Óкܶà´æ´¢Æ÷¹ÜÀíµÄIPºË¿É¹©Ê¹Ó㬶ÔÓÚ1553BµÄÐÒéÔòÐèÒª×ÔÐж¨ÖÆ×é¼þ¡£
ϵͳ³ÌÐòΪÁ½²¿·Ö£¬Ò»²¿·ÖΪ½ÓÊÜÍøÂçÃüÁî¼°Êý¾Ý£¬ÁíÒ»²¿·ÖΪ´æ´¢Æ÷µÄ¶Áд¡£ÔÚNIOS IDE»·¾³ÖУ¬Ê¹ÓÃCÓïÑÔ×÷Ϊ±à³ÌÓïÑÔ¡£
ϵͳӲ¼þÉè¼Æ
ϵͳµÄÓ²¼þÄ£¿é¿òͼ¼ûͼ1Ëùʾ¡£
ͼ1 ϵͳӲ¼þ½á¹¹¿òͼ
ϵͳµÄºËÐÄоƬ²ÉÓÃAltera¹«Ë¾µÄCYCLONE IIIϵÁÐFPGA EP3C25F324¡£Ëü²ÉÓÃÁË65nmµÍ¹¦ºÄ¹¤ÒÕ¼¼Êõ½øÐÐÉú²ú£¬Æ伯³É¶È¼°ÐÔÄÜÓÐÁËÃ÷ÏÔµØÌá¸ß£¬µ«¹¦ºÄÈ´·Ç³£µÍ£¬¼ÓÉÏCYCLONEϵÁÐÒ»Ö±¶¨Î»Óڵͳɱ¾Æ÷¼þ£¬Ð¾Æ¬ÕûÌåµÄÐԼ۱Ⱥܸߡ£
ͨ¹ýQuartus II 7.2¼¯³ÉµÄSOPCÈí¼þÏòFPGAÄÚ²¿ÒÆÖ²Nios IIÄںˣ¬ËùÐè×é¼þÈçÏ¡£
CPU£ºÑ¡Óñê×¼ÐÍCPUºË£¬DebuggerΪLevel 1£¬ÔÚÂú×ãÐèÇóµÄÇé¿öϾ¡Á¿½ÚԼƬÄÚ×ÊÔ´µÄʹÓá£
System_ID£ºÏÂÔØʱϵͳÈÏ֤ʱʹÓá£
Jtag_uart£ºFPGAÓëPCµÄͨÐŽӿڣ¬NIOS IDEÈí¼þÖÐʹÓûáºÜ·½±ã¡£
onchip_memory£ºÆ¬ÄÚ´æ´¢Æ÷£¬ÖÐתÊý¾ÝʱʹÓá£
FLASH£ºQuartusÈí¼þÄÚ²¿¼¯³É
ÓÐIntel¹«Ë¾Éú²úµÄ128P308µÄ¿ØÖÆ×é¼þ£¬±ãÓÚ¿ª·¢£¬ÈôÐèÒª¸ü´óÁ¿µÄ´æ´¢£¬¼Ó´óFLASHÈÝÁ¿¼´¿É£¬Èç¹ûÓÐÐèÒª£¬¿É¶à¹Ò¼¸Æ¬¡£
FLASH_Bus£ºFLASHµÄÊý¾ÝÊÇÈý̬µÄ£¬ÐèÒªÔÚCPUºÍFLASHÖ®¼ä¼ÓÈëAvalonÈý̬×ÜÏßÇÅ¡£
1553B½Ó¿Ú×é¼þ£ºÓëÍⲿ1553B×ÜÏßͨÐŵĽӿڣ¬QuartusÈí¼þÄÚ²¿Î´¼¯³ÉÓиÃ×é¼þ£¬ÐèÒª×ÔÐпª·¢¡£
ÔÚ1553BµÄÍøÂçÉÏ£¬±¾ÏµÍ³ÊÇ×÷Ϊ´Ó½áµãÉè¼ÆµÄ¡£ÔÚϵͳÄÚ²¿£¬1553BµÄ½Ó¿Ú×é¼þÐèÒª×÷ΪAlavon×ÜÏßÉϵÄÖ÷¶Ë¿Ú£¬ÆäÓà´æ´¢Æ÷¿ØÖÆÄ£¿é×÷Ϊ´Ó¶Ë¿Ú¡£ÓÉÓÚÆäÓàµÄ¶Ë¿ÚÔÚQuartusÈí¼þÄÚ²¿¾ùÓм¯³É£¬ËùÒÔ£¬ÏµÍ³Èí¼þÉè¼ÆµÄÖ÷Òª¹¤×÷Á¿¾ÍÊÇ1553B½Ó¿ÚµÄ×é¼þ¿ª·¢¡£
´æ´¢Ð¾Æ¬²ÉÓÃIntel¹«Ë¾Éú²úµÄ128P308µÄFLASHоƬ£¬·ûºÏͨÓýӿڱê×¼£¬±ãÓÚºóÐø¹¦ÄÜÈÝÁ¿µÄ¸üÐÂÉý¼¶¡£
ϵͳÈí¼þÉè¼Æ
¶¨ÖÆ1553B×é¼þµÄºËÐÄÈÎÎñ¾ÍÊǽ«1553BµÄ×ÜÏßÐźÅת»»µ½NIOS IIÄÚ²¿µÄAvalon×ÜÏßÉÏ¡£
1553B×é¼þ×÷ΪAvalon×ÜÏßÉϵÄÖ÷¶Ë¿Ú£¬Ñ¡ÓõÄÐźÅÓÐclk¡¢address¡¢read¡¢write¡¢data¡¢irq¡¢reset¡¢irqnumberµÈ¡£´«Ê䷽ʽΪ»ù±¾µÄÖ÷¶Ë¿Ú¶Á´«ÊäºÍд´«Êä¡£²úÉúÕâЩÐźžÍÐèÒª´Ó1553B×ÜÏßÉ϶ÁÈ¡µÄÖ¡ÐźÅÀ´ÊµÏÖ¡£1553B×ÜÏßÉϹ²ÓÐÈýÖÖÖ¡£¬ÃüÁîÖ¡¡¢×´Ì¬Ö¡ºÍÊý¾ÝÖ¡¡£ÕâÈýÖÖÖ¡µÄ½á¹¹Èçͼ2Ëùʾ¡£
ͼ2 1553B×ÜÏßµÄÈýÖÖÖ¡½á¹¹
¶ÔÓÚÕâÈýÖÖÖ¡£¬ÃüÁîÖ¡¡¢Êý¾ÝÖ¡ºÍ״̬֡¿ÉÒÔʹÓÃͬһ¸ö»º´æ£¬ÒòΪ×÷Ϊ´æ´¢µÄ´Ó½áµã²»»áÖ÷¶¯ÏòÖ÷½áµã·¢ËÍÊý¾Ý£¬Õû¸ö¹¤×÷¶¼ÊDZ»¶¯½ÓÊÕÖ÷½áµãµÄÃüÁµÈ´ýÖ÷½áµã¶ÁÈ¡»òдÈëÊý¾Ý£¬ÏµÍ³Ö»Óе¥Ò»µÄ״̬£¬²»»á³öÏÖ³åÍ»¡£
¶ÔÓÚAvalon×ÜÏßÖеÄÐźţ¬¶ÔÓ¦ÓÚÖ¡ÄÚÐźŹØϵÈçÏ¡£
read/writeÐźţºÃüÁîÖ¡Äڵķ¢ËÍ/½ÓÊÕλ¡£
addressÐźţºÃüÁîÖ¡ÄÚµÄ×ÓµØÖ·ÒÔ¼°Êý¾Ý³¤¶Èλ¡£
dataÐźţºÊý¾ÝÖ¡ÄÚµÄÊý¾Ýλ¡£
irqÐźţº×´Ì¬Ö¡Äڵıê־λÒýÆð¡£
irqnumberÐźţº×´Ì¬Ö¡ÄڵľßÌåλÖá£
1553B×é¼þµÄAPIº¯Êý°üÀ¨ÓУº
altera_avalon_1553B_init()
altera_avalon_1553B_enable()
altera_avalon_1553B_disable()
altera_avalon_1553B_getframe()
altera_avalon_1553B_sendframe()
ÆäÓඨÖÆ×é¼þµÄ²½Öè²»ÔÙ׸Êö¡£½«×é¼þͨ¹ýSoPC¶¨ÒåÍê³Éºó£¬ÃüÃûΪ1553B£¬Ìí¼ÓÖÁNIOS IIÄÚºËÖС£
FPGAÄÚ²¿µÄ¹¤×÷Á÷³ÌÈçͼ3Ëùʾ¡£
ͼ3 FPGAÄÚ²¿¹¤×÷Á÷³Ì
ϵͳƽʱ´¦ÓÚ´ý»ú״̬£¬µ±ÃüÁîÖ¡µ½À´Ê±»áÒýÆðÖжϣ¬ÖжÏ×ӳ̼´Í¨¹ýaltera_avalon_1553B_getframe()½â¶ÁÃüÁîÖ¡µÄÄÚÈÝ£¬È·¶¨ÊǶÁÈ¡»¹ÊÇдÈ룬¶ÁÈ¡»òдÈëÊý¾ÝµÄ³¤¶È£¬Êý¾ÝµÄÌØÕ÷×÷ΪÏ´ζÁÈ¡µÄ±êÖ¾£¬È·ÊµÎÞÎóºó£¬¿ªÊ¼¶ÁÈ¡»òдÈë¡£
´æ´¢Æ÷µÄ¹ÜÀíÓëÆäËûÓ¦ÓÃÖв»Í¬µÄÓÐÁ½µã£ºÔÚÿ´ÎдÈëºó£¬±ØÐ뽫дÈëµÄÊý¾Ý×÷Ò»¸ö±êÖ¾£¬ÒÔ·½±ãÒÔºó¶ÁÈ¡£»ÁíÍ⣬»¹Òª¼ÆËãÊ£Óà´æ´¢µÄÈÝÁ¿£¬ÔÚÏÂÒ»´ÎÐèҪдÈëÊý¾ÝʱÅжÏÊÇ·ñ¿ÉÒÔÈÝÄÉϱ¾´Î´æ´¢¡£1553BµÄÖ÷½áµãÔÚʹÓÃÍê±ÏÊý¾ÝºóÒ²ÐèÒªÌṩÐźÅÀ´Çå¿Õ´æ´¢ÒÔÊÍ·Å×ÊÔ´¡£¡¡¡¡
×÷ÕߣºÑî¿¡ ÖйúÒƶ¯Í¨Ðż¯ÍŽÎ÷ÓÐÏÞ¹«Ë¾ À´Ô´£º¡¶½ñÈÕµç×Ó¡·2008Äê01ÆÚ