裞ã®éã§ããã¹ãã解æããããšã¯å¯èœã§ããïŒ ããã°ã©ã ã¯ãŸã£ãããããŸãããïŒ
ããããŠãããã¯ã©ãã§ããïŒãå人ãç§ã«å°ããŸããããArduinoã®å©ããåããŠïŒã
ãArduinoã®å éšã«ã¯å®å šã«ãã©ã³ãã€ãã³ããã»ããµããããããã°ã©ã ã¯æ©èœããŠããŸãããšçããŸããã
ããããããããã€ã¯ãã³ãŒãïŒããšç§ã®å人ã¯æšæž¬ããŠç§ãåå©ã®ç®ã§èŠãã
ãããããããã€ã¯ãã³ãŒãããšããçšèªã¯ã1970幎代ã«ããã»ããµã®ç¹å®ã®çµç¹ã«äœ¿çšãããŸãããããã®äœ¿çšã¯ç¡å¹ã«ãªããŸããããšç§ã¯çããŠè¿œå ããŸããããæ¬åœãx86ããšã³ã³ãŒããããIntelããã»ããµã«ã¯ãŸã ãã€ã¯ããªãã¬ãŒã·ã§ã³ããããŸããããããç°ãªããŸãã ãããã次ã®å³ã®ããã«ãAND-OR-NOTè«çèŠçŽ ãšDããªã¬ãŒã§æ§æãããããã€ã¹ã䜿çšããŠããã¹ãã解æããŸãã
-äžå¯èœïŒ -ç§ã®å人ãå«ã³ãŸãã-ãã®ãããªããã€ã¹ã§ã¯ãããã»ããµã¯æšªã®ã©ããã«åº§ã£ãŠãã²ããã«ãŠã£ã³ã¯ããå¿ èŠããããŸãïŒ
ããªããããäžå¯èœãªã®ãããšç§ã¯åè«ãããããã¥ãŒãªã³ã°ãã·ã³ãç¥ã£ãŠããŸããïŒã ããŒãäžã®ããã¹ãã解æããåŽé¢ã«ã¯ç¥æ§ãã¢ã«ãã¥ã€ããŠã€ã³ã¯ã¯ãããŸããã
ããŸãããã¥ãŒãªã³ã°ãã·ã³ã§ãããšå人ã¯èšããŸããããããŒã¢ã³ãã¯ã¹ãŠã§ã«ã®ãããªæœè±¡åã§ããã
ãæœè±¡åãªããããã¹ãã解æããäœæ¥ã¹ããŒã ã衚瀺ãããããã«ãªããŸããããšç§ã¯èšããŸãããããæåã«ããªããããå¿ èŠãªã®ãã説æããŸããã
1.ãœãããŠã§ã¢ãªãã®ããŒããŠã§ã¢ã§ããã¹ãã解æããå¿ èŠããã£ãã®ã¯ãªãã§ãã
æšå¹Žã MIPSfpga ã«é¢ããäžé£ã®ã»ãããŒã«äž»å¬è ã®1人ãšããŠåå ããŸãã ã MIPSfpgaã¯ãVerilogã®ãœãŒã¹ã³ãŒãã«ããã»ããµã³ã¢ãå«ãããã±ãŒãžã§ãå€æŽãæ°ããåœä»€ã®è¿œå ããã«ãããã»ããµã·ã¹ãã ã®æ§ç¯ããœãããŠã§ã¢ãšãââãŒããŠã§ã¢ã®å€æŽãªã©ãåæã«è¡ãããšãã§ããŸãã MIPSfpgaã·ã¹ãã ã¯ãVerilogueã·ãã¥ã¬ãŒã¿ã§ã·ãã¥ã¬ãŒãããããFPGAããŒãã«åæããŠå®è£ ããããå·¥å Žã§å®éã«ããããäœãããå Žåã«äœ¿çšã§ããŸãã
MIPSfpgaãåããFPGA / FPGAããŒãã¯2åããã°ã©ã ããå¿ èŠããããŸã-æåã«PCããããŒããŠã§ã¢æ§æãå ¥åãïŒåFPGAã»ã«ã®è«çæ©èœãšãããã®éã®æ¥ç¶ã決å®ïŒã次ã«ãœãããŠã§ã¢ïŒPCãããïŒïŒããã»ããµã³ãã³ãã®ã·ãŒã±ã³ã¹ïŒãåæããŒããŠã§ã¢ã®ã¡ã¢ãªã«å ¥åããŸãã·ã¹ãã ïŒ MIPS microAptiv UPããã»ããµã³ã¢ãã€ã³ã¿ãŒã³ãã¯ãã2ã€ã®ã¡ã¢ãªãããã¯ãI / Oãããã¯ãå«ãïŒã
ããŒããŠã§ã¢ã®å å¡«ã«åé¡ã¯ãããŸãã-ã¶ã€ãªã³ã¯ã¹ISE / Vivadoãšã¢ã«ãã©Quartus IIã®äž¡æ¹ã«ããŠãŒã¶ãŒã®è¿œå ãªãã§ã·ã³ãã«ãªUSBã±ãŒãã«ã䜿çšããŠã䜿çšããŠããã«ãŒãã«ããŒããŠã§ã¢æ§æãã¢ããããŒãã§ãããœãããŠã§ã¢ãå«ãŸããŠããŸãã ãããã®ããŒãã«ã¯ã Digilent Basys 3ããã³Nexys 4 DDR ã Terasic DE0-CVãªã©ãå«ãŸããŸãã
ããŒããŠã§ã¢æ§æãšã¯ç°ãªããæšæºã®MIPSfpga Getting Startedããã±ãŒãžã®ãœãããŠã§ã¢ã¯ã OpenBCDãšåŒã°ãããœãããŠã§ã¢ãšçµã¿åãããŠBusBlasterãšåŒã°ããè¿œå ã®ããŒãã䜿çšããŠãEJTAGãããã°ã€ã³ã¿ãŒãã§ã€ã¹ãä»ããŠã¢ããããŒããããŸãã æ®å¿µãªãããBusBlasterãšOpen OCDã®çµã¿åããã¯éåžžã«ç²éã§ã-Windowsããã³Linuxã®äžéšã®ããŒãžã§ã³ã§ã¯ãã©ã€ããŒã«åé¡ãããå ŽåããããŸãã ããã«ãBusBlasterã¯ãã·ã¢ã§è³Œå ¥ããã®ã¯ç°¡åã§ã¯ãããŸããã ãããã£ãŠãã»ãããŒã®åã«ãBusBlaster / OpenOCDãªãã§ã·ã¹ãã ã®ãœãããŠã§ã¢éšåãMIPSfpgaã«ã¢ããããŒãããæ¹æ³ãèããŸããã
2.ã©ã®ãã¡ã€ã«ã解æããŠã·ã¹ãã ã¡ã¢ãªã«æ³šå ¥ããå¿ èŠãããã
MIPSfpgaã«ã¢ããããŒãããå¿ èŠããããœãããŠã§ã¢ã¯ãéåžžã®GCCãã³ã³ãã€ã«ããŠELFãã¡ã€ã«ã«ãªã³ã¯ããæãäžè¬çãªCãŸãã¯ã¢ã»ã³ãã©ãŒããã°ã©ã ã§ãã GNUããã±ãŒãžã«ã¯ã objcopyããã°ã©ã ãå«ãŸããŠããŸãããã®ããã°ã©ã ã¯ãELFãããã¹ã圢åŒïŒIntel HEXãMotorola Sã¬ã³ãŒããVerilogããŒããŠã§ã¢èšè¿°èšèªã§èªèããã$ readmemhçµã¿èŸŒã¿ãµãã«ãŒãã³ãªã©ïŒãå«ãããŸããŸãªåœ¢åŒã«å€æã§ããŸãã æåã¯Intel HEX圢åŒã䜿çšãããã£ãã®ã§ããã䜿çšããMIPSã®objcopyãªãã·ã§ã³ã®1ã€ã§ã¯ãµããŒããããŠããªãããšãããããŸããã 2çªç®ã®ãªãã·ã§ã³ã¯ã圢åŒã䜿çšããããšã§ãã
Motorola S-recordãšããã¹ãŠãããŸãæ©èœããŸããã ãã®åœ¢åŒã®ããŒãã·ãŒãã¯æ¬¡ã®ãšããã§ãã
3.äœãã©ã®ããã«å ¥åããã-ãšã³ãžãã¢ãªã³ã°ãœãªã¥ãŒã·ã§ã³
3.1ã BusBlasterãä»ãããœãããŠã§ã¢ã®ã¢ããããŒããåé¿ããæãç°¡åãªæ¹æ³ã¯ãåæäžã«åçŽã«MIPSfpgaã·ã¹ãã ã«é 眮ããããšã§ããããã¯ãVerilogããŒããŠã§ã¢èšè¿°èšèªã®ã³ãŒããè«çèŠçŽ ãšããªã¬ãŒã®ã°ã©ãã«å€ããããã»ã¹ã§ãã ã¶ã€ãªã³ã¯ã¹ISE / Vivadoã·ã³ã»ãµã€ã¶ãŒããã°ã©ã ãšã¢ã«ãã©Quartus II ã¯ãåæäžã«Verilog $ readmemhèšèªæ§æãèªèããããã¹ããã¡ã€ã«ã®ããŒã¿ã§åæåãããã¡ã¢ãªãäœæããŸã ã æ®å¿µãªããããŠãŒã¶ãŒãé »ç¹ã«ãœãããŠã§ã¢ãåã³ã³ãã€ã«ããå Žåããã®ãããªãœãªã¥ãŒã·ã§ã³ã¯éåžžã«å®çšçã§ã¯ãããŸãããæ¯åãããŒããŠã§ã¢ã®ååæãå¿ èŠã«ãªãããã15ã30åããããŸãã
3.1.1ã ãªãã·ã§ã³3.1ïŒFPGAã®éšåçãªåæ§æã ç§ããããå匷ããŸããã§ããããªããªãããã®å ŽåãåŸ ã€ã®ã«é·ãæéãããããã»ãã®æ°ç§ããåŸ ããªãããã§ãã ããã«ãFPGAã®ã¡ãŒã«ãŒã«äŸåããªããã®ãå¿ èŠã§ããã
3.2ã çµã¿èŸŒã¿ããã°ã©ãã«æãçŽæçã«æåŸ ãããæ¹æ³ã¯ãããã°ã©ã ã®äžéšãä¿®æ£ããã·ã¹ãã ã®åæäžã«ã·ã¹ãã ã«é 眮ãïŒããŒãããŒããŒïŒãããã°ã©ã ã®å¥ã®éšåãã·ãªã¢ã«ããŒãçµç±ã§PCããããŠã³ããŒãããããšã§ãã ããŒãããã°ã©ã ã¯ãPCããããŠã³ããŒãããããã°ã©ã ã®è»¢éãéå§ãããã®ããã°ã©ã ãããŒã¿ã®åœ¢ã§åãåããã¡ã¢ãªã«æžã蟌ãå¿ èŠããããŸãã ãã®ãããªæ¹æ³ã¯ã Habrã®ã¡ã¢ãMIPSfpgaïŒcanon the canonãã§@Frantonyã«ãã£ãŠèª¬æãããŸããã
3.2.1ã ã¡ãœãã3.2ã 2ã€ã®ããªãšãŒã·ã§ã³ããããŸã-ããŠã³ããŒãããããã°ã©ã ããMotorola S-recordã®ãããªåœ¢åŒã®ããã¹ããã¡ã€ã«ãšããŠè»¢éããæ¹æ³ãšãããŒãäžã®ããŒãããŒããŒã§ãã®ãã¡ã€ã«ã解æããæ¹æ³ããŸãã¯PCäžã®ããã¹ããã¡ã€ã«ã解æããŠããã€ããªåœ¢åŒã§ããŒãã«ããŒã¿ã転éããæ¹æ³ã§ãã
3.3ã ç§ã䜿çšããæ¹æ³-ããŒã¿ã®åä¿¡ã解æãã¡ã¢ãªããã®ããŒã¿ã®éä¿¡ã¯ãã¹ãŠãFPGAã«å®è£ ãããããŒããŠã§ã¢ã§å®å šã«å®è¡ãããŸãã ãã®æ¹æ³ã®å©ç¹ã¯ãããŒãäžã®ãœãããŠã§ã¢ãããŒããŠã§ã¢ããŒããŒã®ååšããŸã£ããç¥ããªãããšã§ãã ããŒããŠã§ã¢ããŒããŒã¯ãPCããã®ããŒã¿ãèªèãããšãããã»ããµããªã»ããããããã«èšå®ããã¡ã¢ãªå ã®ãã¹ãŠã®ããŒã¿ãåä¿¡ããŠââé 眮ããããã»ããµããªã»ããããåé€ããŸãããã®åŸãããã»ããµã¯ãªã»ããäŸå€ãã³ãã©ã®ã³ãŒãã®èªã¿åããšå®è¡ãéå§ããŸãã
3.3.1ã ä»ã®ãŠãŒã¶ãŒãéçºè ãšåé¡ãè°è«ããéçšã§ãMIPSfpgaã¯ãã¡ã¢ãªã§åäœããããã»ããµãšåæã«ïŒããã³ããã»ããµããªã»ãããããŠãããšãã§ã¯ãªãïŒPCããã¡ã¢ãªã«ããŒã¿ãæžã蟌ãããã®æ¬æ ŒçãªDMAããŒããäœæãããšããã¢ã€ãã¢ãææ¡ããŸããããè€éãããŠæåŠãããŸãããããŠããã·ã¢ã§ã®ã»ãããŒäžã«MIPSfpgaã䜿çšããããšã«ãªã£ãŠããçš®é¡ã®ã¿ã¹ã¯ã«ãšã£ãŠã¯ãæŠããŠç¡æå³ã§ãã
4. PCãžã®æ¥ç¶ã¯ã©ã®ããã«ãªã£ãŠããŸããïŒ
ã·ãªã¢ã«ããŒãã¯éââåžžã«å€ãçºæã§ãã UART / RS-232Cã¯1960幎代åŸåã«ç»å ŽããŸããã 1980幎代ã®ãã¹ãŠã®PCã«ã¯ããã¡ã€ã«ãšããŠæžã蟌ãããšãã§ããCOMããŒãããããŸããã ä¿¡ããããŸããããMS-DOSãçã延ã³ãä»ãŸã§Windowsã«æ®ã£ãŠããŸãã ã¯ããã¯ããPCããå€éšã·ãªã¢ã«ããŒãã«ãã¡ã€ã«ã転éããããã«ãã³ãã³ãã©ã€ã³ãtype file-name COM port-number ãã«æžã蟌ãããšãã§ããŸã ã
Linuxã«ãããã®ãããªæ¥ç¶ããããŸãïŒLinuxã«æ¥ç¶ãããMIPSfpgaã¯ãŸã è©ŠããŠããŸããããããã«ã€ããŠç§ã«ã¡ãŒã«ãéã£ãã€ã¿ãªã¢ã®å人ãè©ŠããŸããïŒã COMããŒãã«å¯Ÿå¿ãããã¡ã€ã«ã«ããŒã¿ãã³ããŒããLinuxãŠãŒã¶ãŒã¯ã ãã€ã€ã«ã¢ããã°ã«ãŒãã®ã¡ã³ããŒã§ããå¿ èŠããããŸãã
stty -F / dev / ttyUSB0 raw 115200 cat srec program.rec> / dev / ttyUSB0
åæã«ãçŸä»£ã®PCã«ã¯å€ä»£ã®RS-232CããŒããã€ã³ã¹ããŒã«ããã代ããã«FTDIã® FTD32RLãããã«åºã¥ãã¢ããã¿ãŒã䜿çšããŠUSBçµç±ã§ãä»®æ³COMããŒãããäœæããŸãïŒæ³šæïŒãã®ãããã«ã¯ãã°ã®å€ãåœç©ããããŸã ïŒ FPGAã§åäœããã«ã¯ãã¢ããã¿ãŒã®3.3 / 5Vã¹ã€ããã3.3Vã«èšå®ããå¿ èŠããããŸããããããªããšãçè«çã«ã¯FPGAã®ãã³/åºåãæå·ããå¯èœæ§ããããŸãã
äžã®åçã«ç€ºãããŠããã¢ããã¿ãŒã«å ããŠãPCããã³UARTãFPGAã«æ¥ç¶ããããã«ãWin XP / VISTA / 7/8 / 8.1çšã®PL2303TA USB TTL RS232ã³ã³ããŒã¿ãŒã·ãªã¢ã«ã±ãŒãã«ã¢ãžã¥ãŒã«ãšåŒã°ããã±ãŒãã«ã䜿çšã§ããŸãã ãã®ã±ãŒãã«ã¯ããªã¹ã®GPIOåºåãåããTerasic DE0-Nanoãªã©ã®å°åããŒãã«äœ¿çšãããšäŸ¿å©ã§ãã AliExpressãªã©ã®ãµã€ãã§ã¯ã PL2303HXãããã«åºã¥ãå®äŸ¡ãªã±ãŒãã«ã販売ãããŠããŸããããã®ãããã«ã¯Windows 8.xãšã®äºææ§ã®åé¡ããã£ããããPL2303TAã«åºã¥ãã±ãŒãã«ã䜿çšããããšããå§ãããŸãïŒUPDïŒMIPSfpgaã®ææ°ããŒãžã§ã³+å€æŽããŸããDE0-NanoããŒãã®çµè«ã䜿çšããããããã®å³ã亀æããå¿ èŠãããããã®æ¥ç¶ã¯æ£ãããããŸããïŒïŒ
5. PCããåä¿¡ããããŒã¿ãã©ãã«ã¢ããããŒãããå¿ èŠããããŸãããïŒ
ããŒããããããã°ã©ã ãPCããåæãããMIPSfpga +ã·ã¹ãã ã®ã¡ã¢ãªã«ããŒãããããã®ã¢ãžã¥ãŒã«ãæ¿å ¥ããåïŒMIPSfpgaã®ããŒãžã§ã³ãšåä»ããããã«ïŒããã®ã¢ãžã¥ãŒã«éå±€ã¯æ¬¡ã®ããã«ãªããŸããã
åã¢ãžã¥ãŒã«ã®å 容ïŒ
- de0_cvã¯ãFPGAããŒãã®åã¿ã€ãã«åºæã®å€éšã¢ãžã¥ãŒã«ã§ãã ãã®ã¢ãžã¥ãŒã«ã®çµè«ã¯ããããèªäœã®ç©ççãªçµè«ã«å¯Ÿå¿ããŠããŸãã ç¹å®ã®ã¢ãžã¥ãŒã«de0_cv㯠ãAltera Cyclone V FPGAãæèŒããTerasic DE0-CVããŒãçšã«èšè¿°ãããŠããŸã
- mfp_single_digit_seven_segment_display display_0ãdisplay_1ã ...- AlterããŒãçšã®7ã»ã°ã¡ã³ãã€ã³ãžã±ãŒã¿ãŒãã©ã€ããŒïŒ1æ¡ã«1ã€ïŒ
- mfp_system-ãã¹ãŠã®FPGAããŒãã§åãã·ã¹ãã ã¢ãžã¥ãŒã«
- m14k_top - MIPS microAptiv UPãã€ã¯ãããã»ããµã³ã¢ïŒMIPS microAptiv MPUãšãåŒã°ããŸãïŒã®ãããã¢ãžã¥ãŒã«ãm14kãšããååã¯ã以åã®ããã»ããµããŒãžã§ã³-MIPS M14Kcã«ç±æ¥ããŸãã
- mfp_ejtag_reset - EJTAGãããã°ã€ã³ã¿ãŒãã§ã€ã¹ããªã»ããããããã®è£å©ã¢ãžã¥ãŒã«
- mfp_ahb_lite_matrix-ã¡ã¢ãªãããã¯ã AHB-Liteãã¹ããžãã¯ããã³å
¥åºåããžãã¯ã®åè·¯å®è£
ãçµã¿åãããã¢ãžã¥ãŒã«ã åŸè
ã¯ããœãããŠã§ã¢ããã®ãã¹äžã®ã¢ãã¬ã¹ãããŒããŠã§ã¢I / Oããã€ã¹ã®ä¿¡å·ïŒãã¿ã³ãLEDã€ã³ãžã±ãŒã¿ãŒãªã©ïŒã«æ¥ç¶ããŸãã
- mfp_ahb_lite_decoder -AHB-Liteãã¹äžã®ã¢ãã¬ã¹ããã³ãŒããããã¹äžã®ãã©ã³ã¶ã¯ã·ã§ã³ãåŠçããã¹ã¬ãŒãããã€ã¹ïŒã¡ã¢ãªãããã¯ãŸãã¯I / Oããžãã¯ã¢ãžã¥ãŒã«ïŒã決å®ããã¢ãžã¥ãŒã«
- mfp_ahb_ram_slave reset_ram -AHB-Liteãã¹ã¹ã¬ãŒããããã³ã«ãå®è£
ããã¡ã¢ãªãããã¯ã·ã§ã«ã ãã®ãããã¯ã®ã°ã«ãŒãïŒ reset_ram ïŒã¯ãããã»ããµããªã»ããç¶æ
/ãªã»ãããçµäºããçŽåŸã«éå§ããããã°ã©ã ã®äžéšã察象ãšããŠããŸã
- mfp_dual_port_ram i0- i3-ã¢ãžã¥ãŒã«ãã·ã³ã»ãµã€ã¶ãŒãFPGAå ã«ãããã¯ã¡ã¢ãªãäœæããããã®æ瀺ãšããŠèªèããããªã«ã®ã³ãŒãã ã·ã³ã»ãµã€ã¶ãŒããã®ã³ãŒããæ£ããèªèããããã«ã¯ã ç¹å®ã®æ¹æ³ã§èšè¿°ããå¿ èŠããããŸãã 4ãããå¹ ã®AHB-Liteãã¹ãã1ãã€ããèšé²ã§ããããã«ã8ãããã®ã¡ã¢ãªå¹ ãæã€4ãããã¯ïŒ1ãããã¯32ãããå¹ ã®ä»£ããã«ïŒïŒã·ã³ã»ãµã€ã¶ãŒã¯ãã¹ã¯ä»ãã¡ã¢ãªãèªèããŸããïŒ
- mfp_ahb_ram_slave ramã¯ãAHB-Liteãã¹ã¹ã¬ãŒããããã³ã«ãå®è£
ããã¡ã¢ãªãããã¯ã®å¥ã®ã·ã§ã«ã§ãã ãã®ãããã¯ã®ã°ã«ãŒãïŒ ram ïŒã¯ããã£ãã·ã¥ã¡ã¢ãªã§å®è¡ãããããã°ã©ã ã®äž»èŠéšåã察象ãšããŠããŸãã
- mfp_dual_port_ram i0- i3-äžèšã®åæ§ã®4ã€ã®ãããã¯ãåç §
- mfp_ahb_gpio_slave-æ±çšå ¥åºåçšã®ã¹ã¬ãŒãã¢ãžã¥ãŒã«ïŒ GPIO-æ±çšå ¥åºåïŒã ãœãããŠã§ã¢ããããŒããŠã§ã¢I / Oããã€ã¹ã®ä¿¡å·ãžã®ãã¹äžã®ã¢ãã¬ã¹ã衚瀺ããŸã-ãã¿ã³ãLEDã€ã³ãžã±ãŒã¿ãŒãªã©ã
- mfp_ahb_lite_response_mux -AHB-Liteãã¹æäœçšã®è£å©ã¢ãžã¥ãŒã«-æ£ããã¡ã¢ãªãããã¯ãŸãã¯I / Oã¢ãžã¥ãŒã«ãããã¹ã¿ãŒããã€ã¹ïŒãã€ã¯ãããã»ããµã³ã¢ïŒã«èªã¿åãããŒã¿ãéä¿¡ãããã«ããã¬ã¯ãµ
- mfp_pmod_als_spi_receiverã¯ãMIPSfpga +ã·ã¹ãã ã«æ¥ç¶ãããŠããããã€ã¹ã®äŸã®1ã€ã§ããDigilent PmodALSå ã»ã³ãµãŒçšã®SPIãããã³ã«ã®ããªã¢ã³ããå®è£ ããã¢ãžã¥ãŒã«ã§ãã ãã®ã¢ãžã¥ãŒã«ã«ã€ããŠã¯ãã®æçš¿ã§ã¯èª¬æããŠããŸãããå ã»ã³ãµãŒãšMIPSfpga +ã®çµ±åã«é¢ããå¥ã®æçš¿ãæžãããšãã§ããŸãã
6.ã·ã¹ãã ã«ããŒããŠã§ã¢ããŒããŒãæ¿å ¥ãããšãã·ã¹ãã ã®éå±€ã¯ã©ã®ããã«å€ãããŸãããïŒ
4ã€ã®æ°ããã¢ãžã¥ãŒã«ïŒ
- mfp_ahb_lite_matrix_with_loader-åã®éå±€ã®mfp_ahb_lite_matrixã¢ãžã¥ãŒã«ã®ä»£ããã«çœ®ããŸãã mfp_ahb_lite_matrix_with_loaderã«ã¯ã mfp_ahb_lite_matrixã¢ãžã¥ãŒã«ãšãæ°ããæ©èœãåãã3ã€ã®ã¢ãžã¥ãŒã«ã®äž¡æ¹ãå«ãŸããŠããŸãã
- mfp_uart_receiver -UARTãä»ããŠPCããããŒã¿ãåä¿¡ãããã€ã/è±æ°åã®ã¹ããªãŒã ã«å€æããŸã
- mfp_srec_parser - mfp_uart_receiverã¢ãžã¥ãŒã«ããåä¿¡ãããã€ããã§ãŒã³ãMotorola S-Record圢åŒã®ããã¹ããšããŠè§£æããäžé£ã®ãã©ã³ã¶ã¯ã·ã§ã³ïŒã¢ãã¬ã¹/ããŒã¿ïŒãçæããŠãããã¹ãã§æå®ãããããŒã¿ã§åæã·ã¹ãã ã®ã¡ã¢ãªãæºãããŸãã
- mfp_srec_parser_to_ahb_lite_bridge - mfp_srec_parserã¢ãžã¥ãŒã«ããåä¿¡ãããã©ã³ã¶ã¯ã·ã§ã³ãAHB-Liteãã¹ãããã³ã«ã«æºæ ãããã©ã³ã¶ã¯ã·ã§ã³ã«å€æããŸãã ãŸãããœãããŠã§ã¢ã䜿çšããä»®æ³ã¢ãã¬ã¹ããããŒããŠã§ã¢ãåçŽãªåºå®ãããã³ã°ã§äœ¿çšããç©çã¢ãã¬ã¹ã«å€æããŸãã
以äžã¯ã mfp_ahb_lite_matrix_with_loaderã¢ãžã¥ãŒã«ã®éå±€ã¬ãã«ã®å³ã§ããverilã§ã³ãŒããã³ã³ãã€ã«ããåŸãå®å šãªåæïŒæé©åãFPGAåºæã®èŠçŽ ãžã®ãããã³ã°ãé 眮ããã¬ãŒã¹ïŒã®åã«ååŸããŸãã mfp_srec_parser_to_ahb_lite_bridgeãšmfp_ahb_lite_matrixã®éã®ãã«ããã¬ã¯ãµãŒã«æ³šæããŠãã ãã ãããã¯ããã€ã¯ãããã»ããµãŒã³ã¢ããã®ãã©ã³ã¶ã¯ã·ã§ã³ãŸãã¯ããŒããŠã§ã¢ããŒããŒããã®ãã©ã³ã¶ã¯ã·ã§ã³ãã¡ã¢ãªãŒããã³å ¥åºåãµãã·ã¹ãã ã«åããŸãã
7.ã·ãªã¢ã«ããŒããUARTã«é¢ããããã€ãã®èšè
UARTã®ãããã¯ã¯ã æè¿ãå«ããŠHabréã§äœåºŠãè°è«ãããŠããã®ã§ã詳现ã«ã€ããŠã¯è§ŠããŸããã ç§ã®ã¬ã·ãŒããŒå®è£ ã§ã¯ã UARTãããã³ã«ã®æãåçŽãªããŒãžã§ã³ã䜿çšããŸã ãå¶åŸ¡ä¿¡å·ãªãã1ã€ã®ã¹ã¿ãŒãããããããªãã£ãªããåºå®ãããã¬ãŒããåºå®ã¯ããã¯/ã¯ããã¯/ã¯ããã¯çšã§ãã mfp_uart_receiverã¢ãžã¥ãŒã«ã¯ãRXä¿¡å·ããããŒã¿ãé çªã«åä¿¡ããæºåãã§ããã8ããããã€ãã䞊åã«åºåããŸãã ãã®ã¢ãžã¥ãŒã«ã«ã¯ãRXä¿¡å·ã®ãã¬ãã£ããšããžãåŸ æ©ããã¹ããŒããã·ã³ãå«ãŸããŠããããïŒéå§ãããã決å®ãããŸãïŒããã®åŸãã«ãŠã³ã¿ãŒã䜿çšããŠã¯ããã¯ãã«ãŠã³ãããŠæ±ºå®ããæ£ããæç¹ã§ããŒã¿ããããèªã¿åããŸãã ããããããã®ã¯ããã¯ãµã€ã¯ã«æ°ã¯éåžžã«å€ãã50,000,000 Hz / 115,200ããŒ= 434ã¯ããã¯ãµã€ã¯ã«ïŒãŸãã¯25 MHzã®å Žåã¯217ã¯ããã¯ãµã€ã¯ã«ïŒã§ãããããããŒã¿åä¿¡ã¯éåžžã«ä¿¡é Œã§ããŸãã ã¢ãžã¥ãŒã«ã€ã³ã¿ãŒãã§ã€ã¹ã¯æ¬¡ã®ãšããã§ãã
å®å šãªã¢ãžã¥ãŒã«ã³ãŒãã¯http://github.com/MIPSfpga/mipsfpga-plus/blob/master/mfp_uart_receiver.vã§ãã
åæã³ã³ãã€ã«åŸã®mfp_uart_receiverã¢ãžã¥ãŒã«å³ ïŒ
8.ãããŠæåŸã«ãçŽæããããã®ïŒè£žã®ããŒããŠã§ã¢ãããã»ããµããœãããŠã§ã¢ãªãã®Motorola S-Recordããã¹ãããŒãµãŒ
mfp_srec_parserã¢ãžã¥ãŒã«ã¯ã mfp_uart_receiverã¢ãžã¥ãŒã«ãããã€ããåä¿¡ããã¹ããŒããã·ã³ã䜿çšããŠMotorola Sã¬ã³ãŒã圢åŒã®ããã¹ããšããŠè§£æããŸãã 解æäžããã©ã³ã¶ã¯ã·ã§ã³ã¯ãåæãããMIPSfpga +ã·ã¹ãã ã®ã¡ã¢ãªã«å¯ŸããŠãçæãããŸãã ãããã®ãã©ã³ã¶ã¯ã·ã§ã³ã¯ãããã¹ãã§æå®ãããã¢ãã¬ã¹ã§è§£æãããããã¹ãããæå®ããããã€ãã§ã¡ã¢ãªãæºãããŸãã ã¢ãžã¥ãŒã«ã€ã³ã¿ãŒãã§ã€ã¹ïŒ
ã¹ããŒããã·ã³ã®ç¶æ ãšäœ¿çšãããASCIIæåã®å®æ°ã®èå¥åã決å®ããŸãã
èšå·å®æ°ã0ããã1ãã...ã9ãããAãããBãã...ãFãã4ãããã®æ°å€0ã1ã2ã... 9ã10ã11ã... 15ã«å€æããããã®çµã¿åããããžãã¯
ç¶æ ãã·ã³ã®å€æ°ã å·ŠåŽã¯çŸåšã®ãµã€ã¯ã«/ãµã€ã¯ã«ã§äœæãããæ°ããå€ãå³åŽã¯åã®ãµã€ã¯ã«ã§åœ¢æãããã¬ãžã¹ã¿/ Dããªã¬ãŒ/ Dããªããããããã«èšé²ãããå€ã§ãã Verilogovskyã®ãregããããã·ã³ã»ãµã€ã¶ãŒã¯åžžã«ããŒããŠã§ã¢ã®æå³ã§Dããªã¬ãŒ/ã¬ãžã¹ã¿ãŒãäœæãããšã¯éããŸããã ããŒã¯ãŒããregãã¯ããåžžã«ããããã¯ã§å²ãåœãŠãããšãã§ããäžçš®ã®å€æ°ãšããŠã®ã¿ç解ãããå¿ èŠããããŸãã
å€æ°ãå®çŸ©ããåŸã®å²ãåœãŠã¯ãçæãããã¢ãã¬ã¹ïŒä»¥åã«ã¬ãžã¹ã¿ã«æžã蟌ãŸããïŒã®ã¢ãžã¥ãŒã«åºåãžã®å²ãåœãŠã§ãã
ã¹ããŒããã·ã³ããžãã¯ã¯ãçµã¿åããéšåãšé 次éšåã§æ§æãããŸãã ãããã®æŠå¿µã«æ £ããŠããªãå Žåã¯ãç¡æã®HarrisïŒHarrisãã¥ãŒããªã¢ã«ã§ããããèªãããšãã§ããŸãã
çµã¿åããéšåã§ã¯ã次ã®ç¶æ ã®å€ãèšç®ããŸãããç¶æ ããšããèšèã¯ãå€æ°reg_stateãå€æãããDããªã¬ãŒã®ã°ã«ãŒãã ãã§ãªããäžè¬çã«åè·¯å ã®ãã¹ãŠã®Dããªã¬ãŒ/ Dããªãããããã/ããŒããŠã§ã¢ã¬ãžã¹ã¿ãæå³ããŸãïŒãã®æçš¿ã®æèã«ããã3ã€ã®çšèªã¯ãã¹ãŠäº€æå¯èœã§ãïŒã ãæéç¶æ æ©æ¢°ãããã³ãããŒã¿ãåããç¶æ æ©æ¢°ãã§ãããšèšãçŽç²äž»çŸ©è ãããŸããããããã®åŠåãšãã®æªéãéã®å ã«çœ®ããŠãããŸãã
ãããçµã¿åããéšåã®å§ãŸãã§ãã åæèšèšæ¹æ³ã§ã¯æãŸãããªãã©ããïŒDã©ããïŒã®å€èŠ³ãç£èŠããªãããã«ãçµåãããalways-blockã®æåã«ãèšç®ããããã¹ãŠã®å€æ°ã«ããã©ã«ãå€ãå²ãåœãŠãŸãã
å€æŽã¯ãUARTã¬ã·ãŒãããæ°ããã¬ã¿ãŒãåä¿¡ãããšãã«ã®ã¿çºçããŸãïŒ "ifïŒchar_readyïŒ"ïŒã æéç¶æ ãã·ã³ã§ã¯ãæåã«æå 'S'ãçŸããã®ãåŸ ã£ãŠãããã¬ã³ãŒãã®ã¿ã€ãïŒã¿ã€ã '3'ã«èå³ããããŸãïŒããã³æ¬¡ã®ãã€ããæžã蟌ãã¢ãã¬ã¹ã解æããŸãã
ããŒã¿ã®è§£æãéå§ãããšåæã«ãã¢ãžã¥ãŒã«ããã®åºåã«ã¢ãã¬ã¹/ããŒã¿ãã©ã³ã¶ã¯ã·ã§ã³ãçæããŸãã
ã¯ããã¯ãžã§ãã¬ãŒã¿ãŒã®ãã©ã¹åŽã§ã以åã«èšç®ããå€ãããªã»ãããå¿ èŠãšããªãã¬ãžã¹ã¿ã«æžã蟌ã¿ãŸãã
ãããŠä»ããªã»ãããå¿ èŠãšããã¬ãžã¹ã¿ã«æžã蟌ã¿ãè¡ã£ãŠããŸã-æ確ãªç¶æ ããã¹ããŒããã·ã³ãèµ·åããããã¢ãžã¥ãŒã«ã®åºåã§å¶åŸ¡ä¿¡å·ãå®çŸ©ããã¬ãžã¹ã¿ã®ããããã§ãïŒ
in_progressã·ã°ãã«ïŒãé²è¡äžãïŒã¯ãã¢ãã¬ã¹ã§æåã®ã¬ã³ãŒããèªèãããæç¹ã§ãªã³ã«ãªãïŒã¿ã€ãS3 ïŒãã¢ãžã¥ãŒã«ããã¡ã€ã«å ã®æåŸã®ã¬ã³ãŒããèªèãããšãªãã«ãªããŸãïŒã¿ã€ãS7 ïŒã ãã®ä¿¡å·ã¯ãããŒãäžã®å€éšã€ã³ãžã±ãŒã¿ã«åºåã§ããŸããmfp_ahb_lite_matrix_with_loaderã®ãã«ããã¬ã¯ãµã«ã䜿çšããããã€ã¯ãããã»ããµã³ã¢ãŸãã¯ããŒããŠã§ã¢ããŒããŒãã¡ã¢ãªã«æžã蟌ããã©ããã決å®ããŸãã ããã«ã in_progressã¯ãã€ã¯ãããã»ããµã³ã¢ããªã»ããããããã«äœ¿çšãããããŒããŠã§ã¢ããŒããŒãã¡ã¢ãªã«æžã蟌ããšãã«ãã«ããããŠã³ããããŸãã ãœãããŠã§ã¢ãã¡ã¢ãªã«æžã蟌ãŸãããšããã€ã¯ãããã»ããµãèµ·åããåœä»€ã®èªã¿åããéå§ããŸãïŒåºå®ç©çã¢ãã¬ã¹1FC0_0000ããïŒã
å ¥åããã¹ãã®ãšã©ãŒãæ€åºããããã®ããžãã¯ã ã¡ã€ã³ã®ã¹ããŒããã·ã³ãšäžŠè¡ããŠåäœãããã®ç¶æ ã䜿çšããŸãã
ãã§ãã¯ãµã ãèšç®ããS-Recordããã¹ãã®ãã§ãã¯ãµã ãšæ¯èŒããããã®ããžãã¯ã ã¡ã€ã³ã®ã¹ããŒããã·ã³ãšäžŠè¡ããŠåäœãããã®ç¶æ ã䜿çšããŸãã
ãšã©ãŒä¿¡å·ã®çæã ããŒããŠã§ã¢ããŒãµãŒã¯ããšã©ãŒãçºçããè¡ããŠãŒã¶ãŒã«éç¥ããŸãã
å®å šãªã¢ãžã¥ãŒã«ã³ãŒãã¯http://github.com/MIPSfpga/mipsfpga-plus/blob/master/mfp_srec_parser.vã§ãã
9. AHB-Liteãã¹ãžã®æ©ã«ã€ããŠã®ã²ãšèš
mfp_srec_parser_to_ahb_lite_bridgeã¢ãžã¥ãŒã«ã¯ã mfp_srec_parserã¢ãžã¥ãŒã«ããååŸããã¢ãã¬ã¹/ããŒã¿ãã©ã³ã¶ã¯ã·ã§ã³ãã MIPSfpgaã䜿çšããAHB-Liteãã¹ã®ãã©ã³ã¶ã¯ã·ã§ã³ã«å€æããŸãã
ã¢ãžã¥ãŒã«ã¯ã¢ãã¬ã¹ãç·šéããŸã-ãœãããŠã§ã¢ã䜿çšããä»®æ³ã¢ãã¬ã¹ãããŒããŠã§ã¢ã䜿çšããç©çã¢ãã¬ã¹ã«å€æããŸãã MIPS microAptiv UPããã»ããµãŒã«ã¯MMU TLBããããä»®æ³ã¢ãã¬ã¹ããç©çã¢ãã¬ã¹ãžã®æè»ãã€è€éãªãããã³ã°ãå¯èœã«ããŸãããç§ã®MIPSfpgaã®äœ¿çšäŸã§ã¯ãå€æã¯ç°¡åã§åºå®ãããŠããŸã-ã¢ãã¬ã¹ã®äžäœ3ãããããŒãã§æ¶å»ããŸãã MIPSfpgaã®ä»®æ³ã¡ã¢ãªç®¡çããã€ã¹ã®æäœã«èå³ãããå Žåã¯ããã·ã¢èªã®ãMIPSããã»ããµã®ã¡ã¢ãªç®¡çããã€ã¹ãã®ãã¬ãŒã³ããŒã·ã§ã³ãã芧ãã ããã
ããªããžã³ãŒãmfp_srec_parser_to_ahb_lite_bridge ïŒ
http://github.com/MIPSfpga/mipsfpga-plus/blob/master/mfp_srec_parser_to_ahb_lite_bridge.v
åæã³ã³ãã€ã«åŸã®mfp_srec_parser_to_ahb_lite_bridgeã¢ãžã¥ãŒã«å³ ïŒ
æåŸã«ããããäžã®ã·ã¹ãã ã®ããã€ã¹ãæ¥ç¶ããããã«äœ¿çšãããAHB-Liteãã¹èªäœã«ã€ããŠã§ãã
以äžã¯ãã€ããžããŒã·ã§ã³ãã¯ãããžãŒãºã®ããã¥ã¡ã³ãããã®æç²ã§ãããã®ããã¥ã¡ã³ãã¯ã次ã®æé ã«åŸã£ãŠããŠã³ããŒãã§ããŸãã
ç¹ã«ãã¢ãã¬ã¹è»¢éã«é¢é£ããŠããŒã¿è»¢éã1ã¯ããã¯ãµã€ã¯ã«é ãããå¿ èŠãããçç±ã確èªã§ããŸãã AHB-Liteãããã³ã«ã§ã¯ãæ°ãããã©ã³ã¶ã¯ã·ã§ã³ã®ã¢ãã¬ã¹ãåã®ãã©ã³ã¶ã¯ã·ã§ã³ããã®ããŒã¿ãšåæã«ãã¹ã«é 眮ãããŸãã
åæã³ã³ãã€ã«åŸã®mfp_ahb_lite_matrixã¢ãžã¥ãŒã«ã¹ããŒã ã ãã®ã¢ãžã¥ãŒã«ã«ã¯ã2ã€ã®ã¡ã¢ãªãããã¯ãšãæ±çšI / Oã®ãœãããŠã§ã¢ãžã®ã¡ã¢ãªã¢ã¯ã»ã¹ã衚瀺ããã¢ãžã¥ãŒã«-GPIOïŒæ±çšIOïŒã®3ã€ã®ã¹ã¬ãŒãã¢ãžã¥ãŒã«ãå«ãŸããŸãã
10.ãããŠä»äœïŒ ç¶ç¶ãè¿œå ãææ¡
ãã®æçš¿ã§ã¯ãMIPSfpgaãããžã§ã¯ãã®1ã€ã®åŽé¢ãšãã®æ¹è¯çMIPSfpga +ã®ã¿ã説æããŸãããããã¯ãæšå¹Žæ«ã«ãã·ã¢ãæ è¡äžã«Bus Blaster / Open OCDã®åé¡ã«æ©ãŸãããªãããã«ãããã®ã§ãã MIPSfpgaã§GDBããŒã¹ã®ãããã¬ãŒã䜿çšããå Žåã¯ãåŒãç¶ãBus BlasterãŸãã¯EJTAGããµããŒãããå¥ã®ãããã°ã¢ããã¿ãŒã䜿çšããå¿ èŠããããŸãã
ããããMIPSfpgaããŒãã¯ã¯ããã«å€§ãããªã£ãŠããŸãã çµå±ã®ãšãããããã±ãŒãžã«ã¯ããµã ã¹ã³ããã€ã¯ããããããã®ä»ã®äŒæ¥ã®æ°è£œåã§äœ¿çšãããç£æ¥çšããã»ããµãå«ãŸããŠããŸããèªè ã®çããã¯ããããã®äŒæ¥ã®ãšã³ãžãã¢ã䜿çšããã³ãŒããšåãã³ãŒãã䜿çšããŠãã®æ§é ãè©Šãããšãã§ããŸãã ç°ãªãã©ã€ã³ããã·ã¥ããªã·ãŒã䜿çšããŠãã£ãã·ã¥ã¢ãžã¥ãŒã«ãèšè¿°ãããã«ãã³ã¢ã·ã¹ãã ãéçºããç°ãªãåšèŸºæ©åšãMIPSfpgaã«ãã蟌ãããšãã§ããŸãã MIPSfpgaã§ãããžã§ã¯ããäœæããããšã«èå³ããããåæã«FPGAããŒãã®è³Œå ¥äºç®ã確ä¿ããã®ãé£ããå°æ¹ã®å€§åŠã§åããŠããå Žåã¯ã1æã®ããŒããç¡æã§å ¥æã§ããŸãããæ®ãã¯ã»ãšãã©ãããŸãã-詳现ã¯ã象ã®é åžïŒFPGAããŒãMIPSfpgaã«ããæè²ãããžã§ã¯ã ã ã
ãŸããHabréã«ã¯ãã³ããã»ããµãŒãMIPSfpgaã«åºå®ããæ¹æ³ã«é¢ããã¡ã¢ãæ¢ã«ãããŸãã-https : //habrahabr.ru/post/276205/ãåç §ããŠãã ãã ã