æåã®éšåãžã®ãªã³ã¯
æ€èšããŠããæ§æã¯ã次ã®èŠçŽ ã§æ§æãããŠããŸãã
AHB-Liteãã¹
ããã¯ãMIPSfpgaã³ã¢ãå€éšãšéä¿¡ããããã®äž»èŠãªããŒã«ã§ãã ãããããæ
å ±ã®èªã¿åãããã³æžã蟌ã¿ã®æ瀺ãSDRAMã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«ã«åä¿¡ãããèªã¿åãããã³æžã蟌ã¿ããŒã¿ããããä»ããŠéä¿¡ãããŸãã äž»ãªæ©èœïŒåŸç¶ã®ã³ãã³ãã®ã¢ãã¬ã¹ãã§ãŒãºã¯ãçŸåšã®ã³ãã³ãã®ããŒã¿ãã§ãŒãºãšæéçã«äžèŽããŸãã ããã¯ã次ã®å³ã§æãããããããŸãã
衚瀺ãããä¿¡å·ã®ç°¡åãªèª¬æïŒHCLK-ã¯ããã¯ä¿¡å·ã HADDR-次ã®ãã§ãŒãºã§æžã蟌ã¿ãŸãã¯èªã¿åããè¡ãããŒã¿ã§ããã¢ãã¬ã¹ã¯ããã¹ã¿ãŒã«ãã£ãŠèšå®ãããŸãã HWRITE-次ã®ãã§ãŒãºã®é«ã¬ãã«ã§ããã¹ã¿ãŒã«ãã£ãŠèšå®ãããæžã蟌ã¿æäœãå®è¡ããå¿
èŠããããŸãã HRDATA-ããŒã¿ã®èªã¿åãã HREADY-çŸåšã®æäœãå®äºããããã®ãã©ã°ã HWDATA-ãã¹ã¿ãŒã«ãã£ãŠèšå®ãããèšé²ããŒã¿ã ãã¹ãŠã®ä¿¡å·ãšå¯èœãªçµã¿åããã®èª¬æãå«ããã¹ã®ããã¥ã¡ã³ãã¯ã MIPSfpgaããã±ãŒãžã«å«ãŸããŠããŸã ã
SDRAM
SDRAMãæ§ç¯ãããåºæ¬ååã¯ã HarrisïŒHarrisæç§æžã®ç¬¬5ç« [1]ã«éåžžã«è©³ãã説æãããŠããŸãã äž»ãªç¹ã«æ³šæããŠãã ããã
- ã³ã³ãã³ãµã®å é»ã®æç¡ã«é¢ããæ å ±ã¯ã1ããããæ ŒçŽããããã«äœ¿çšãããŸãã
- ã¡ã¢ãªã¯ã容éãšå¶åŸ¡ããžãã¯ã®ãããªãã¯ã¹ã®åœ¢åŒã§ç·šæãããŠããŸããåãšè¡ããããŸãã
- èªã¿åãæäœäžãã»ã«ïŒã³ã³ãã³ãµïŒã®é»è·ã¯æ¶è²»ãããŸãããèªã¿åãåŸã¯å é»ããå¿ èŠããããŸãã
- éã¢ã¯ãã£ãã®éãèç©ãããé»è·ã®å€ãïŒãããã£ããã§ã¯ãããïŒæžå°ããŸã-ã¡ã¢ãªã»ã«ã¯å®æçãªåå é»ãå¿ èŠã§ãïŒããããåçïŒã
Micron MT48LC64M8A2ãããã®äŸã§ããã«æ€èšãç¶ããŸãã éåžžã«äŸ¿å©ã§è©³çŽ°ãªããŒã¿ã·ãŒãã«å ããŠãå瀟ã¯ãã®ã¡ã¢ãªãããã§ã®äœæ¥ãã·ãã¥ã¬ãŒãããããã®ã¢ãã«ãVerilogã«æäŸããŠããŸãã ããã«ãããéçºãå€§å¹ ã«ç°¡çŽ åããããããã°ããŒããªãã§ã·ãã¥ã¬ãŒã¿å ã§MIPSfpgaãå®è¡ããã«ãŒãã«ãSDRAMãšã©ã®ããã«çžäºäœçšãããã確èªã§ããŸãã
ã¡ã¢ãªãããã®ãããã¯å³ãäžå³ã«ç€ºããŸãã
äž»ãªèŠçŽ ïŒ
- ã¡ã¢ãªã®ãã³ã¯ïŒãããªãã¯ã¹ïŒïŒ4xãã³ã¯ã¡ã¢ãªã¢ã¬ã€ïŒ-ããã«ãé¢å¿ã®ããããŒã¿ãä¿åãããŸãã ãã®ãããã«ã¯4ã€ã®ãã³ã¯ããããåãã³ã¯ã«ã¯16ãããã®8192è¡ãš1024åããããŸãã åèšãåèšããã容éã¯4x8192x1024x16 = 512 Mb = 64 MBã§ãã
- å¶åŸ¡ããã€ã¹ïŒå¶åŸ¡ããžãã¯ããã³ã¯å¶åŸ¡ããžãã¯ïŒ-åä¿¡ããã³ãã³ãã®ãã³ãŒããšãä»ã®èŠçŽ ãžã®é©åãªå¶åŸ¡ä¿¡å·ã®çºè¡ãæäŸããŸãã
- ã¢ãã¬ã¹ãã¹ã®ãã«ããã¬ã¯ãµãã©ããããã³ãŒããŒïŒè¡ã¢ãã¬ã¹ãã«ããã¬ã¯ãµã4xãã³ã¯è¡ã¢ãã¬ã¹ã©ãããšãã³ãŒããŒãåã¢ãã¬ã¹ã«ãŠã³ã¿ãŒ/ã©ãããåãã³ãŒããŒïŒ-ç°ãªãã³ãã³ãã§åä¿¡ããè¡ãåãã¡ã¢ãªãã³ã¯ã®ã¢ãã¬ã¹æ å ±ã®ã¹ãã¬ãŒãžãæäŸããŸãã
- ããŒã¿ãã¹ã®ã¬ãžã¹ã¿ãšããžãã¯ïŒããŒã¿åºåã¬ãžã¹ã¿ãããŒã¿å ¥åã¬ãžã¹ã¿ãI / Oã²ãŒãã£ã³ã°ãdqmãã¹ã¯ããžãã¯ïŒ-èªã¿åãããã³æžã蟌ã¿æäœçšã®ããŒã¿å ¥å/åºåãæäŸãããã¹ã¯ãæäœã§ããããã«ããŸãïŒ16ãããã®ãã¡ãæãå€ããŸãã¯æãå€ããã®ã®ã¿ãå¿ èŠã§ãïŒãã€ãïŒãZç¶æ ã®ããŒã¿ãã¹ã®æ€åºçµæã®å€æãæäŸãããã¹ã¯åæ¹åã§ãã
é転æ¡ä»¶
RAMãæ£ããåäœãããã«ã¯ãããã€ãã®æ¡ä»¶ãæºããå¿ èŠããããŸãã 枩床æ¡ä»¶ãåšæ³¢æ°ãšé»æºã®å®å®æ§ãä¿¡å·ã¬ãã«ïŒéçãªèŠåŸïŒãããŒãäžã®æ£ããé ç·ã®ç¢ºä¿ãªã©ããããã®ããã€ãã¯èæ ®ããŸããã ç§ãã¡ã®ããžã§ã³ã®åéã§ã¯ã
- 1ã€ãŸãã¯å¥ã®ã³ãã³ãã«å¯Ÿå¿ããæ£ããå¶åŸ¡ä¿¡å·ãäžããã
- åçãªèŠåŸã®èŠä»¶ãæºãããŠããïŒ HarrisïŒHarrisæç§æžã®ç¬¬3ç« [1] ïŒã ãããã®ããã¥ã¡ã³ãã®èŠä»¶ãèæ ®[2] ã
åé¡ã®ãããã®ã客芳çã«ç解ããããã«ãRAMããããŒã¿ãèªã¿åããšãã«ã¡ã¢ãªã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«ãäœããã¹ãããæ€èšããŠãã ããã ããããã®å Žå èªåããªãã£ãŒãžã«ããèªã¿åã-èªã¿åãæäœåŸã®ãã€ã¯ãåè·¯èªäœããå€æŽããã»ã«ã®åå é»ãæäŸããå Žåã ã¢ãžã¥ãŒã«ã®åæåïŒINITïŒãæžã蟌ã¿æäœïŒWRITEïŒããŸãã¯èªååçæïŒAUTO_REFRESHïŒã¯åãæ¹æ³ã§å®è¡ãããŸãããå®è¡ãããã³ãã³ããšæéå¶éãç°ãªããŸãã
以äžã¯ãããŒã¿ã·ãŒãããã®æç²ã§ããã³ãã³ãã®ççå€è¡šãšãããŒã¿ãæ£ããèªã¿åãæ¹æ³ã瀺ãã¿ã€ãã³ã°ãã£ãŒãã§ãã
泚ïŒL-äœã¬ãã«ãH-é«ã¬ãã«ãX-é¢ä¿ãããŸãããHigh-Z-é«ã€ã³ããŒãã³ã¹ã
泚ïŒtCMS-ã³ãã³ãã®ã»ããã¢ããæéãtCMH-ã³ãã³ãã®ããŒã«ãæéãtAS-ã¢ãã¬ã¹ã®ã»ããã¢ããæéãtAH-ã¢ãã¬ã¹ã®ããŒã«ãæéãtRCD-ã¢ã¯ãã£ããªèªã¿åãã³ãã³ããtRAS-ã³ãã³ãæéïŒACTããPREïŒãtRC-ã³ãã³ãæéïŒACTããACTïŒãtLZ-åºåäœã€ã³ããŒãã³ã¹æéãtAC-ã¯ããã¯ããã®ã¢ã¯ã»ã¹æéãtOH-åºåããŒã¿ä¿ææéãtRP-ã³ã³ãæéïŒPREããACTïŒã ããŸããŸãªæ¡ä»¶ã®ãããããã³ãã®ä»ã®ãã©ã¡ãŒã¿ãŒã®æå°å€ã¯ãã¡ã¢ãªãããã®ããã¥ã¢ã«ã«èšèŒãããŠããŸãã
ããŒã¿ãèªã¿åããšãã®ã¢ã¯ã·ã§ã³ã®ã·ãŒã±ã³ã¹ïŒã¯ããã¯ããšïŒ
T0ã CLKããã³ãã®åã®tCMSããåã«ãACTIVEã³ãã³ãã«å¯Ÿå¿ãããã³CSïŒãRASïŒãCASïŒãWEïŒãDQMïŒä»¥éãã³ãã³ããšåŒã¶ïŒã«ç¢ºç«ãããä¿¡å·ãååšããããšã確èªããŸãã 瀺ãããä¿¡å·ã¯ãCLKããã³ãã®ç¬éããtCMHäžã«ç¶æ ãå€æŽããªãã§ãã ããã tCLKãšããžã®åã®tASãããåã«ãã¢ãã¬ã¹ãã¹ã«ã©ã€ã³ã¢ãã¬ã¹ãèšå®ãïŒA [12ïŒ0]ïŒãã¡ã¢ãªãã³ã¯ã¢ãã¬ã¹ãã¹ã«ã¡ã¢ãªãã³ã¯ã¢ãã¬ã¹ãèšå®ããŸãïŒBA [1ïŒ0]ïŒã ãããã®ä¿¡å·ã¯ãCLKãšããžåŸã®tAHã®éå®å®ããŠããå¿ èŠããããŸãã
T1ã ïŒtRCD-1ã¯ããã¯ïŒäžã«NOPã³ãã³ããäžããŸãã ãã®æéééãçµéããåŸã以åã«éä¿¡ãããã©ã€ã³ã¢ãã¬ã¹ã¯ã察å¿ããã¡ã¢ãªãã³ã¯ã®è¡ã¢ãã¬ã¹ã©ããããã³ãã³ãŒããŒã«æ ŒçŽãããããšãä¿èšŒããã8192ã©ã€ã³ã®1ã€ãéžæãããŸãïŒãããæ§é å³ãåç §ïŒã
T2ã CLKããã³ãã®åã®tCMSããåã«ãREADã³ãã³ãã®å ¥åã確èªããtCMHäžã«CLKããã³ãã®ç¬éããã³ãã³ããå€æŽããªãã§ãã ããã tCLKãšããžã®åã®tASãããåã«ãã¢ãã¬ã¹ãã¹ã«åã¢ãã¬ã¹ãèšå®ããã¡ã¢ãªãã³ã¯ã¢ãã¬ã¹ãã¹ã«ã¡ã¢ãªãã³ã¯ã¢ãã¬ã¹ãèšå®ããŸãã ã¢ãã¬ã¹ãã¹ã®10çªç®ã®ãããã¯ãèªã¿åãåŸã«èªåããªãã£ãŒãžãå®è¡ããå¿ èŠãããããšã瀺ãããã«1ã«èšå®ãããŸãã
T3-T7ã NOPã³ãã³ãã¯ãããŒã¿ãèªã¿åãããŠããéãACTIVEã³ãã³ããçºè¡ãããæç¹ããïŒtRC-1ã¯ããã¯ïŒä»¥äžçºè¡ãããŠããããšã確èªããŠãã ããã
T4ã CLã¯ããã¯ãµã€ã¯ã«ïŒããããCASã¬ã€ãã³ã·ãCASïŒã®åŸãèªã¿åãããŒã¿ã¯DQããŒã¿ãã¹ã«ååšããããšãä¿èšŒãããŸãã ããæ£ç¢ºã«ã¯ããããã¯åŸã§ãã¹ã«çŸããŸãïŒ1ãµã€ã¯ã«+ tACïŒ-CAS = 2ã®å ŽåããããŠããããã¯CLKããã³ãåŸå°ãªããšãtOHã®éå®å®ããŸãã ãã®éããã¹ããããŒã¿ãèªã¿åãå¿ èŠããããŸãã
ãããå ã®çžäºäœçšãèŠããšãæéïŒ1ã¯ããã¯+ tACïŒã®éãåã¢ãã¬ã¹ã¯åã¢ãã¬ã¹ã«ãŠã³ã¿ãŒ/ã©ããã«ä¿åããã察å¿ããåãã³ãŒããŒã®åºåã§ã¡ã¢ãªãã³ã¯ä¿¡å·ãèšå®ãããå¿ èŠãªåã®16ããããéžæãããã®ããŒã¿ãéä¿¡ãããŸãããŒã¿åºåã¬ãžã¹ã¿ã§ãããæçµçã«ã¯ããŒã¿ãã¹äžã«ãããŸãïŒDQ [15ïŒ0]ïŒã
T5-T7ã æ€èšããŠããäŸã§ã¯ãã¡ã¢ãªãããããã±ãããµã€ãºBL = 4ïŒããŒã¹ãé·ãLOAD MODE REGISTERã³ãã³ãã§èšå®ãããä»ã®ãã©ã¡ãŒã¿ãŒã®äžã§ãããŒã¹ãã¢ãŒããå®è¡ããããã«æ§æãããŠããããšãåæãšããŠããŸããçŸåšã®ã¡ã¢ãªã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«ã®å®è£ ã§ã¯ãBL = 2ãšããŠæå®ãããŠããŸã32ãããã®ããŒã¿ãååŸããŸãïŒã ãã®ããã次ã®3ã¯ããã¯ãµã€ã¯ã«ã«ããã£ãŠãåã¢ãã¬ã¹ã«ãŠã³ã¿ãŒ/ã©ããã¯èªåçã«1ãã€å¢å ããããŒã¿ãã¹ã®åºåã¯å¥ã®3x16ããããåãåããŸãã
å³ã«ç€ºãããŠããããã«ãã¡ãžã£ãŒã®æ°ã¯å¿ ããã8ã«çãããªãããšã«æ³šæããŠãã ããïŒT0-T7ïŒ-ãã¹ãŠã®å¶éæéïŒtRCDãtRCãªã©ïŒã®èŠä»¶ãæºããããã«ãäžæ¹ã«å¢ããå¿ èŠããããŸãã
æéå¶çŽã®èŠä»¶ã¯ä»¥äžã«ãã£ãŠæºããããŸã
- ã¡ã¢ãªã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«ãåäœããã¯ããã¯ä¿¡å·ã«å¯Ÿããã¡ã¢ãªïŒCLKïŒãåäœããã¯ããã¯ä¿¡å·ã®äœçžå€äœ-çãééïŒtCMSãtCMHãtASãtAHãtACãtOHïŒ
- é·ãééïŒtRCDãtRCãtRPïŒã§ç©ºã®ã³ãã³ãïŒNOPïŒãäžãã-é 延ãµã€ãºã1ã¯ããã¯ãµã€ã¯ã«ã®å¹ ãè¶ ããå Žåã ãã®ããã«ã察å¿ããç¶æ ãã¢ãžã¥ãŒã«ã®ç¶æ ãã·ã³ã®æ§æã«å°å ¥ãããŸãã
ã¯ããã¯äœçžãªãã»ãã
ã¯ããã¯ä¿¡å·ã®äœçžã·ããã決å®ãããç§åŠçãã¢ãããŒããšãè©Šè¡é¯èª€ãæ³ãåççã«å¯Ÿæ¯ããåªãããœãŒã¹ïŒ [3]ããã³[4] ïŒãããã€ããããŸãã ãããã®ããã¥ã¡ã³ãã¯ãé 延å€ã眮ãæããå¿ èŠããããå®å šãªãŠã£ã³ããŠãã®å¢çãèšç®ããããã®å€ãã®å ¬åŒãæäŸããŸãã ãã®åŸãã¯ããã¯ä¿¡å·ãã·ããããŠããããã®ããã³ãããããã®ããŠã£ã³ããŠãã®äžå¿ã«ã§ããã ãè¿ããªãããã«ããããšãææ¡ãããŠããŸãã 説æããææ³ãæ©èœããããšã«åæããåãã¢ãããŒãã®ããå°ããæ yãªãããŒãžã§ã³ã«æ³šæãæããããšæããŸãïŒãã¬ãŒã³ããŒã·ã§ã³ã®12ããŒãžãš20ããŒãžã«æãããŠããããã§ãããããã«ã€ããŠã®ã³ã¡ã³ãã¯ãªãã®ã§ãç§ã¯ããã«ããŸãããããªãïŒïŒ
- ç§ãã¡ã¯ã±ãŒãžã«2æã®çŽ/ã¹ããªãããåããŸãïŒã°ã©ãçšçŽãã§ããŸãïŒ;
- ã¹ã±ãŒã«ãä¿ã¡ãªãããããããã«ããã€ãã®ã¯ããã¯ãµã€ã¯ã«ãé©çšããŸãã1ã€ã¯fpgaçšã§ããã1ã€ã¯ã¡ã¢ãªãããçšã§ãã
- ã¹ã±ãŒã«ã芳å¯ããŠãããããã«ã€ããŠæ³šæããŸãã
èªã¿åãå¯èœãªå ¥åä¿¡å·ãå€åããŠã¯ãªããªãçŠæ¢ãŸãŒã³ïŒAïŒ;
åºåä¿¡å·ã®å€ãå®çŸ©ãããŠããªããšãªã¢ã
åºåä¿¡å·ãæå¹ãªãŸãŒã³ïŒBïŒã - çŽã®ã¹ããªãããå¹³è¡ã«é 眮ããããããçžäºã«ç§»åããŠïŒa-laã¹ã©ã€ãã«ãŒã«ïŒããŸãŒã³AããŸãŒã³Bã®äžå¿ã«ã§ããã ãè¿ããå¢çãè¶ããªãããã«ããŸãã
- ã«ãŒã©ãŒã䜿çšããŠãåä¿¡ããã¯ããã¯ãªãã»ããã枬å®ããã¹ã±ãŒã«ã«åŸã£ãŠnsã«å€æããŸãã
æ£ç¢ºã§å®å®ããäœçžå€äœã確ä¿ããã«ã¯ãã·ã¹ãã ã«PLLã¢ãžã¥ãŒã«ãå«ããå¿ èŠããããŸãã éåžžãããŒããŠã§ã¢ã§ã¡ã¢ãªã€ã³ã¿ã©ã¯ã·ã§ã³ããããã°ãããšãã«ããžãã¯ã¢ãã©ã€ã¶ãŒïŒSignalTapïŒã®ã¯ããã¯åšæ³¢æ°ãšããŠäœ¿çšããããã«ãä»ã®3åã®åšæ³¢æ°ãšå°ããªäœçžã·ãããæã€3çªç®ã®ã¯ããã¯ä¿¡å·ãè¿œå ããŸãã
ã¡ã¢ãªã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«
ãã®ã»ã¯ã·ã§ã³ã«ã¯ãã¡ã¢ãªã¢ã¯ã»ã¹ã¢ãžã¥ãŒã«ã®ã¹ããŒããã·ã³ã®ç¶æ å³ãšãããŒã¿ã®èªã¿åãæé ã説æããã¢ãžã¥ãŒã«ã³ãŒãã®åã ã®è¡ïŒããã²ãŒã·ã§ã³ãç°¡çŽ åããããã®ã³ãŒãã®è¡çªå·ã®è¡šç€ºïŒãå«ãŸããŠããŸãã ã¢ãžã¥ãŒã«å šäœã®ãœãŒã¹ã³ãŒãïŒ mfp_ahb_ram_sdram.v ã ã³ãŒãã䜿çšããŠã¹ã¯ãªãŒã³ã·ã§ãããèªããšäžå¿«ã«ãªãå Žåã¯ãèšäºã®ãœãŒã¹ã³ãŒãã®ãã©ã°ã¡ã³ãïŒã³ã¡ã³ããå«ãïŒãgithubã§è€è£œãããŸãã
èªã¿åãæé ã説æããã¹ããŒããã·ã³ã®ç¶æ ã¯ãèªåããªãã£ãŒãžä»ãèªã¿åãã®å³ã®äŸã§åè¿°ããå 容ãšå®å šã«äžèŽããŠããŸãã
ãããã®ç¶æ éã®é·ç§»ã®èŠåïŒ
é 延ãå¿ èŠãªå Žåãdelay_nã¬ãžã¹ã¿ã«å ¥åãããŸããã¬ãžã¹ã¿ã®ãŒãå€ã¯ãDelayFinishedãã©ã°ã«å¯Ÿå¿ããŸãã ã¹ããŒã¿ã¹S_READ4_RD0ããã³S_READ4_RD1ã§ã¯ãããŒã¿ã¯DQãã¹ããèªã¿åãããŸãã
çŸåšã®ç¶æ ã«å¿ãããšã³ã³ãŒãã³ãã³ããšãã®åºåïŒ
ãã¹ãŠã®é 延ã¯æ§æå¯èœã§ãã¢ãžã¥ãŒã«ãã©ã¡ãŒã¿ãŒã§èšå®ãããŸããããã«ãããã¯ããã¯åšæ³¢æ°ãå€æŽãããå Žåã«èšå®ãå€æŽããã ãã§ãªããä»ã®ããŒããžã®ç§»æ€ãç°¡åã«ãªããŸãã
åç §è³æ
[1] ããããããªã¹ãšãµã©ããªã¹ã®æç§æžãããžã¿ã«åè·¯ãšã³ã³ãã¥ãŒã¿ãŒã¢ãŒããã¯ãã£ã
[2] Micron MT48LC64M8A2ã¡ã¢ãªãããã®ããã¥ã¡ã³ãã
[3] Quartusã®ããã¥ã¡ã³ãã SDRAMã³ã³ãããŒã©ã³ã¢ïŒç¿»èš³ïŒ
[4] SDRAM PLL TuningïŒãã¬ãŒã³ããŒã·ã§ã³ïŒ
[5] ã©ã€ã¢ã³ã»ãããã¥ãŒã ããžã¿ã«è«çåè·¯ã®åæïŒãã¬ãŒã³ããŒã·ã§ã³ïŒ
[6] IS42S16320Dã¡ã¢ãªãããã®ããã¥ã¡ã³ã
èšäºã§åç §ãããŠãããã¹ãŠã®ããŒã¿ã·ãŒããèšäºããã¬ãŒã³ããŒã·ã§ã³ã¯githubã§å ¥æã§ããŸãã