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

cera:秋季美国便宜VPS促销,低至24/月起,多款VPS配置,自带免费Windows

介绍:819云怎么样?819云创办于2019,由一家从2017年开始从业的idc行业商家创办,主要从事云服务器,和物理机器819云—-带来了9月最新的秋季便宜vps促销活动,一共4款便宜vps,从2~32G内存,支持Windows系统,…高速建站的美国vps位于洛杉矶cera机房,服务器接入1Gbps带宽,采用魔方管理系统,适合新手玩耍!官方网站:https://www.8...

RAKsmart 2021新年新增韩国服务器及香港美国日本VPS半价

RAKsmart 商家我们肯定不算陌生,目前主要的营销客户群肯定是我们。于是在去年的时候有新增很多很多的机房,比如也有测试过的日本、香港、美国机房,这不今年有新增韩国机房(记得去年是不是也有增加过)。且如果没有记错的话,之前VPS主机也有一次磁盘故障的问题。 这不今天有看到商家新增韩国服务器产品,当然目前我还不清楚商家韩国服务器的线路和速度情况,后面我搞一台测试机进行...

菠萝云:带宽广州移动大带宽云广州云:广州移动8折优惠,月付39元

菠萝云国人商家,今天分享一下菠萝云的广州移动机房的套餐,广州移动机房分为NAT套餐和VDS套餐,NAT就是只给端口,共享IP,VDS有自己的独立IP,可做站,商家给的带宽起步为200M,最高给到800M,目前有一个8折的优惠,另外VDS有一个下单立减100元的活动,有需要的朋友可以看看。菠萝云优惠套餐:广州移动NAT套餐,开放100个TCP+UDP固定端口,共享IP,8折优惠码:gzydnat-8...

physicalmemory为你推荐
经济开发区127basedcss支持ipadgetIntjava更新iphone联通iphone4北京 朝阳区 哪家联通店可以卖Iphone4的,本周周末过去买win7关闭135端口win7系统怎么关闭135端口?网上很多方法都不好用!win7关闭135端口请问如何关闭135端口?csshack关于CSS hack的写法如何用itunes备份如何使用iTunes最新版进行备份?急!!
深圳主机租用 工信部域名备案查询 泛域名解析 singlehop vultr美国与日本 免费个人博客 qingyun 卡巴斯基官方免费版 hostker 河南移动m值兑换 网通服务器 dnspod ebay注册 lamp兄弟连 asp空间 网站防护 上海联通 亿库 phpinfo so域名 更多