最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件

上传人:M****1 文档编号:569369754 上传时间:2024-07-29 格式:PPT 页数:180 大小:2.54MB
返回 下载 相关 举报
最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件_第1页
第1页 / 共180页
最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件_第2页
第2页 / 共180页
最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件_第3页
第3页 / 共180页
最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件_第4页
第4页 / 共180页
最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件_第5页
第5页 / 共180页
点击查看更多>>
资源描述

《最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件》由会员分享,可在线阅读,更多相关《最新嵌入式系统架构软体设计 - 德霖技術學院資訊工程系PPT课件(180页珍藏版)》请在金锄头文库上搜索。

1、嵌入式系统架构软体设计嵌入式系统架构软体设计 - - 德霖技術學院資訊工程德霖技術學院資訊工程系系嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM課程介紹課程介紹qDay #3Simple RISC Assembly Language ARM Assembly LanguageARM Development Suite 使用練習qDay #4Arm Instruction setImportant ASM Programming SkillsARM/THUMB/C InterworkingqDay #5ARM Exception HandlerBuild ARM ROM Im

2、ageUse NET-Start! ucLinux BSP嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM指令執行範例指令執行範例qADD 0x16AACC:=ACC+mem0x16A嵌

3、入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM運算範例運算範例C function:Main()C=A+B;MUO 機器指令LDA 0x100ADD 0x104STO 0x108指令Opcode功能LDA S0000ACC=memSSTO S0001memS=ACCADD S0010ACC=ACC+memSSUB S0011ACC=ACC-memSJMP S0100PC=SJGE S0101If ACC= PC=SJNE S0110If ACC!=0 PC=SSTP 0111stop嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習: MUO MUO

4、微處理器的運算微處理器的運算0x000 LDA 0x1000x002 SUB 0x1040x004 STO 0x1000x006 JNE 0x0000x008 STP請描述此段程式的動作,暫存器值的變化、與資料流。請用C語言來寫出這段程式碼。指令Opcode功能LDA S0000ACC=memSSTO S0001memS=ACCADD S0010ACC=ACC+memSSUB S0011ACC=ACC-memSJMP S0100PC=SJGE S0101If ACC= PC=SJNE S0110If ACC!=0 PC=SSTP 0111stop嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -

5、using ARM嵌入式系統架構軟體設計 -using ARMModule #3-2: ARM Assembly Language嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM7TDMIARM7TDMI資料流資料流e.g.r3:=r4+(r4,2)ADD r3,r4,r4,LSL#2 A bus B bus嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM ARM 的暫存器的暫存器q30 general-purpose, 32 bits registersq1 Program Counter (PC)q1 Current Program Stat

6、us Register (CPSR)q5 Saved Program Status Registers (SPSR)User mode FIQ mode irq mode SVC mode abort mode undefined moder0r1r2r3r4r5r6r7r8r9r10r11r12r13 (sp)r14 (lr)r15 (pc)cpsr嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMProgram Status RegisterqCPSR: Current Program Status RegisterqSPSR: Saved Program Status R

7、egisterq Condition code flags N: Negative result from ALU Z: Zero result from ALU C: ALU operation Carried out V: ALU operation overflowedq Interrupt Disable bits I: disable the IRQ F: Disable the FIQq T bit Architecture xT only T=0: ARM state T=1: Thumb stateq Q: Sticky Overflow flag Architecture 5

8、TE only QADD, QSUBqJ: Processor in Jazelle stateArchitecture 5TEJ onlyqMode bitsSpecify the processor mode10000 User10001 FIQ10010 IRQ10011 SVC10111 Abort11011 Undef11111 System31 30 29 28 27 24 7 6 5 4 0N Z C V Q J undefined I F T mode嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMProgram Counter R15qARM state:A

9、ll ARM instructions are four bytes long (one 32-bit word) and are always aligned on a word boundary.The PC value is stored in bits 31:2 with bits 1:0 undefined.qIn Thumb state:All instructions are 16 bits wide, and halfword alignedThe PC value is stored in bits31:1 with bits 0 undefined.qIn Jazelle

10、state:All instructions are 8 bits wide.The processor performs a word access to read 4 instructions at once.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLink Register R14qRegister 14 is the Link Register (LR).qThis register holds the address of the next instruction after a Branch and Link (BL) instruction, which

11、 is the instruction used to make a subroutine call.qAt all other times, R14 can be used as a general-purpose register嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMOther Register R0-R13qThe remaining 15 registers have no special hardware purpose.qTheir uses are defined purely by software.qBy convention, ARM assem

12、bly language use R13 as Stack Pointer.qC and C+ compilers always use R14 as the Stack Pointer(SP).嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMStructure of ARM Assembly Language ModuleAREA Sectionname,attr,attrStart of New code or data section.CODE: contain machine instructions.READONLY: section should not be w

13、ritten to.Other attr: DATA, NOINIT, READWRITE,Declares an entry point to a program.Labels.Declares the end of the source file.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCalling Subroutines Uses BLqBL destination destination is the label on the first instruction of the subroutine.BL does:place the return addre

14、ss in the link register (R14)sets PC to the address of the subroutine.In the subroutinewe can use “MOV pc,lr” to return.By convention, R0-R3 are used to pass parameters.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCalling Subroutines Example; name this block of code; mark first instruction; to execute; Set up p

15、arameters; Call subroutine; angel_SWI reason_report Exception; ADP_Stopped_ApplicationExit; ARM semihosting SWI; Subroutine code; Return from subroutine.; Mark end of file嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMConstant Data TypesqNumbers Numeric constants are accepted in three forms:Decimal, for example,

16、123Hexadecimal, for example, 0x7Bn_XXX where: n is as base between 2 and 9 xxx is a number in that base.qBoolean TRUE and FALSE must be written as TRUE and FALSE.qCharacters constants consist of opening and closing single quotes X, enclosing either a single character or an escaped character, using t

17、he standard C escape characters.qStrings consist of opening and closing double quotes “XXXX”. If double quotes or dollar signs are used within a string as literal text characters, they must be represented by a pair of the appropriate character.For example, you must use $ if you require a single $ in

18、 the string. The standard C escape sequences can be used within string constants.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMqAlmost all ARM instructions can be conditionally executed.e.g.ADDS r0, r1, r2ADDEQ r0, r1, r2qExecute if the N, Z, C and V flags in the CPSR satisfy a condition specified in the instruc

19、tion, otherwise, NOP.Conditional ARM Instructions指令名稱條件XXXCC嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMqAlmost every ARM instruction can be executed conditionally on the state of the ALU state flags in the CPSR.qAdd an S suffix to an ARM data processing instruction to make it update the ALU state flags in the

20、 CPSRE.g. ADDS r0, r1, r2 ; r0= r1+ r2 and update ALU status in CPSR.qIn ARM state, you can:update the ALU status flags in the PSR on the result of a data operationexecute several other data operation without updating the flagsexecute following instructions or not, according to the state of the flag

21、s updated in the first operation.qIn Thumb state most data operations always update the flagsand conditional execution can only be achieved using the conditional branch instruction (B).qDo not use the S suffix with CMP, CMN, TST, or TEQ. These comparison instructions always update the flags.Conditio

22、nal Execution嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMALU Status Register in CPSRqN Set when the result of the operation was Negative.qZ Set when the result of the operation was Zero.qC when the result of the operation was Carry.A carry occurs if the result of an addition is greater than or equal to 232If t

23、he result of a instruction is positive,or as the result of an inline barrel shifter operation in a move or logical instruction.qV Set when the operation caused oVerflow.Overflow occurs if the result of an add, subtract, or compare is greater than or equal to 231, or less than 231.qQ ARM architecture

24、 v5Eonly. Sticky flag.Used to detect saturation in special saturating arithmetic instructions (e.g. QAD, ASUB, QDADD, and QDSUB),Or overflow in certain multiply instructions (SMLAxy and SMLAWy)嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMConditional Code Suffixes嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMConditional Code

