1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 2: Architecture, Assembly, and ABI September 8, 2011 Slides.

Slides:



Advertisements
Similar presentations
1 EECS 373 Design of Microprocessor-Based Systems Branden Ghena University of Michigan Lecture 3: Assembly, Tools, and ABI September 9, 2014 Slides developed.
Advertisements

1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 3: ISA, Assembly, and Toolchains September 13, 2011.
7/23 CSE 325 Embedded Microprocessor System Design Fall 2010 Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang.
General information Course web page: html Office hours:- Prof. Eyal.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Introduction to ARM Architecture, Programmer’s Model and Assembler Embedded Systems Programming.
The Xilinx EDK Toolset: Xilinx Platform Studio (XPS) Building a base system platform.
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
Pyxis Aaron Martin April Lewis Steve Sherk. September 5, 2005 Pyxis16002 General-purpose 16-bit RISC microprocessor bit registers 24-bit address.
Topics covered: ARM Instruction Set Architecture CSE 243: Introduction to Computer Architecture and Hardware/Software Interface.
Microcontrollers Lecture L12.2 Section Microcontrollers Microcontrollers vs. Microprocessors Two standard architectures PIC microcontroller 68HC12.
Slides developed in part by Mark Brehob
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Memory-Mapped I/O, Bus Architectures January 20, 2015.
Embedded Systems Programming
ARM Core Architecture. Common ARM Cortex Core In the case of ARM-based microcontrollers a company named ARM Holdings designs the core and licenses it.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 1: Introduction January 9 th 2014 Slides developed in part.
Programming & Development of Mobile & Embedded Systems Lin Zhong ELEC424, Fall 2010.
Department of Electronic & Electrical Engineering Embedded system Aims: Introduction to: Hardware. Software Ideas for projects ? Robotics/Control/Sensors.
NetBurner MOD 5282 Network Development Kit MCF 5282 Integrated ColdFire 32 bit Microcontoller 2 DB-9 connectors for serial I/O supports: RS-232, RS-485,
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
Computer Architecture ECE 4801 Berk Sunar Erkay Savas.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 2: Architecture, Assembly, and ABI Sept. 5, 2013 Slides developed.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
COMP2011 Assembly Language Programming and Introduction to WRAMP.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 CS503: Operating Systems Spring 2014 Dongyan Xu Department of Computer Science Purdue University.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Instruction Set Architecture Assembly Language Programming Software.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
COMP3221 lec04--prog-model.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 4: Programmer’s Model of Microprocessors
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 2: Architecture, Assembly, and ABI September 9, 2010.
Computer Science 516 Week 3 Lecture Notes. Computer Architecture - Common Points This lecture will cover some common things which characterize computer.
Lecture 4: MIPS Instruction Set Reminders: –Homework #1 posted: due next Wed. –Midterm #1 scheduled Friday September 26 th, 2014 Location: TODD 430 –Midterm.
6.S078 - Computer Architecture: A Constructive Approach Introduction to SMIPS Li-Shiuan Peh Computer Science & Artificial Intelligence Lab. Massachusetts.
Computer Architecture Lecture 03 Fasih ur Rehman.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Memory and Memory-Mapped I/O September 16, 2010.
Implementation of Embedded OS Lab4 Cortex-M3 Programming.
Lecture 7: Overview Microprocessors / microcontrollers.
ChibiOS/RT Demo A free embedded RTOS
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 2: Architecture, Assembly, and ABI September 4, 2014 Slides.
Implementation of Embedded OS Lab3 Porting μC/OS-II.
1 EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 3: Toolchain, ABI, Memory Mapped I/O January 14 th, 2016 Slides.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Review, Simulation, ABI, and Memory-Mapped I/O September.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 TM 1 Embedded Systems Lab./Honam University ARM Microprocessor Programming Model.
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
List three things that distinguish embedded
Computer Organization and Architecture Lecture 1 : Introduction
Displacement (Indexed) Stack
Microcontrollers & GPIO
Slides developed in part by Mark Brehob & Prabal Dutta
The Cortex-M3/m4 Embedded Systems: Cortex-M3/M4 Instruction Sets
CS161 – Design and Architecture of Computer Systems
ACOE301: Computer Architecture II Labs
William Stallings Computer Organization and Architecture 8th Edition
Prof. Onur Mutlu Carnegie Mellon University Spring 2014, 1/14/2013
Slides developed in part by Prof. Dutta
ریز پردازنده. ریز پردازنده مراجع درس میکروکنترلرهای AVR برنامه نویسی اسمبلی و C محمدعلی مزیدی، سپهر نعیمی و سرمد نعیمی مرجع کامل میکروکنترلرهای AVR.
Slides developed in part by Mark Brehob
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Today’s agenda Hardware architecture and runtime system
Introduction to Microprocessor Programming
CS-401 Assembly Language Programming
Slides developed in part by Mark Brehob
Wireless Embedded Systems
Computer Architecture
Program Assembly.
Computer Architecture Assembly Language
Presentation transcript:

1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 2: Architecture, Assembly, and ABI September 8, 2011 Slides developed in part by Mark Brehob

