unitsphysicalmemory

physicalmemory  时间:2021-05-19  阅读:()
022-0045Rev.
Cwww.
rabbit.
com1TN202RabbitMemoryManagementInaNutshellTheRabbitCPUhasaMemoryManagementUnit(MMU)thatcontrolshowlogicalmemoryaddressesmapintophysicaladdresses,andaMemoryInterfaceUnitthatcontrolshowphysicaladdressesmapintoactualhardware.
TheDynamicCcompilerandlibrariesgenerallyhandlememorymappingdetailssothatmostDynamicCusersdon'thavetoconcernthemselveswithit,butsomeadvancedapplicationsmayneedtomanipulatetheMMUand/ortheMIU.
Forfurtherdetailsonmemorymanagement,seetheRabbitmicroprocessoruser'smanualforyourRabbitchip.
DefinitionsPhysical(orLinear)Addresses-20-bitaddressesrepresentingthe1Maddressspacethatlogicaladdressesmapinto.
Thehighest20-bitaddressis0xFFFFF.
ThedefaultaddressesintheDynamicCdevelopmentsystemflashstartatphysicaladdress0x00000andinRAMstartatphysicaladdress0x80000.
LogicalAddresses-16-bitaddressesrepresentinga64Kaddressspace.
Thehighest16-bitaddressis0x0FFFF.
MostRabbitinstructionsuselogicaladdresses.
ThelocationinphysicalmemorywheretheseaddressesmapintoiscompletelycontrollablebytheprogrammerviatheMMU.
Segment-Ablockoflogicalmemory;theblocksizesaremultiplesof4K(0x01000)Bank-A256KblockofPM,ona256Kboundary(0x40000).
TherearefourbanksavailablewithintheRabbitphysicaladdressspace.
Thestartingaddressofeachbankis0x00000,0x40000,0x80000,and0xC0000.
2www.
rabbit.
comTN202MemoryMappingUnitTheMMUtranslatesa16-bitlogicaladdresstoa20-bitphysicaladdress.
Thelogicaladdressspaceisdividedintofoursegments:xmem,stack,data,andbase.
ThexmemsegmentalwaysoccupiesE000h–FFFFh.
Theothersegmentsarelocatedfrom0000htoDFFFh,andareadjustableinsizetoanywherefrom0bytestoE000hbytes.
ThetotalsizeofallthreeisalwaysE000h.
ThestacksegmentstartsabovethedatasegmentandalwaysendsatDFFFh.
Thedatasegmentisalwaysabovethebasesegment.
Theboundariesbetweenthebasesegmentandthedatasegment,andbetweenthedataseg-mentandthestacksegmentaresetbyanMMUregister,SEGSIZE.
TheuppernibbleofSEGSIZErepre-sentsthestack-databoundary(in1000hbyteunits),andthelowernibblerepresentsthedata-baseboundary(in1000hbyteunits).
Eachoftheupperthreesegmentshasanassociatedsegmentregisterusedtomaplogicaladdressesthatfallwithinthesegmenttothephysicaladdressspace.
Fromtoptobottom,theyare:XPCSTACKSEGDATASEG.
Ineachcase,thephysicaladdressiscomputedbyshiftingthesegmentregisterleft12bits(multiplyingby1000h)andaddingittothel6-bitlogicaladdress.
Hereisthealgorithmforconvertinglogicaladdressestophysicaladdresses.
AbbreviationsLetSEGSIZE=XYhwhereXisthehighnibbleandYisthelownibble.
IfLA>=E000hPA=LA+(XPCx1000h)ElseIfLA>=X000hPA=LA+(STACKSEGx1000h)ElseIfLA>=Y000hPA=LA+(DATASEGx1000h)ElsePA=LAAnyofthesegmentregisterscanbeloadedwithanewvalidvalueatanytime,butthishastobedonewithgreatcare.
Forexample,ifcodeisexecutinginthexmemsegmentandtheXPCischanged,thenexecutionwillnotcontinueatthenextinstruction,butinsteadwillcontinueatthelocationinphysicalmemorywherethelogicaladdressofthenextinstructionmapsto.
ThisisbecausethePC(programcounter)registerholdsalogicaladdress.
LM-LogicalMemoryPM-PhysicalMemoryLA-LogicalAddress-addresswithintheLMPA-PhysicalAddress-addresswithinthePMTN202www.
rabbit.
com3ExampleTheMMUregistersaresetasfollows:XPC=0xF8SEGSIZE=0xD6STACKSEG=0x92DATASEG=0x7AThephysicaladdressofthebottomofthexmemsegmentisgivenby:0xF8000+0x0E000=0x06000(bit20,the21storcarrybit,isignored)Thephysicaladdressofthebottomofthestacksegmentisgivenby:0x92000+0x0D000=0x9F000Thephysicaladdressofthebottomofthedatasegmentisgivenby:0x7A000+0x06000=0x80000Notethatthedatasegmentstartsatthebeginningofthe"normal"RAMspaceand,fora128KRAM,thestacksegmentisallocated4K.
TherearespecialDynamicCfunctionstoaccessdataataspecificPA:root2xmem()andxmem2root().
Therearealsoseveralassemblylanguageinstructions:LDPformemoryaccessLCALLandLJPforbranchingNotethattheLDPinstructionsbypasstheMMUandgodirectlytotheMIU(seethenextsection).
Thefollowingdiagramillustratesthememorymappingdiscussedaboveusingthesamplecalculationswitha128Kflashanda128KRAM.
4www.
rabbit.
comTN202Figure1.
MemoryMappingBetweenLogicalAddressandPhysicalAddressMemoryInterfaceUnitTheMIUcontrolsmemoryaccessaftertheMMUdeterminesthephysicaladdress.
TherearefiveregistersassociatedwiththeMIU:MMIDRMB0CRMB1CRMB2CRMB3CRTheprimaryfunctionoftheMMIDRregisteristoallowthesystemtopermanentlyenable/CS1.
ThiscouldallowfasteraccesstotheRAMbykeepingthechipalwaysselected.
However,youwillneedtoinsurethatthe/OEand/or/WEsignalsarenotsharedwithanotherdevice.
EachofthefourMemoryBankControlRegistersMB0CR,MB1CR,MB2CRandMB3CR.
controlsone256Kquadrantofthe1Mphysicaladdressspace.
Theseregisterscontrolwaitstates,CS/WE/OElineusageandwriteprotection.
TheMBxCRregistersalsocanbesetuptoinvertaddresslinesA18andA19.
Ifbit4ofoneoftheseregis-tersisset,theMIUinvertsA18afterthelogicaltophysicalconversionisdonebytheMMU.
Ifbit5ofoneoftheseregistersisset,theMIUinvertsA19afterthelogicaltophysicalconversionisdonebytheMMU.
unusedunusedRAMFlashLogicalAddressSpaceXMEMStackDataBase0xFFFF0xE0000xD0000x60000x0000PhysicalAddressSpace0xFFFFF0xC00000xA00000x800000x400000x200000x000000x9F0000x06000TN202www.
rabbit.
com5Fora256Korsmallerdevice,addresslineinversionhasnoeffectsincethehighestaddresslineneededtoaddress256kisA17,butfora512Kdevice,thismeansthatwehaveaccesstothewhole512Kviaone256Kquadrantofphysicalmemory.
BecausewecancontrolA19aswell,each256Kquadrantofphysicaladdressescanactuallyaddressawhole1M.
This,incombinationwithdifferentCS/WE/OEcombinationscontrollablebythesameregisters,givestheRabbitaccessto6Mofmemorywithnoexternalgluelogic.
ExampleMB2CRissettomaptoCS1/WE1/OE1,andtheselinesgointoa512KRAM.
Thereforephysicaladdresses80000h-BFFFFh(quadrant2of0-3)maptooffsetsinthechipof00000h-3FFFFh(thelower256Kofthechip)usinglinesA0-A17withA18notasserted.
Nowwesetbit4ofMB2CRtoinvertA18.
Physicaladdresses80000h-BFFFFhnowmaptooffsetsinthechipof40000h-7FFFFh(theupper256Kofthechip.
)usinglinesA0-A17withA18asserted.
MMU/MIURegistersSegmentandMemoryBankRegistersTable1liststhedetailsaboutthesegmentregisters.
Table2liststhedetailsaboutthememorybankcontrolregisters.
Table1.
SegmentRegistersRegisterNameMnemonicI/OAddressR/WPostResetMMUInstruction/DataRegisterMMIDR10hR/Wxxx00000StackSegmentRegisterSTACKSEG11hR/W00000000LocatesstacksegmentinphysicalmemoryDataSegmentRegisterDATASEG12hR/W00000000LocatesdatasegmentinphysicalmemorySegmentSizeRegisterSEGSIZE13hR/W11111111Bits7.
.
4–boundaryaddressstacksegmentBits3.
.
0–boundaryaddressdatasegmentTable2.
MemoryBankControlRegistersRegisterNameMnemonicI/OAddressR/WPostResetMemoryBank0ControlRegisterMB0CR14hW00000000MemoryBank1ControlRegisterMB1CR15hWxxxxxxxxMemoryBank2ControlRegisterMB2CR16hWxxxxxxxxMemoryBank3ControlRegisterMB3CR17hWxxxxxxxx6www.
rabbit.
comTN202MemoryBankControlRegisterFunctionsThistabledetailsthefunctionalityofthememorybankcontrolregistersandthenecessarybitvalues.
Table3describestheoperationofthefourmemorybankcontrolregisters.
Theregistersarewrite-only.
Eachregistercontrolsonequadrantinthe1Maddressspace.
Bits7,6—Thenumberofwaitstatesusedinaccesstothisquadrant.
Withoutwaitstates,readrequires2clocksandwriterequires3clocks.
Thewaitstateaddstothesenumbers.
Bits5,4—Thesebitsallowtheupperaddresslinestobeinverted.
Thisinversionoccursafterthelogicthatselectsthebankregister,sosettingtheselineshasnoeffectonwhichbankregisterisused.
Theinversionmaybeusedtoinstalla1Mmemorychipinthespacenormallyallocatedtoa256Kchip.
Thelargermemorycanthenbeaccessedas4pagesof256Keach.
Thereisnoeffectoutsidethequadrantthatthememorybankcontrolregisteriscontrolling.
Bit3—Inhibitsthewritepulsetomemoryaccessedinthisquadrant.
Usefulforprotectingflashmemoryfromaninadvertentwritepulse,whichwillnotactuallywritetotheflashbecauseitispro-tectedbylockcodes,butwilltemporarilydisabletheflashmemoryandcrashthesystemifthememoryisusedforcode.
Bit2—Selectswhichsetofthetwolines/OExand/WExwillbedrivenformemoryaccessesinthisquadrant.
Bits1,0—Determineswhichofthethreechipselectlineswillbedrivenformemoryaccessestothisquadrant.
Allbitsofthecontrolregisterareinitializedtozeroonreset.
Table3.
MemoryBankControlRegisterx(MBxCR=14h+x)Bit(s)ValueDescription7:6004waitstates012waitstates101waitstates110waitstates51InvertaddressA1941InvertaddressA1831Write-protectmemorythisquadrant20Use/OE0,/WE01Use/OE1,/WE11:000Use/CS001Use/CS11xUse/CS2