25、 ExamplesqADD r0, r1, r2;r0 = r1 + r2, dont update flagsqADDS r0, r1, r2;r0 = r1 + r2, and update flagsqADDCSS r0, r1, r2;if C flag set then r0 = r1 + r2, and update flagsqCMP r0, r1;update flags based on r0-r1.qExample code sequence:MOV R0, #0LOOP ADD R0, R0, #1CMP R0, #10BNE LOOPSUB R1, R1, R0嵌入式系

26、統架構軟體設計嵌入式系統架構軟體設計 -using ARMWrite Efficient and small size Code by Conditional Instruction嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExerciseWrite program by ARM assembly, & evaluate the execution cost in clock.A Branch needs 3 cycles, others cost 1.註:唯需透過CMP, SUB, B這三個指令,加上條件式, 就可以完成。 While (r1!=r2) do if (

27、r1r2)r1=r1-r2; elser2=r2-r1;嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 -using ARM Module #3-3: ARM Development Suite使用練習嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM ADS 1.2Others: C & C+ LibrariesARM firmware suiteAM application libraryRealMonitor: for real time debug monitor嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using

28、ARMImplementation Integrationby command line, makefile, CodeWarrior嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMPre-configured Project Stationary FilesqDebugThis build target is configured to built output binaries that are fully debuggable, at the expense of optimization.qReleaseThis build target is configured

29、to output binaries that are fully optimized, at the expense of debug information.qDebugRelThis build target is configured to build output binaries that provide adequate optimization, and give a good debug view.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMPossible Development Environments嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -

30、using ARMReferenceqARM Developer Suite Version 1.2 Getting Startedq請依Chapter 3練習使用ADS。嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 -using ARM Module #3-4: ARM Instruction Set嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM ARM 指令集特點指令集特點q所有指令為32 bitsADD r0, r1, r2;r0:=r1+r2q大部分的指令,可以在一個週期內執行完成q指令皆可為有條件式執行qLoad/

31、store架構嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMThumb指令集指令集qThumb指令長度為16 bits針對程式碼的密度最佳化, 約為65%的ARM code size 適合小記憶體系統Thumb指令支援的功能為ARM指令集的一部分執行期間必須切換到Thumb模式ADDSr1,r1,#3ADDr1,#3嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMJazelleqJazelle技術可以讓ARM執行8-bit Java Bytecode硬體可以支援到95%的bytecodes速度約為一般軟體JVM的五倍嵌入式系統架構軟體設計嵌入式系統架構軟體

32、設計 -using ARMARM指令集分類指令集分類qBranch instructionsqData-processing instructionsqLoad and store instructionsqStatus register transfer instructionsqCoprocessor instructionsqException-generating instructions.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMBranch InstructionsqB BranchqBL Branch with linkStore the return a

33、ddress to r14e.g. CMP r2, #0 BLEQ function function MOV PC, r14嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMBranch Instruction EncodingqThe range of the branch instruction is +/- 32 MbytesqL: the branch and link variant.Assembly Format:BLSRmBLS嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMBranch instructions exampleqe.g. C

34、if (a=0) function 1 (1);Elsecfunction 1()function2();function2()return;qASMfunction 1 STMFDr13!, r0-r4, r14 BL function2 LDMFDr13!, r0-r4, pcfunction2 MOV pc, r14嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMData-processing Instructions EncodingAssembly Format:S Rd, Rn,#S Rd, Rn,Rm, shift嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -

35、using ARMData Processing OpcodeAssembly Format:SRd, Rn #SRd, Rn, Rm, Opcode Mnemonic MeaningEffect24:210000ANDLogical bit-wise AND Rd:=Rn & Op20001 EOR Logical bit-wise excusive OR Rd:=Rn EOR Op20010 SUBSubtract Rd:=Rn-Op20011RSBReverse subtract Rd:=Op2-Rn0100ADDAdd Rd:=Rn+Op20101 ADCAdd with carry

36、Rd:=Rn+Op2+C 0110 SBCSubtract with carry Rd:=Rn-Op2+C-10111RSCReverse subtract with carry Rd:= Op2-Rn+C-11000TSTTest Scc on Rn&Op21001TEQTest equivalence Scc on Rn EOR Op21010CMPCompare Scc on Rn-Op21011CMNCompare negated Scc on Rn+Op21100ORRLogical bit-wise OR Rd:=Rn | Op21101MOVMove Rd:=Op21110BIC

37、Bit clear Rd:=Rn AND NOT Op21111MVNMove negated Rd:=NOT Op2嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Data-processing InstructionsqArithmetic operationsADD r0,r1,r2; r0=r1+r2SUBr0,r1,r2; r0=r1-r2RSBr0,r1,r2; r0=r2-r1qBit-wise logical operationsAND r0,r1,r2; r0 = r1&r2ORRr0,r1,r2; r0 = r1| r2EORr0,r1,r

38、2; r0 = r1 xor r2BICr0,r1,r2; r0 = and not r2; bit clear 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Data-processing Instructions (cont.)qRegister movement operationsMOV r0,r2; r0=r2MVN r0,r2; r0=not r2 qComparison operations (set condition code bits N, Z, C, V)CMP r1,r2; set cc on r1-r2qImmediate oper

39、andsADD r3,r3,#1 ; r3=r3+1ANDr8,r7, #&ff; r8=r77:0& : base 16嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMShifterqLSL: Logical Left Shift (X2)qLSR: Logical Shift Right (/2)qASR: Arithmetic Right ShiftqROR: Rotate Right嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMShifter Applicationse.g. #1ADD r3,r2,r1, LSL #3;r3:= r2+8*r1e

40、.g. #2r0=r1*5 r0=r1+(r1*4) ADD r0 ,r1, r1, LSL #2嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMMultiply Instruction Binary EncodingAssembly FormatMULS Rd, Rm, RsMLAS Rd, Rm, Rs, RnS RdHi, RdLo, Rm, RsRdHi: the most significant 32 bits of 64-bit format numberRdLo: the least significant 32 bits of 64-bit format nu

41、mberOpcode Mnemonic Meaning Effect23:21000 MUL Multiply (32-bit result)Rd:=(Rm*Rs)31:0001 MLA Multiply-accumulate (32-bit result)Rd:=(Rm*Rs+Rn)31:0100 UMULL Unsigned multiply longRdHi:RdLo:=Rm*Rs101 UMLAL Unsigned multiply-accumulate longRdHi:RdLo+=Rm*Rs110 SMULL Signed multiply longRdHi:RdLo:=Rm*Rs

42、111 SMLAL Signed multiply-accumulate longRdHi:RdLo+=Rm*Rs嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMAssembly Format:CLZS Rd, RmqSets Rd to the number of the bit position of the most significant 1 in Rm. If Rm=0 Rd=32.qE.g.MOV r0, #&100CLZr1, R0r1=8Count Leading Zeros Instruction (v5T only)嵌入式系統架構軟體設計嵌入式系統架構軟體

43、設計 -using ARM練習練習q用ARM Assembly寫一個程式,包含一個subroutine用來做x10的運算。 q用ADS環境。q不支援具有乘法器功能的ARM Core 。main()x=5;y=mul_ten(x);int mul_ten(x)return 10*x; 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM Single Word and Unsigned Byte Data Transfer Instruction Binary EncodingAssemble Format:LDR|STRB Rd,Rn, !; Pre-indexed formLD

44、R|STRB Rd,Rn, ; Post-indexed formLDR|STRB Rd,LABEL; PC-relative form嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoad and Store ExamplesqSingle register load and store LDRr0, r1 ; r0 := mem32r1STR r0, r1; mem32r1 := r0qBase plus offset addressing Pre-indexing LDR r0, r1, #4 ; r0 := mem32r1+4Auto indexing LDR r0

