DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU1主要内容C5400总体结构存储器结构CPU数据寻址模式程序寻址模式流水线小结DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU2C5400总体结构改进的哈佛结构多套总线独立的程序总线和数据总线(取指和数据访问可以同时进行)四套总线(一套程序总线,三套数据总线)(提高CPU的数据吞吐量)具备中断管理、重复操作及函数调用等控制机制DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU3系统控制接口PC,IPTR,RC,BRC,RSA,REA程序地址发生逻辑(PAGEN)PABPBCABCBDABDBEABEBARAU0,ARAU1AR0-AR7(DAGEN)ARP,BK,DP,SP存储器和外部接口外设接口EXP编码器MUXT寄存器SignctrlTSignctrlDAAPCD乘法器(17×17)定标器AB0MUXA(40)B(40)AMUBSignctrlSignctrlCADBSignctrlBACTDSALU(40)ABBarrelshifterMSW/LSWselectCOMPTRNTCALU(40)STRROUNDZERO数据地址发生逻辑MUXMUXC5400的功能模块DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU4C5400总体结构(续)总线结构程序总线PB,负责读取指令和数据表格数据总线CB、DB和EB,CB和DB读取数据,EB存储数据地址总线PAB、CAB、DAB和EAB外设总线DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU5C5400总体结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU6地址总线访问类型数据总线PABCABDABEABPBCBDBEB读长数据(32bit)读程序写程序读单数据读双数据写单数据并行读/写数据DualRead/CoeffRead读外设写外设读写访问中的总线使用总线结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU7存储器资源程序空间:程序代码、常系数表格数据空间:程序处理时的数据和结果I/O空间:映射为外部设备、扩展外部数据存储器等DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU8存储器资源(续)存储器类型RAM(片内或片外)ROM(片内或片外)DARAM(DualAccessRAM)SARAM(SingleAccessRAM)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU9存储器类型’541’542’543’545’546’548’549’5402’5409’5410’5420ROM程序程序/数据DARAMSARAM28K20K8K5K02K2K010K02K2K010K048K32K16K16K048K32K16K6K02K2K08K24K16K16K16K8K24K4K4K4K16K016K16K16K32K016K16K08K56K00032K168K常见的C5400系列器件的片内存储器配置存储器资源(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU10中央处理单元(CPU)40位的算术逻辑单元(ALU)、2个40位的累加器、桶形移位器、17×17位乘法器、40位加法器、比较选择存储单元(CSSU)、数据地址发生单元和程序地址发生单元片上外设通用I/O、软件可编程等待态发生器、可编程块切换逻辑、主机接口(HPI)、定时器、时钟逻辑、串行口、DMA、外部总线接口和JTAGDesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU11C5400的存储器结构C5400包括三个相互独立的数据空间、程序空间和I/O空间,每个空间为64K字,字长为16比特C5400包含片内存储器和片外可扩展存储器,片内存储器的优点包括:不需要等待状态,可以高速访问比使用外部存储器成本低比使用外部存储器功耗低DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU12存储器配置标志位存储器空间MP/MC位DROM位OVLY位0片内ROM使能并能够访问1表示片内ROM无法访问0片内RAM只映射在数据空间1片内RAM同时映射到程序空间和数据空间0片内ROM的不映射到数据空间1片内ROM的一部分映射到数据空间C5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU13存储器空间(续)C5402存储器空间20根地址线,最高位的4根可供扩展程序空间6条可对扩展程序空间寻址的指令专用寄存器—程序指针扩展寄存器(XPC)C5402的扩展后的程序空间可分成16页,每页64KC5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU145402存储器空间配置存储器空间(续)Reserved(OVLY=1)orExternal(OVLY=0)On-ChipDARAM(OVLY=1)External(OVLY=0)ExternalInterrupts(External)Page0ProgramHex0000007F00803FFF4000FF7FFF80FFFFMP/MC=1(MicroprocessorMode)MemoryMappedRegisterOn-ChipRAM16KExternalPage1DataHex0000005F00603FFF4000FFFFReserved(OVLY=1)orExternal(OVLY=0)On-ChipDARAM(OVLY=1)External(OVLY=0)ExternalInterrupts(On-Chip)Page0ProgramHex0000007F00803FFF4000FF7FFF80FFFFMP/MC=0(MicrocomputerMode)On-ChipROM4KReservedEFFFF000FEFFFF00Scratch-PadRAM007F0080ROM(DROM=1)orExternal(DROM=0)EFFFF000Reserved(DROM=1)orExternal(DROM=0)FEFFFF00DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU15C5402扩展程序空间(OVLY=0)Page064KPage164KPage1564K0000010000F00000FFFF1FFFFFFFFFXPC=0XPC=1XPC=15......存储器空间(续)C5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU16C5402扩展程序空间(OVLY=1)存储器空间(续)Page064KPage1Lower16KPage1Upper48KExternal000000FFFF100001FFFF13FFF14000Page1Lower16KPage15Upper48KExternalF0000FFFFFF3FFFF4000......C5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU17程序空间程序空间的组织主要通过设置MP/MC、OVLY和DROM位来实现片内ROM的安排自举程序u律数据A律数据正弦数据Reserved中断矢量表F800FC00FD00FE00FF00FF80C5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU18数据存储器数据空间寻址范围64K字特殊区间-存储器映射寄存器MMRCPU寄存器、片上外设寄存器“块”组织形式C5400的存储器结构(续)DROM位的设置DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU19存储器映射寄存器MMR地址(HEX)名称功能0IMR中断屏蔽寄存器1IFR中断标志寄存器2~5-保留,用于测试6ST0状态寄存器07ST1状态寄存器18AL累加器A的低位字(15~0位)9AH累加器A的高位字(31~16位)AAG累加器A的保护字(39~32位)BBL累加器B的低位字(15~0位)CBH累加器B的高位字(31~16位)DBG累加器B的保护字(39~32位)ET临时寄存器FTRN转换寄存器10AR0辅助寄存器0C5400的存储器结构(续)DesignandPracticeofDSPSystemAuthor:HuJianling,XuSheng2020/1/242003(C)DSPTechnologyCenterofSJTU20存储器映射寄存器MMR(续)11AR1辅助寄存器112AR2辅助寄存器213AR3辅助寄存器314AR4辅助寄存器415AR5辅助寄存器516AR6辅助寄存器617AR7辅助寄存器718SP堆栈指针19BK循环缓冲大小寄存器1ABRC块重复计数器1BRSA块重复起始地址1CREA块重复终止地址1DPMST处理器模式状态寄存