iON Cloud:七月活动,洛杉矶CN2 GIA线路85折优惠中,价格偏高/机器稳定/更新优惠码

iON Cloud怎么样?iON Cloud是Krypt旗下的云服务器品牌,成立于2019年,是美国老牌机房(1998~)krypt旗下的VPS云服务器品牌,主打国外VPS云服务器业务,均采用KVM架构,整体性能配置较高,云服务器产品质量靠谱,在线率高,国内直连线路,适合建站等用途,支付宝、微信付款购买。支持Windows server 2012、2016、2019中英文版本以及主流Linux发行...

UCloud优刻得,新增1核1G内存AMD快杰云机型,服务器2元/首月,47元/年

UCloud优刻得近日针对全球大促活动进行了一次改版,这次改版更加优惠了,要比之前的优惠价格还要低一些,并且新增了1核心1G内存的快杰云服务器,2元/首年,47元/年,这个价格应该是目前市面上最低最便宜的云服务器产品了,有需要国内外便宜VPS云服务器的朋友可以关注一下。UCloud好不好,UCloud服务器怎么样?UCloud服务器值不值得购买UCloud是优刻得科技股份有限公司旗下拥有的云计算服...

Hosteons - 限时洛杉矶/达拉斯/纽约 免费升级至10G带宽 低至年$21