45、, r1, #4! ; r0 := mem32r1+4, r1=r1+4Post-indexed LDR r0, r1, #4 ; r0 := mem32r1, r1=r1+4PC-relative LDR r1, UART_ADD; UART address into r1 STRBr0, r1; store data to UART UART_ADD &10000000; address literal 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMHalf-word and Signed Byte Data Transfer Instruction Binary En

46、codingAssemble Format:LDR|STRH |SH|SB Rd;Rn, ! ; Pre-indexed formLDR|STRH |SH|SB Rd;Rn, ; Post-indexed form An unsigned value is zero-extended to 32 bits when loaded; A singed value is extended to 32 bits by replicating the most significant bit of the data.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMHalf-word

47、Load/Store ExampleADR r1, ARRAY1; half-word array startADR r2, ARRAY2; word array startADR r3, ENDARR1 ; ARRAY1 end +2LOOP LDRSH r0, r1, #2; get signed half-wordSTR r0, r2, #4; save wordCMP r1, r3; check for end of arrayBLT LOOP; if not finished, loop嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:字串複製練習:字串複製q寫

48、一個Assembly程式做字串複製的動作。q用ADS環境。A=“Hello, this is a sunny day!”B=“ ”嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMMultiple Register Data Transfer Instruction Binary EncodingIn a non-user mode, CPSP may be restored by:LDM|Rn!, Full or empty: The stack pointer can either point to the last item in the stack (a full st

49、ack), or the next free space on the stack (an empty stack).Assembly Format:LDM|STM Rn!, IA: Increment after.IB: Increment before.DA: Decrement after.DB: Decrement before.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Addressing Mode for LDM/STM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMISR Exampleqe.g. Interrupt ha

50、ndler_irq void IRQHandler(void) volatile unsigned int *base=(unsigned int *) 0x80000000; If (*base=1) C_int_handler_1( ); *(base+1)=0; IRQHandler PROCSTMFDspl,r0-r4, r12, lrMOVr4,#0x80000000LDRr0, r4,#0SUBsp,sp,#4CMPr0,#1 BLEQ C_int_handlerMOV r0,#0STR r0,r4,#4ADD sp, sp, #4LDMFD spl,r0-r4, r12, lrS

51、UBSpc, lr, #4嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSwap Memory and Register Instruction Binary EncodingAssembly Format:SWPB Rd,Rm,Rn嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSWP ExampleADR r0, SEMAPHORESWPB r1, r1, r0 ; exchange byter0r1r?0嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMStatus Register to General Register Trans

52、fer Instruction Binary EncodingAssembly Format:MRSRd,CPSR|SPSRE.g.MRS r0, CPSR; move the CPSR to r0MRS r3, CPSR; move the SPSR to r3Note: The SPSR form should not be used in user or system mode.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMTransfer to Status Register Instruction Binary EncodingAssembly Format:MR

53、SCPSR_f|SPSR_f, #MRSCPSR_|SPSR_, RmC - the control field PSR7:0X the extension field PSR15:8S the status field PSR23:16F the flags field PSR31:24嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMMSR ExampleqSet N, C,V, Z flags:MSRCPSR_f, #&f0000000 ; set all the flagsqSet C flag, preserving N, Z, and VMRSr0, CPSR ;

54、move the CPSR to r0ORRr0, r0, #&20000000 ; set bit 29 of r0MSR CPSR_f, r0 : move back to CRSR嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:切換練習:切換ARM操作模式操作模式q寫一段程式,將ARM由Supervisory mode切換到IRQ mode。q用ADS環境。31 30 29 28 27 24 7 6 5 4 0N Z C V Q J undefined I F T mode q Mode bits Specify the processor mode 10000U

55、ser 10001 FIQ 10010 IRQ 10011 SVC 10111Abort 11011 Undef 11111 System嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCoprocessor InstructionsqThere are 3 types:Coprocessor data operationsCDP: initiate a coprocessor data processing operationCoprocessor Register transfersMRC: Move to ARM register from coprocessor re

56、gisterMCR: Move to coprocessor register from ARM registerCoprocessor Memory transferLDC: load coprocessor register from memorySTC: store from coprocessor register to memory嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMException-generating & Semaphore InstructionsqSWIUsed to cause a Software Interrupt exception t

57、o occurSWI SWI 0x123456qBKPTUsed from software breakpoints in ARM architecture 5 or above. Cause a Prefetch Abort exception to occur.BKPT 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSummary of ARM ArchitecturesCore ArchitectureARM1v1ARM2v2ARM2as, ARM3v2aARM6, ARM600, ARM610v3ARM7, ARM700, ARM710v3ARM7TDMI, ARM

58、710T, ARM720T, ARM740Tv4TStrongARM, ARM8, ARM810v4ARM9TDMI, ARM920T, ARM940Tv4TARM9ES, XScale Microarchitecturev5TEARM10TDMI, ARM1020Ev5TE926EJ-S/1026EJ-Sv5TEJ嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReferenceqS. Furber, ARM system-on-chip Architecture, 2nd ed. Addison-WesleyqSeal. ARM architecture referenc

59、e manual, 2nd ed. Addison-WesleyqARM Development Suite User Guide嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 - using ARMModule #3-5: Important ARM ASM Programming Skills嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoad Constant into RegisterqDirect loading with MOV and MVNqLoading with LDR Rd,=const嵌入式系統架構軟體設計

60、嵌入式系統架構軟體設計 -using ARMDirect Load Constant into RegisterqMovcondS,Operand2Load immediate constant to registerE.g.MOV R1,0x18 ;R1=0x18Can load any 8-bit constant, giving a range of 0x00 to 0xFFqMVN: load the bitwise complement of these values. The numerical values are (n+1).Compiler ERROR MSG: Immedi

61、ate n out of range for this operation.224嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoading with LDR Rd,=constqThe LDR Rd,=const pseudo-instruction can construct any 32-bit numeric constant in a single instructionqThe LDR pseudo-instruction generates the most efficient code for a specific constant:If the cons

62、tant can be constructed with a MOV or MVN instruction, the assembler generates the appropriate instruction.If the constant cannot be constructed with a MOV or MVN instruction, the assembler:Places the value in a literal pool.Generates an LDR instruction with a program-relative address that reads the

63、 constant from the literal pool.qe.g.:LDR Rn,pc,#offset to literal pool;load register n with one word from the address pc+offsetLiteral Pool: A portion of memory embedded in the code to hold constant values.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLDR & Literal Pool Example; ; c:ARMADSv1_2Examplesasmloadcon

64、.sAREALoadcon, CODE, READONLYENTRYSTARTBLfunc1BLfunc2stop MOVr0,#0x18; =MOV R0, #42LDRr1, =0x20026SWI0x123456func1LDRr0, =42; =MOV R0, #42LDRr1, =0x55555555; =LDR R1, PC, #offset to Literal Pool lLDRr2, =0xFFFFFFFF; =MVN R2, #0MOVpc, lrLTORGLitetal Pool l constainsLitetal 0x55555555func2LDRr3, =0x55

65、555555; =LDR R3, PC, #offset to Literal Pool lLDRr4, =0x66666666; If this is uncommented it is out of reach; fails, because Literal Pool 2MOV pc, lrLargeTableSPACE 4200; Starting at the current location; clears a 4200 bytes area of memory; to zero, reserves a zeroed block of memory; Literal Pool 2 i

66、s emptyEND嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoading Addresses into RegistersqDirect loading with ADR and ADRLqLoading addresses with LDR Rd, =label.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMDirect Loading with ADRqThe assembler converts an ADR Rn, label pseudo-instruction by generating:A single ADD or SUB ins