2 Announcements Website up – Lab and office hours posted on-line. –My office hours: Tuesdays 1:30-3:00 pm in 4773 CSE

3 Review What distinguishes embedded systems? –Application-specific –Resource-constrained –Real-time operations –Software runs “forever” Technology scaling is driving “embedded everywhere” –Microprocessors –Memory (RAM and Flash) –Imagers (i.e. camera) and MEMS sensors (e.g. accelerometer) –Energy storage/generation

We are using Actel’s SmartFusion Evaluation Kit 4

A2F200M3F-FGG484ES –200,000 System FPGA gates, 256 KB flash memory, 64 KB SRAM, and additional distributed SRAM in the FPGA fabric and external memory controller –Peripherals include Ethernet, DMAs, I 2 Cs, UARTs, timers, ADCs, DACs and additional analog resources USB connection for programming and debug from Actel's design tools USB to UART connection to UART_0 for HyperTerminal examples 10/100 Ethernet interface with on-chip MAC and external PHY Mixed-signal header for daughter card support 5

FPGA work 6

“Smart Design” configurator 7

Eclipse-based “Actel SoftConsole IDE” 8

Debugger is GDB-based. Includes command line. 9

10 Architecture

11 In the context of computers, what does architecture mean?

12 Architecture has many meanings Computer Organization (or Microarchitecture) –Control and data paths –Pipeline design –Cache design –…–… System Design (or Platform Architecture) –Memory and I/O buses –Memory controllers –Direct memory access –…–… Instruction Set Architecture (ISA)

13 What is an Instruction Set Architecture (ISA)?

Instruction Set Architecture “Instruction set architecture (ISA) is the structure of a computer that a machine language programmer (or a compiler) must understand to write a correct (timing independent) program for that machine” IBM introducing 360 in

15 An ISA defines the hardware/software interface A “contract” between architects and programmers Register set Instruction set –Addressing modes –Word size –Data formats –Operating modes –Condition codes Calling conventions –Really not part of the ISA (usually) –Rather part of the ABI –But the ISA often provides meaningful support.

ARM Architecture roadmap 16

17 ARM Cortex-M3 ISA Register SetAddress Space Branching Data processing Load/Store Exceptions Miscellaneous Instruction Set 32-bits Endianess

18 Mode dependent Registers

19 Address Space

20 Instruction Encoding ADD immediate

21 Branch

22 Data processing instructions Many, Many More!

23 Load/Store instructions

24 Miscellaneous instructions

Addressing Modes Offset Addressing –Offset is added or subtracted from base register –Result used as effective address for memory access –[, ] Pre-indexed Addressing –Offset is applied to base register –Result used as effective address for memory access –Result written back into base register –[, ]! Post-indexed Addressing –The address from the base register is used as the EA –The offset is applied to the base and then written back –[ ],

options An immediate constant –#10 An index register – A shifted index register –, LSL # Lots of weird options…

27 ARMv7-M Architecture Reference Manual ARMv7-M_ARM.pdf

Application Program Status Register (APSR)

Updating the APSR SUB Rx, Ry –Rx = Rx - Ry –APSR unchanged SUBS –Rx = Rx - Ry –APSR N, Z, C, V updated ADD Rx, Ry –Rx = Rx + Ry –APSR unchanged ADDS –Rx = Rx + Ry –APSR N, Z, C, V updated

Overflow and carry in APSR unsigned_sum = UInt(x) + UInt(y) + UInt(carry_in); signed_sum = SInt(x) + SInt(y) + UInt(carry_in); result = unsigned_sum ; // == signed_sum carry_out = if UInt(result) == unsigned_sum then ’0’ else ’1’; overflow = if SInt(result) == signed_sum then ’0’ else ’1’; 30

Conditional execution: Append to many instructions for conditional execution

32 The ARM architecture “books” for this class

33 The ARM software tools “books” for this class

34.equSTACK_TOP, 0x text.syntaxunified.thumb.global_start.typestart, %function _start:.wordSTACK_TOP, start start: movs r0, #10 movs r1, #0 loop: adds r1, r0 subs r0, #1 bne loop deadloop: b deadloop.end An ARM assembly language program for GNU

35 all: arm-none-eabi-as -mcpu=cortex-m3 -mthumb example1.s -o example1.o arm-none-eabi-ld -Ttext 0x0 -o example1.out example1.o arm-none-eabi-objcopy -Obinary example1.out example.bin arm-none-eabi-objdump -S example1.out > example1.list A simple Makefile

36.equSTACK_TOP, 0x text.syntaxunified.thumb.global_start.typestart, %function _start:.wordSTACK_TOP, start start: movs r0, #10 movs r1, #0 loop: adds r1, r0 subs r0, #1 bne loop deadloop: b deadloop.end An ARM assembly language program for GNU

37 example1.out: file format elf32-littlearm Disassembly of section.text: : 0: word0x : word0x : 8:200a movsr0, #10 a:2100 movsr1, # c : c:1809 addsr1, r1, r0 e:3801 subsr0, #1 10:d1fc bne.nc : 12:e7fe b.n12 Disassembled object code

38 Questions? Comments? Discussion?