Hosteons,一家海外主机商成立于2018年,在之前还没有介绍和接触这个主机商,今天是有在LEB上看到有官方发送的活动主要是针对LEB的用户提供的洛杉矶、达拉斯和纽约三个机房的方案,最低年付21美元,其特点主要在于可以从1G带宽升级至10G,而且是免费的,是不是很吸引人?本来这次活动是仅仅在LEB留言提交账单ID才可以,这个感觉有点麻烦。不过看到老龚同学有拿到识别优惠码,于是就一并来分享给有需...

physicalmemory为你推荐
Anthemmy水土保持ios8请务必阅读正文之后的免责条款部分支持ipad您的iphonephotoshop技术什么是ps技术win10445端口Win10系统开放端口号怎样查看?phpechophp echo函数 是什么意思google图片搜索谁能教我怎么在手机用google的图片搜索啊!!!chromeframe谷歌浏览器(Chrome) 与(Chromium) 有什么区别?哪个更快?
国外永久服务器 唯品秀 59.99美元 网站挂马检测工具 微信收钱 免费phpmysql空间 hdd 上海服务器 免费网页申请 丽萨 中国linux 永久免费空间 后门 ssl加速 免备案cdn加速 电信主机托管 pptpvpn 在线tracert 香港云主机 堡垒主机 更多