67、truction that loads the address, if it is in rangeAn error message if the address cannot be reached in a single instruction.The offset range is 255 bytes for an offset to a non word-aligned address, and 1020 bytes (255 words) for an offset to a word-aligned address.E.g.ADRr2, Label+1000ADR r2, Label

68、 +211嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMDirect Loading with ADRLqThe assembler converts an ADR Rn, label pseudo-instruction by generating:Two data-processing instruction that load the address, if it is in rangeAn error message if the address cannot be constructed in two instructionsThe range of an ADR

69、L pseudo-instruction is 64KB for a non word-aligned address and 256 KB for a word-aligned address.E.g. ADRL r2, Label +4300嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMADR and ADRL Example; c:ARMADSv1_2Examplesasmadrlabel.sAREAadrlabel, CODE, READONLYENTRYSTARTBLfuncstopMOVr0,#0x18; angel_SWIreason_ReportExcept

70、ionLDRr1,=0x20026; ADP_Stopped_ApplicationExitSWI0x123456; ARM semihosting SWILTORG; Create a literal poolFuncADRr0, Start; =SUB r0, PC, #offset to StartADRr1, DataArea; =ADD r1, PC, #offset to DataArea;ADRr2, DataArea+4300; =This would fail because the offset ; cannot be expressed by operand2 of an

71、 ADDADRLr2, DataArea+4300; =ADD r2, r2, #offset1; ADD r2, r2, #offset2MOVpc, lr; ReturnDataAreaSPACE 8000; Starting at the current location.; clears a 8000 byte area of memory to zero END嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoading Addresses with LDR Rd,=labelqLoad any 32-bit constant into a registerqTh

72、e assembler converts an LDR r0,=label pseudo-instruction by:Placing the address of label in a literal pool (a portion of memory embedded in the code to hold constant values).Generating a program-relative LDR instruction that reads the address from the literal pool, for example: LDR rn pc, #offset to

73、 literal pool ; load register n with one word from the address pc + offset 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample for LDR Rd, =label; c:ARMADSv1_2examplesasmldriabel.sAREALDRlabel, CODE, READONLYENTRYSTARTBLfunc1BLfunc2stopMOVr0,#0x18LDRr1,=0x20026SWI0x123456func1LDRr0, =start; =LDR R0, PC, #offse

74、t into Literal Pool 1LDRr1, =Darea+12; =LDR R1, PC, #offset into Literal Pool 1LDRr2, =Darea+6000; =LDR R2, PC, #offset into Literal Pool 1MOVpc, lrLTORG; Litetal Pool l func2LDRr3, =Darea+6000; =LDR R3, PC, #offset into Literal Pool 1(sharing with previous literal);LDRr4, =Darea+6004; If uncommente

75、d produces an error as Literal Pool 2 is out of rangeMOV pc, lrDareaSPACE8000; Literal Pool 2 is out of range of the LDR instructions aboveEND嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExercise: Implement a Jump Table; c:ARMADSv1_2examplesasmjump.sAREAJump, CODE, READONLYCODE32Num EQU2; Number of entries in j

76、ump tableENTRYSTARTMOVr0,#0; Set up the three parametersMOVr0,#3MOVr0,#2BLarithfunc; Call the functionstop MOVr0,#0x18LDRr1,=0x20026SWI0x123456arithfuncCMPr0, #num; Label the functionMOVHSpc, lr; Treat function code as unsigned integerADRr3, JumpTable; if code is =num then simply returnLDRpc, R3,R0,

77、LSL#2; load address of jump tableLTORG; Jump to the appropriate routineJumpTableDCDDoAddDCDDoSubDoAddADDr0, r1, r2; Operation 0MOVpc, lr; ReturnDoSubSUBr0, r1, r2; Operation 1MOVpc, lr; ReturnEND; Mark the end of the fileTrace this program!And make a flow chart.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExerc

78、ise: String Copy; c:ARMADSv1_2examplesasmstrcopy.sAREAStrCopy, CODE, READONLYENTRYStartLDRr0,=srcstr; Point to first stringLDRr0,=dststr; Point to second stringBLstrcopy; Call subroutine to do copyStopMOVr0,#0x18LDRr1,=0x20026SWI0x123456strcopyLDRBr2, r1,#1; Load byte and update addressSTRBr2, r0,#1

79、; Store byte and update addressCMPr2, #0; Check for zero terminatorBNEstrcopy; Keep going if notMOVpc, lrAREAStrings, DATA, READWRITEsrcstrDCBFirst string-source,0dststrDCBSecond string-destination,0ENDTrace this program!And make a flow chart.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLoad and Store Multiple

80、Register InstructionsqAn efficient way of moving the contents of several registers to and from memoryqUsed for block copy and for stack operations at subroutine entry and exitqThe advantages include: (Compare to single L/S)Smaller code sizeSingle instructions fetch overheadOn uncached ARM processors

81、, the first word of data transferred by a load or store multiple is always a nonsequential memory cycle, but all subsequent words transferred can be sequential memory cycles.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMLDM and STM InstructionsqThe load ( or store ) multiple instruction loads (stores) any subset

82、 of the 16 general-purposes registers from (to) memory, using a single instruction.qSyntax:LDM cond address-mode Rn1, reg-list!:Specifies base register write back. If this is specified, the address in the base register is updated after the transfer.:Specifies that the CPSR is restored from the SPSR.

83、 It must be used only from a privileged mode (i.e. other than user mode).qE.g.LDMIA r0!, r2-r9STMIA r1, r0-r10.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMAddressing Mode for LDM/STMqIA: Increment afterqIB: Increment beforeqDA: Decrement afterqDB: Decrement beforeqFull of empty: The stack pointer can either po

84、int to the last item in the stack (a full stack), or the next free space on the stack (an empty stack).qNote: The ARM-Thumb Procedure Call Standard (ATPCS), and ARM and Thumb C and C+ compiles always use a full descending stack.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Addressing mode for LDM/STM嵌入式系

85、統架構軟體設計嵌入式系統架構軟體設計 -using ARMStacking Registers for Nested SubroutinesSubroutine STMFD sp!, r5-r7,r ; Push work registers and lr; code Note: Your codes use r5,r6,r7,lr.BL xxxx_xxxx; codeLDMFD sp!, f5-f7,pc ; Pop work registers and pc嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMUsing Macro MACRO$Label TestAndBra

86、nch $dest,$reg,$cc$Label CMP $reg, #0 B$cc $dest MENDAfter substitution this becomes:test CMP r0, #0 BNE NonZero NonZeroThis macro can be invoked as follows:test TestAndBranch Non Zero, r0, NE NonZero嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 -using ARMModule #4-1: ARM-Thumb Interworking嵌入式系統架構軟體設

87、計嵌入式系統架構軟體設計 -using ARMOutline嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM-Thumb Procedure Call Standard (ATPCS)qTo ensure that separately compiled or assembled subroutines can work together.qRegister roles and namesqThe stackA full, descending stackEight-byte alignment at all external interfaces. 嵌入式系統架構軟體

88、設計嵌入式系統架構軟體設計 -using ARMParameter PassingqNonvariadic: A routine with a fixed number of arguments is.The first integer arguments are allocated to r0-r3 in order.Remaining parameters are allocated to the stack in order.qVariadic routine: A routine with a variable number of arguments.a1-a4, a1 first.T

89、he stack, lowest address first.#include int ShowVar(char *szTypes, .)va_list vl;va_start (vl, szTypes);.void main()ShowVar(fcsi,32,4f,a,Test string,4);嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMWhen to Use InterworkingqCode densityThumb state has better code densityqSpeed considerationRunning in ARM state has

90、 better efficiency than Thumb state.qFunctionalityThumb instructions are less flexible than their ARM equivalents.Some operations are not possible in thumb state.e.g. enable/disable interrupt & A state change.qException handingThe processor automatically enters ARM state when a processor exception o

