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

SunthyCloud阿里云国际版分销商注册教程,即可PayPal信用卡分销商服务器

阿里云国际版注册认证教程-免绑卡-免实名买服务器安全、便宜、可靠、良心,支持人民币充值,提供代理折扣简介SunthyCloud成立于2015年,是阿里云国际版正规战略级渠道商,也是阿里云国际版最大的分销商,专业为全球企业客户提供阿里云国际版开户注册、认证、充值等服务,通过SunthyCloud开通阿里云国际版只需要一个邮箱,不需要PayPal信用卡就可以帮你开通、充值、新购、续费阿里云国际版,服务...

CYUN专注海外精品服务器资源 国庆钜惠 最低5折起 限量促销

国庆钜惠 最低5折起 限量促销CYUN专注海外精品服务器资源,主营香港CN2 GIA、美国CERA、美国高防服务器资源,实体公司,ISP/IDC资质齐全,客服配备齐全。本次针对国庆推出非常给力的促销活动,旗下所有平台同享,新老客户同享,限时限量,售完截止。活动截止时间:2021年10月9日官网地址:www.cyun.net参与机型:香港CN2 GIA云服务器、香港双程CN2云服...

易探云:香港大带宽/大内存物理机服务器550元;20Mbps带宽!三网BGP线路

易探云怎么样?易探云隶属于纯乐电商旗下网络服务品牌,香港NTT Communications合作伙伴,YiTanCloud Limited旗下合作云计算品牌,数十年云计算行业经验。发展至今,我们已凝聚起港内领先的开发和运维团队,积累起4年市场服务经验,提供电话热线/在线咨询/服务单系统等多种沟通渠道,7*24不间断服务,3分钟快速响应。目前,易探云提供香港大带宽20Mbps、16G DDR3内存、...

physicalmemory为你推荐
竞赛winrar5uctuationchrome机构applej^=iáíá=fq~=OQJOU==aJPPNMO=m~dê~ó=支持ipad支持ipad地址163eaccelerator开启eAccelerator内存优化就各种毛病,DZ到底用哪个内存优化比较好。。。windows键是哪个Windows快捷键是什么windows键是哪个Windows键是哪个键啊?
长沙服务器租用 免费国际域名 网站域名备案 idc评测 pw域名 优惠码 韩国电信 512av patcha debian7 java空间 免费mysql 百兆独享 柚子舍官网 七夕快乐英文 免费防火墙 网络空间租赁 太原网通测速平台 酷番云 web服务器搭建 更多