91、ccurs.This means that the first part of an exception handler must be coded with ARM instructions, even if it re-enters Thumb state to carry out the main processing of the exception.qStandalone Thumb programsqA thumb-capable ARM processor always starts in ARM state.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMNo

92、n-interworking Function CallqImplementing a function call usually requires two steps:Store the return address in the link register (LR)Branch to the address of the required functionvoid mouse() monkey(); void monkey() return(); mouse() BL monkey ; monkey() MOV pc, lr嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM

93、ARM/Thumb Interworking Function CallqUse BX or BLXqBX does not store return address in LR automatically.- return from function by BX LR to original state.qv5T supports BLX嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMBLX ExampleqA call to Thumb subroutine:CODE32; ARM code follows.BLXTSUB; call thumb routine.CODE

94、16; start of Thumb codeTSUB.; Thumb subroutineBXr14; return嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMARM/Thumb Interworking ExampleAREAAddReg. CODE,READONLY ;Name this block of code.ENTRY ; Mark first instruction to call.mainADR r0, ThumbProg + 1 ;Generate branch target address ; and set bit 0, hence arrive

95、; at target in Thumb state.BXr0 ; Branch exchange to ThumbProgCODE16 ; Subsequent instructions are Thumb codeThumbProgMOV r2,#2 ; Load r2 with value 2MOV r3,#3 ; Load r2 with value 3ADD r2,r2,r3 ; r2=r2+r3ADR r0,ARMProgBX r0 CODE32 ; Subsequent instructions are ARM code.ARMProgMOV r4,#4MOV r5,#5ADD

96、r4,r4,r5StopMOV r0,#0x18 ; angel_SWIreason_ReportExceptionLDR r1, =0x20026 ; ADP_Stopped_ApplicationExitSWI 0x123456 ;ARM semihosting SWIEND ; Mark end of this file嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習:ARM/Thumb Interworking #1qTrace code:ADSv1_2exampleasmthumbsub.mcpMonitor CPSR with PC嵌入式系統架構軟體設計

97、嵌入式系統架構軟體設計 -using ARMC Functions&InterworkingqCompiler C to run in Thumb&support interworkingtcc -c-g-O1-apcs/interwork thumbmain.cqCompiler C to run in ARM state & support intherworking armcc -c-g-O1 -apcs/interwork armsub.cqLinkarmlink thumbmain.o armsub.o -o thumbtoarm.axf -info veneers ; By arm

98、cc apcs/interwork;By tcc apcs/interworkxxxxxxVoid xxx() STMFD SP!, r4-r11, lr PUSH SP!, r4-r7,lr BL sub BL subfunc(); LDMFD SP!, r4-r11, lr POPSP!, r4-r7, lr BXlr POPr3 BXr3嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習:ARM/Thumb Interworking #2ADSv1_2examplesinterwork*.c1.ARM (main) code calling a Thumb su

99、broutine2.armcc -c-g-O1 - apcs/interwork armmain.c3.tcc -c -g-O1 -apcs/interwork thumbsub.c4.armlink armmain.o thumbsub.o -o armtothumb.axf -info veneers2.Thumb (main) code calling an Arm subroutine3.tcc -c-g-O1 -apcs/interwork thumbmain.carmcc -c -g-O1 apcs/interwork armsub.carmlink thumbmain.o arm

100、sub.o -o thumbtoarm.axf -info veneersqRun the code by AXD嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMMixing C & AssemblerqInline Assembler qC calls ASM functionqASM call C function嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMInline AssemblerqThe ARM C compiler support inline assembly language with the _asm specifier.qThe

101、ARM C+ compilers support the asm syntax proposed in the ANSI C+ Standard, with the restriction that the string literal must be a single string. e.g:asm(“instruction;instruction”);qARM C+ supports the C compiler _asm sytax._asm instruction ; instructioninstruction 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMRes

102、triction of Inline AssemblerqNot supportLDR Rn, =expressLabel expressionADR, ADRL& cant be used to express hex. (use 0x prefix instead)BX, BLXqCant write to PC嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMString Copy Example#include int main(void)const char *a=“Hello world!”;char b20;_asm MOVR0, a MOVR1, b BL my

103、_strcpy, R0, R1printf(“Original string: %sn”,a);printf(“Copied string: %sn”,b);return 0;Void my_strcpy(char *src, const char *dst ) int ch; _asm loop:#ifndef_thumb / Arm version LDRBch,src, #1 STRBch,dst,#1#else /Thumb version LDRBch, src ADDsrc,#1 STRBch,dst ADDdst,#1#endif CMPch,#0 BNEloop 嵌入式系統架構

104、軟體設計嵌入式系統架構軟體設計 -using ARMSome Issues to Use Inline AssemblerqUse r0-r3, ip, lr and CPSR with caution.E.g.Int funct(int x)._asmadd r0,r0,#1/we cant assert x is in r0add x,x,#1/correct usageqDont save &restore physical registers.E.g.int funct(int x)._asmstmfd sp! r0/save r0add r0,x,1eor x,r0,xldmfd s

105、p!, r0/restore r0嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMASM calls C example ; int f(int i) return g(i,2*i,3*i,4*i,5*i);EXPORT fAREA f, CODE, READONLYIMPORT g; i is in r0str LR,SP, #-4!; preserve lrADD r1,r0,r0; computer 2*i (2nd param)ADD r2,r1,r0; computer 3*i (3nd param)ADD r3,r1,r2; computer 5*iSTR r3,

106、 sp,#4!; 5th param on stackADD r3,r1,r1; computer 4*i (4nd param)BL g; branch to C functionADD sp, sp, #4; remove 5th paramLDR pc,sp,#4; returnENDint g(int a, int b, int d, int e) return a+b+c+d+e;嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMAccess C Global VariablesqUse “IMPORT”qUse “LDR/STR”qE.g.AREAglobal_va

107、riable, CODE, READONLYEXPORT asmsubIMPORT glob_varasmsubldrr1,=glob_var; read address of glob_var; into r1 from literal poolldrr0, r1addr0, r0, #10strr0, r1movpc, lrEND嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMC call ASM Exampleinstall_directoryexampleasm as strtest.c and scopy.s#include extern void strcopy(

108、char*d, const char *s);int main() const char *srcstr = “First string -source”; char dststr = “Second string - destination”;/ *dststr is an array since were going to change it*/printf(“Before copying:n”);printf(“%sn %sn”,srcstr,dststr);strcopy(dststr,srcstr);printf(“After copying:n”);printf(“ %sn %sn

109、”,srcstr,dststr);return(0); AREA SCopy,CODE,REAONLY EXPORT strcopystrcopy; r0 points to destination string.; r1 points to source string. LDRB r2,r1,#1; Load byte and update address. STRB r2,r0,#1; Store byte and update address. CMP r2,#0; Check for zero terminator. BNE strcopy; Keep going if not. MO

110、V pc,lr; Return. END 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習:Inlie IRQ Controllerq分別寫一個disable interrupt 和enable interrupt 的inline assembler subroutine。_inline void enable_IRQ(void)._inline void disable_IRQ(void).q在c 的main function 去呼叫執行嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 -using ARMModule #4

111、-2: ARM Exception Handler嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMException Type & Vector Address嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMException Handling by ARM CoreqWhen an exception occurs, the banked versions of R14 and the SPSR for the exception mode are used to save state as follows:1. R14_ = return link2.

112、SPSR_ = CPSR3. CPSR4:0 = exception mode number4. CPSR5 = 0/*Execute in ARM state*/5. if = = Reset or FIQ then?6. CPSR6 = 1/*Disable fast interrupt else CPSR6 is unchanged*/7. CPSR7 = 1/* Disable normal interrupts*/8. PC = exception vector addressq Summary:Copy PC into r14_mode, save CPSR into SPSRCh

113、ange to appropriate exception modePC is force to 0x0-0x1cPriority ExceptionHighest 1 Reset 2 Data Abort 3 FIQ 4 IRQ 5 Prefetch AbortLowest 6 Undefined instruction SWI嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReset Exception1. R14_svc = UNPREDICTABLE value2. SPSR_svc = UNPREDICTABLE value3. CPSR4:0 = 0b10011/

114、*enter supervisory mode*/4. CPSR5 = 0/*Execute in ARM state*/5. CPSR6 = 1/*Disable fast interrupts*/6. CPSR7 = 1/*Disable normal interrupts*/7. If high vectors configured then PC = 0xFFFF0000else PC = 0x00000000嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMUndefined Instruction ExceptionqWhile to execute an co-p

115、rocessor instruction, ARM cant get response from co-processor.qAttempt to execute an instruction that is UNDEFINED.qCan be used for software emulation of a coprocessor in a system that does not have physical coprocessor.qAction performed:1.R14_und = address of next instruction after the undefined in

116、struction 2.SPSR_und = CPSR3.CPSR4:0 = 0b11011/*enter Undefined mode*/4.CPSR5 = 0/*Execute in ARM state*/5.CPSR6 /*unchanged*/6.CPSR7 = 1/*Disable normal interrupts*/7.If high vectors configured then8. PC = 0xFFFF00049. else10. PC = 0x00000004 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSoftware InterruptqSoft

117、ware Interrupt Instruction (SWI) enters supervisor mode.qAction performed:1.R14_svc = address of next instruction after the undefined instruction 2.SPSR_svc = CPSR3.CPSR4:0 = 0b10011/*enter supervisor mode*/4.CPSR5 = 0/*Execute in ARM state*/5.CPSR6 /*unchanged*/6.CPSR7 = 1/*Disable normal interrupt

118、s*/7.If high vectors configured then8. PC = 0xFFFF00089. else10. PC = 0x00000008 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReturn from Undefined Instruction&Software Interrupt ExceptionsqSimpleMOVSpc, lrqIn exception handlerSTMFDsp!, reglist, lr.LDMFDsp!, reglist, pc: Auto restore CPSR from SPSR.嵌入式系統架構軟體設計嵌

119、入式系統架構軟體設計 -using ARMPrefetch Abort ExceptionqIf processor attempts to fetch an instruction from an illegal address, the instruction is marked as invalid. (in pipeline)qWhen reach the invalid instruction, prefetch abort exception is generated.1.R14_abt = address of aborted instruction +4 2.SPSR_abt

120、= CPSR3.CPSR4:0 = 0b10111/*enter Abort mode*/4.CPSR5 = 0/*Execute in ARM state*/5.CPSR6 /*unchanged*/6.CPSR7 = 1/*Disable normal interrupts*/7.If high vectors configured then8. PC = 0xFFFF000C9. else10. PC = 0x0000000C 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReturn from Prefetch Abort ExceptionqSimpleSUBSp

121、c, lr,#4qException handlerSUBSlr,lr,#4STMFDsp!, reglist, lr.LDMFDsp!, reglist, pc嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMData AbortqSignaled by the memory system.qAction performed:1.R14_abt = address of aborted instruction +8 2.SPSR_abt = CPSR3.CPSR4:0 = 0b10111/*enter Abort mode*/4.CPSR5 = 0/*Execute in A

122、RM state*/5.CPSR6 /*unchanged*/6.CPSR7 = 1/*Disable normal interrupts*/7.If high vectors configured then8. PC = 0xFFFF00109. else10. PC = 0x00000010嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReturn from Data Abort ExceptionqSimpleSUBSpc, lr,#8qException handlerSUBSlr,lr,#8STMFDsp!, reglist, lr.LDMFDsp!, regli

123、st, pc嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMFIQ Exception Handling by ARMWhen an FIQ is detected, the following actions are performed:R14_fiq = address of next instruction to be executed +4SPSR_fiq = CPSRCPSR4:0 = 0b10001/*enter FIQ mode*/CPSR5 = 0/*Execute in ARM state*/CPSR6 = 1 /*Disable fast interrup

124、ts*/CPSR7 = 1/*Disable normal interrupts*/If high vectors configured then PC = 0xFFFF001Celse PC = 0x0000001CTo return after servicing the interrupt, use:SUBS PC, R14,#4嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMFIQ Exception Handler by ProgrammerqYour FIQ handlerSUBSlr, lr,#4STMFDsp!, r0-r4, lr.LDMFDsp!, r0-

125、r4, pc嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMIRQ ExceptionqAction performed:1.R14_irq = address of next instruction to be executed +42.SPSR_abt = CPSR3.CPSR4:0 = 0b10010/*enter IRQ mode*/4.CPSR5 = 0/*Execute in ARM state*/5.CPSR6 /*unchanged*/6.CPSR7 = 1/*Disable normal interrupts*/7.If high vectors confi

126、gured then8. PC = 0xFFFF00189. else10. PC = 0x00000018ReturnSUBSpc,lr,#4嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMImplement a SWI HandlerqADSv1_2examplesswi*main.cinstalls the SWI vector in the exception table, then calls SWIs (0, 1, 2 & 3) via_swi().ahandle.stop-level SWI handler written in assembler. Ident

127、ify ARM&thumb SWIs then pass to chandle.c for processing.chandle.csecond-level SWI handler, called from ahandle.s.SWIs 0, 1, 2 & 3 execute some simple arithmetic.Swi.hcontains the definitions of _swi(), _swi(1), _swi(2) &_swi(3). 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCalling SWI from An Application qIn a

128、ssembly, set up required register values then issue SWI.MOVr0,#65SWI 0x0;call SWI 0x0 with parameter value in r0qC/C+, declare the SWI as an _SWI function, and call it._swi() void my_swi(int);my_swi(65);qProvide that:Any arguments are passed in r0-r3 only.Any results are returned in r0-r3 only. If t

129、here are 2-4 return values, those must be returned by a structure.Directive as _value_in_regs嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSWI Function Declare&Usage/ from exampleSWIswi.h_swi(0) int multiply_two(int, int);_swi(1) int add_two(int, int);_swi(2) int add_multiply_two(int, int, int, int);struct four_

130、resultsint a;int b;int c;int d;_swi(3) _value_in_regs struct four _results many_operations(int, int, int, int);/ calling examplestructure four_results res_3;res_3 = many_operations(1, 2, 3, 4);add_two(1, 2);嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMParameters PassingqWe can pass values in and out of a SWI ha

131、ndler written in C, provided that the top-level handler passes the stack pointer into the C function as the second parameter.MOVr1, spBL C_SWI_HandlerParameter0 = reg0Parameter1 = reg1Parameter2 = reg2Parameter3 = reg3qWrite backreg0 = updated_value_0reg1 = updated_value_1reg2 = updated_value_2reg3

132、= updated_value_3嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMIdentify SWIqWhen a SWI handler is entered, it must establish which SWI is being called.Load the SWI instruction that cause the exception.LDR r0, lr, #-4Extract the SWI number by clearing the 31-24 bits.BICr0,r0,#0xFF000000嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -usi

133、ng ARMUsing SWI in Supervisory ModeqCall a SWI in supervisory mode LR_SVC and SPSR_SVC are corrupted.qTherefore, we must store LR_SVC and SPSR_SVC when a SWI is called. MRSr0, spsr; Get spsrSTMFDsp!, r0; Store spsr onto stack.LDMFDsp!, r0; get spsr from stackMSRspsr_cf, r0; restore spsr嵌入式系統架構軟體設計嵌入

134、式系統架構軟體設計 -using ARMIdentify SWI from Arm/Thumb.T_bit EQU 0x20SWI_HandlerSTMFDsp!, r0-r3, r12, lr ; Store registersMOVr1, sp; Set pointer to parametersMRSr1, spsr; Get spsrSTMFDsp!, r0; Store spsr onto stackTSTr0, #T_bit; Occurred in Thumb state?LDRNEH r0, lr,#-2; Yes: Load halfword andBICNE r0,r0,#

135、0xFF00; extract comment fieldLDREQr0, lr,#-4; No: Load word andBICEQr0,r0,#0xFF000000; extract comment field ; r0 now contains SWI number ; r1 now contains pointer to stacked registersBLC_SWI_Handler; Call main part of handler.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSimple C SWI Handlervoid C_SWI_Handler(u

136、nsigned swi_num)switch(swi_num)case0:.break;case1:.break;case2:.break;.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMInstall an Exception Handler During Development WorkUnsigned Install_Handler(unsigned routine, unsigned *vector)unsigned vec, old_vec;vec = (routine (unsigned)vector - 8)2;/-8 for prefetching, for

137、 word offsetif (vec & 0xff000000)/check is branch offset is out of limit?printf(“Handler greater than 32MBytes from vector”);vec = 0xea000000 | vec;/ 0xea000000 the opcode of branch inst.old_vec = *vector;*vector = vec;return (old_vec);Usage:unsigned *swi_vec = (unsigned *)0x08;extern void SWI_Handl

138、er(void);Install_Handler(unsigned) SWI_Handler, swi_vec);嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:增加一個練習:增加一個SWI功能功能q利用ADS和AXD Trace exampleSWI 的範例程式q自行增加一個運算功能swi(4) return (regs0+regs1)*10。嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMC Interrupt Handlers_irq void IRQHandler (void)volatile unsigned int *base = (uns

139、igned int *) 0x80000000;if(*base = = 1)c_int_handler();*(base+1) = 0;Note: _irq does not provide reentrant processing嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCompiled _irq; with_irqIRQHandler PROCSTMFDsp!,r0-r4,r12,lrMOVr4,#0x80000000LDRr0,r4,#0SUBsp,sp,#4CMPr0,#1BLEQC_int_handlerMOVr0,#0 STRr0,r4,#4ADDsp,s

140、p,#4LDMFDsp!,r0-r4,r12,lrSUBSpc,lr,#4ENDP; with_irqIRQHandler PROCSTMFD sp!,r4,lrMOVr4,#0x80000000LDRr0,r4,#0CMPr0,#1BLEQC_int_handlerMOVr0,#0STRr0,r4,#4LDMFD sp!,r4,pcENDP嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReentrant Interrupt HandlersqThe steps needed to safely re-enable interrupts in an IRQ handler

141、are:1. Construct return address and save on the IRQ stack.2. Save the work registers and spsr_IRQ.3. Clear the source of the interrupt.4. Switch to System mode and re-enable interrupts.5. Save User mode link register and non callee-saved registers.6. Call the C interrupt handler function.7. When the

142、 C interrupt handler returns, restore User mode registers and disable interrupts.8. Switch to IRQ mode, disabling interrupts.9. Restore work registers and spsr_IRQ.10. Return from the IRQ.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReentrant Example AREA INTERRUPT, CODE, READONLY IMPORT C_irq_handlerIRQ SUBlr,

143、lr,#4; construct the return address STMFDsp!,lr; and push the adjusted lr_IRQ MRSr14,SPSR; copy spsr_IRQ to r14 STMFDsp!, r12,r14; save work regs and spsr_IRQ; Add instruction to clear the interrupt here ; then re-enable interrupts. MSRCPSR_c,#0x1F; switch to SYS mode, FIQ and IRQ enabled.; USR mode

144、 registers are now current. STMFDsp!, r0-r3, lr; save lr_USR and non-callee saved registers BLC_irq_handler; branch to C IRQ handler. LDMFDsp!,r0-r3, lr; restore registers MSRCPSR_c,#0x92; switch to IRQ mode and disable IRQs. FIQ is still enabled. LDMFDsp!, r12,r14; restore work regs and spsr_IRQ MS

145、RSPSR_cf,r14 LDMFDsp!,pc; return from IRQ. END嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM嵌入式系統架構軟體設計 -using ARMModule #4-3: Build ARM ROM Image嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSystem StartupLoad code from address 0x0 to execute SVC mode Interrupts disable ARM stateSystem initialization1. Initialing the execut

146、ion environment, i. e. exception vectors, stacks, memory system, I/O, etc.2. Initializing the C library and application (C variables for example).Exception嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSystem Memory MappingqROM at 0x0SimpleSlow to handle exceptionsqRAM at 0x0ComplexFast to handle exceptions嵌入式系統架

147、構軟體設計嵌入式系統架構軟體設計 -using ARMGeneral Process for Remap1.Power on to fetch the RESET vector at 0x0 (from the aliased copy of ROM).2.Execute the RESET vector:3.LDR PC, =0x0C0000044.This causes a jump to the real address of the next ROM instruction3.Write to the REMAP register and set REMAP = 1.4.Complet

148、e the rest of the initialization code as described in Initializing the system.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMInitialize SystemqReset vector is at 0x0qInitialization process = Reset handler, to Set up exception vectorsInitialize the memory systemInitialize the stack pointer registersInitialize any

149、critical I/O devicesChange processor mode if necessaryChange processor state if necessary嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMSet up Exception VectorsqIf ROM at address 0x0Vectors consist of a sequence of hard-coded instructions to branch to the handlers.qIf ROM at elsewhereDynamically initialize the ve

150、ctors by initialization codes.Typically, copy the vector table from ROM to RAM嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample to Set up Exception VectorsENTRYLDR PC, Reset_AddrLDR PC, Undefined_AddrLDR PC, SWI_AddrLDR PC, Prefetch_AddrLDR PC, Abort_AddrNOP; Reserved vectorLDR PC, IRQ_AddrLDR PC, FIQ_Addr I

151、MPORT Reset_Handler; In init.sIMPORT IRQ_Handler; In init.sReset_AddrDCDReset_HandlerUndefined_AddrDCDUndefined_HandlerSWI_AddrDCDSWI_HandlerPrefetch_AddrDCDPrefetch_HandlerAbort_AddrDCDAbort_HandlerDCD0; Reserved vectorIRQ_AddrDCDIRQ_HandlerFIQ_AddrDCDFIQ_Handler; *; Exception Handlers; *Undefined_

152、Handler B Undefined_HandlerSWI_Handler B SWI_HandlerPrefetch_Handler B Prefetch_Handler Abort_handler B Abort_handler; IRQ_Handler; B IRQ_HandlerFIQ_Handler B FIQ_Handler END嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMInitialize The Stack Pointer RegistersqSp_SVCMust always be initialized.qSp_ IRQInitialize it

153、 if IRQ interrupt used.Initialize before interrupts are enabled.qSp_FIQInitialize it if FIQ interrupt used.Initialize before interrupts are enabled.qSp_ABTInitialize for Data and Prefetch Abort handlingqSp_UNDInitialize for Undefined Instruction handling.Initialize sp_ABT and sp_UND for debugging pu

154、rposes.qSet up the stack pointer sp_USR when changing to User mode to start executing the application.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMChange Processor Mode & StateMode_USREQU0x10Mode_ FIQ EQU0x11Mode_IRQEQU0x12Mode_SVCEQU0x13Mode_ABTEQU0x17Mode_UNDEFEQU0x1BMode_SYSEQU0x1F;MSRCPSR_c, #Mode_IRQ:OR:I_

155、Bit:OR:F_Bitq Mode bitsSpecify the processor mode 1,0000User 1,0001FIQ 1,0010IRQ 1,0011SVC 1,0111Abort 1,1011Undef1,1111System嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample to Initialize The Stack Pointer RegistersMode_IRQEQU0x12I_BitEUU0x80F_BitEQU0x40RAM_LimitEQU0x1000000;For 16MByte SDRAMSVC_StackEQURA

156、M_LimitIRQ_StackEQURAM_Limit-1024.; -Initialize stack pointer registers; Enter IRQ mode and set up the IRQ stack pointerMSR CPSR_c, #Mode_IRQ:OR:I_Bit:OR:F_BitLDR SP, =IRQ_Stack嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMScatter LoadingqEnable us to specify the memory map of an image to armlink.qFor more infor

157、mation Refer to:ARM Developer Suite Version 1.2 Linker and Utilities Guide嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample of Scatter Loading ScriptROM_LOAD 0x0 ROM_EXEC 0x0 vectors.o (Vect, +First) * (+RO)RAM 0x28000000 * (+RW, +ZI)HEAP +0 UNINIT heap.o (+ZI) STACKS 0x28080000 UNINIT stack.o (+ZI)UART0 0x1

158、6000000 UNINIT uart.o (+ZI) All other read only code is placed after vector.oContain RW and ZI data regionsHeap grows from this addressStack grows downward from this address嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample of Scatter Loading Script ROM/RAM RemapFLASH 0x24000000 0x4000000 FLASH 0x24000000 0x4

159、000000 init.o (init, +First) * (+RO)32bitRAM 0x0000 vectors.o (Vect, +First) * (+RW,+ZI)HEAP +0 UNINIT heap.o (+ZI) STACKS 0x40000 UNINIT stack.o (+ZI)UART0 0x16000000 UNINIT uart.o (+ZI)嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMInitialize ApplicationqInitialize nonzero writable data by copying the initializ

160、ing values (RW from ROM to ROM) to the writable data regionqSet all writable data of ZI region to zero.qWhen the compiler compiles a function called main(), it generates a reference to the symbol_main to force the linker to include the basic C run-time system from the ANSI C library.(The symbol _mai

161、n is marked as an entry point.)嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM_user_initial_stackheap()In /Retarget.c_value_in_regs struct_initial_stackheap_user_initial_stackheap(unsigned R0, unsigned SP, unsigned R2, unsigned SL)struct_initial_stackheap config; config.heap_base = 0x00060000;config.stack_base =

162、SP;return config;嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習:Build & Trace a ROM ImageqTry exampleembeddedembedembed.mcpqBuilding an image by ADSqTrace code by AXD嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMCase Study:Build An Image for Wiscore EVMqApplication:7-segment LED testSet up Timer 0: Interrupt to flash LE

163、D 0While loop detect switch & change 7-segment LED number嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Initial Memory MapFigure4-2 Initial System Memory Map (After Reset)嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Register BaseqSYSCFG register determines:Start address of the System Managers specia

164、l registersStart address of internal SRAM.(The total special register space in the system memory map is fixed at 64 K bytes.)15:6 Internal SRAM base pointerThis 10-bit address becomes the upper address of SRAM.A25 through A16, the remaining SRAM address, and A15 through A0, are filled with zeros.25:

165、16 Special register bank base pointerThe resolution of this value is 64K. Therefore, to place the start address at 1800000H (24M), use this formula: Setting value = (1800000H/64K)16.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMNET-Start! EVM Memory MappingFigure 3-1 NET-Start! Memory MapFigure 3-2 Memory Usage嵌

166、入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMNET-Start! 7-segment LED&LEDs嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMGPIO AssignmentsThe GPIO_IN1 is used by the bootstrap loader. Selecting the ON position will force the bootstrap loader to run in the diagnostic mode. Otherwise, the embedded Linux will be booted up after s

167、ystem power on.Figure 2-8 NET-Start! GPIO assignmentNote:嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Registers for I/O PortFigure 12-1. I/O Port Function Diagram嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B IOPMOD嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B IOPCON嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4

168、510B IOPDATAFigure 12-4. I/O Port Data Register (IOPDATA)嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Code to Control LED#define SYS_BASE0x03ff0000#define IOPMOD(volatile unsigned*)(SYS_BASE + 0x5000)#define IOPCON(volatile unsigned*)(SYS_BASE + 0x5004)#define IOPDATA(volatile unsigned*)(SYS_BASE + 0x50

169、08)#define GPIO_LED00x00010000#define GPIO_LED10x00020000void SetLED (int n, int on)int ctr = GPIO_LED0, GPIO_LED1;if (0 = n & n sizeof(ctrl) / sizeof(int)*IOPDATA = on? (*IOPDATA | ctrn) : (*IOPDATA & ctrln);嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Timer嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Sp

170、ecial Register TMOD嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Register TDATATIMER DATA REGISTERSThe timer data registers, TDATA0 and TDATA1, contain a value that specifies the time-out duration for each timer. The formula for calculating the time-out duration is: (Timer data +1) cycles.嵌入式系統架

171、構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Register TCNTTIMER COUNT REGISTERSThe timer count registers, TCN0 and TCNT1, contain the current timer 0 and 1 count value, respectively, during normal operation.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Code to Control Timer#define TMOD*(volatile unsigned*

172、)(SYS_BASE + 0x6000)#define TDATA0*(volatile unsigned*)(SYS_BASE + 0x6004)void Init_Timer()TDATA0 = 0x17D7840/MCLK/25MTMOD = 0x1;/enable timer0 at interval mode嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Interrupt Controller嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Register INTMOD嵌入式系統架構軟體設計嵌入

173、式系統架構軟體設計 -using ARMS3C4510B Special Register INTPNDINTERRUPT PENDING REGISTERThe interrupt pending register. INTPND contains interrupt pending bits for each interrupt source. This register has to be cleared at the top of an interrupt service routine.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special

174、 Register INTMSK嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMS3C4510B Special Register INTOFFSETqINTERRUPT OFFSET REGISTERThe interrupt offset register, INTOFFSET, contains the interrupt offset address of the interrupt, which has the highest priority among the pending interrupts.The content of the interrupt off

175、set address is “bit position value of the interrupt source 2=21=Total interrupt嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMExample Code for Timer0 Interrupt ControlTimer0 IRQINTOFFSET = 0b101000r2 = 0b1010002 = 0b1010 = 10#define INTMOD*(volatile unsigned*)(SYS_BASE + 0x4000)#define INTPND*(volatile unsigned*)

176、(SYS_BASE + 0x4004)#define INTMSK*(volatile unsigned*)(SYS_BASE + 0x4008)#define INTOFFSET*(volatile unsigned*)(SYS_BASE + 0x4024) void interrupt_InitMask()INTMSK = 0x1FFBFF;/ enable Timer0 interruptINTPND = 0x0;lrq handler.sSTMFDsp!, r1-r3LDRr3, =INTOFFSETLDRr2,r3MOVr2,r2,LSR#2MOVr1,#0x1MOVr1,r1,LS

177、L r2LDRr3,=INTPNDSTRr1,r3LDMFDsp!,r1-r3嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMUse Net-Start! BootloaderqCommands:HELP-helpUNIT Set access unitDUMP Memory dumpCOPY- Memory copyFILL Fill memoryPOKE Poke memoryPEEK Peek memoryTX Send XMODEM fileRX Receive XMODEM fileGO Execute binaryINFO Print system informa

178、tionSWITCH Switch modeqLoad image:Select SW2 to OFF positionPress RESET buttonTerminal set: bound rate 19200,8N1RUNrx 0x10000RUNcopy 0x10000 0x20000 0x1810000RUNgo 0x1810000 嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARM練習:練習:Timer 2q根據前面的CASE,增加Timer 2功能, 讓Timer 2 控制另一顆LED.嵌入式系統架構軟體設計嵌入式系統架構軟體設計 -using ARMReferenceqARM Developer Suite Version 1.2 Developer GuideqARM Developer Suite Version 1.2 Linker and Utilities GuideqWiscore Net! Start user GuideqSAMSUNG S3C4510B User Manual结束语结束语谢谢大家聆听!谢谢大家聆听!180

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号