Slides developed in part by Mark Brehob

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.
Embedded Systems Programming
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.
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.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 2: Architecture, Assembly, and ABI September 8, 2011 Slides.
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 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.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Instruction Set Architecture Assembly Language Programming Software.
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.
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 4: Memory and Memory-Mapped I/O September 16, 2010.
F28HS2 Hardware-Software Interfaces Lecture 7: ARM Assembly Language 1.
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.
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.
The Universal Machine (UM) Implementing the UM Noah Mendelsohn Tufts University Web:
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 TM 1 Embedded Systems Lab./Honam University ARM Microprocessor Programming Model.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
List three things that distinguish embedded
Computer Organization and Architecture Lecture 1 : Introduction
Popular Microcontrollers and their Selection by Lachit Dutta
ARM Intro.
Programming and Debugging with the Dragon and JTAG
Lab 1: Using NIOS II processor for code execution on FPGA
Assembly language.
Hands On SoC FPGA Design
Microcontrollers & GPIO
Control Unit Lecture 6.
Computer System Laboratory
Slides developed in part by Mark Brehob & Prabal Dutta
Implementation of Embedded OS
ECE 3430 – Intro to Microcomputer Systems
The Cortex-M3/m4 Embedded Systems: Cortex-M3/M4 Instruction Sets
EE 319K Introduction to Embedded Systems
ACOE301: Computer Architecture II Labs
Chapter 4 Addressing modes
William Stallings Computer Organization and Architecture 8th Edition
CSCI/CMPE 3334 Systems Programming
Prof. Onur Mutlu Carnegie Mellon University Spring 2014, 1/14/2013
Slides developed in part by Prof. Dutta
Programmable Logic- How do they do that?
ریز پردازنده. ریز پردازنده مراجع درس میکروکنترلرهای 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
Unit 12 CPU Design & Programming
MARIE: An Introduction to a Simple Computer
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
ARM Introduction.
Wireless Embedded Systems
Computer System Laboratory
CS 152 Computer Architecture and Engineering CS252 Graduate Computer Architecture Lecture 16 – RISC-V Vectors Krste Asanovic Electrical Engineering and.
EE108b Review Session February 2nd, 2007 Daxia Ge.
Computer Architecture
Program Assembly.
Introduction to Assembly Chapter 2
Computer Architecture Assembly Language
Presentation transcript:

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

Lab and office hours posted on-line. Announcements Website up http://www.eecs.umich.edu/~prabal/teaching/eecs373/ Lab and office hours posted on-line. My office hours: Tuesdays 1:30-3:00 pm in 4773 BBB Projects Start thinking about them now!

Review What distinguishes embedded systems? Application-specific Resource-constrained Real-time operations Physically-embodied 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

USB connection for programming and debug from Actel's design tools 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, I2Cs, 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

FPGA work

“Smart Design” configurator

Eclipse-based “Actel SoftConsole IDE”

Debugger is GDB-based. Includes command line.

Exercise: We study FPGAs and MPU-32. Why?

Architecture

In the context of computers, what does architecture mean?

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)

Instruction Set Architecture (ISA)? 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 1964

Major elements of an Instruction Set Architecture (registers, memory, word size, endianess, conditions, instructions, addressing modes) 32-bits 32-bits mov r0, #1 ld r1, [r0,#5] mem((r0)+5) bne loop subs r2, #1 Endianess Endianess

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

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

Registers Mode dependent

Address Space

Instruction Encoding ADD immediate

Branch

Data processing instructions Many, Many More!

Load/Store instructions

Miscellaneous instructions

Pre-indexed Addressing Addressing Modes Offset Addressing Offset is added or subtracted from base register Result used as effective address for memory access [<Rn>, <offset>] Pre-indexed Addressing Offset is applied to base register Result written back into base register [<Rn>, <offset>]! 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 [<Rn>], <offset> Condition codes are simply a way of testing the ALU status flags.

<offset> options An immediate constant #10 An index register <Rm> A shifted index register <Rm>, LSL #<shift> Lots of weird options… Condition codes are simply a way of testing the ALU status flags.

ARMv7-M Architecture Reference Manual ARMv7-M_ARM.pdf

Application Program Status Register (APSR) Condition codes are simply a way of testing the ALU status flags.

Updating the APSR SUB Rx, Ry SUBS ADD Rx, Ry ADDS Rx = Rx - Ry APSR unchanged SUBS APSR N, Z, C, V updated ADD Rx, Ry Rx = Rx + Ry ADDS Condition codes are simply a way of testing the ALU status flags.

Conditional execution: Append to many instructions for conditional execution Condition codes are simply a way of testing the ALU status flags.

The ARM architecture “books” for this class

The ARM software tools “books” for this class

Exercise: What is the value of r2 at done? ... start: movs r0, #1 movs r1, #1 movs r2, #1 sub r0, r1 bne done movs r2, #2 done: b done

Solution: what is the value of r2 at done? ... start: movs r0, #1 // r0  1, Z=0 movs r1, #1 // r1  1, Z=0 movs r2, #1 // r2  1, Z=0 sub r0, r1 // r0  r0-r1 // but Z flag untouched // since sub vs subs bne done // NE true when Z==0 // So, take the branch movs r2, #2 // not executed done: b done // r2 is still 1

An ARM assembly language program for GNU .equ STACK_TOP, 0x20000800 .text .syntax unified .thumb .global _start .type start, %function _start: .word STACK_TOP, start start: movs r0, #10 movs r1, #0 loop: adds r1, r0 subs r0, #1 bne loop deadloop: b deadloop .end

A simple Makefile 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

An ARM assembly language program for GNU .equ STACK_TOP, 0x20000800 .text .syntax unified .thumb .global _start .type start, %function _start: .word STACK_TOP, start start: movs r0, #10 movs r1, #0 loop: adds r1, r0 subs r0, #1 bne loop deadloop: b deadloop .end

Disassembled object code example1.out: file format elf32-littlearm Disassembly of section .text: 00000000 <_start>: 0: 20000800 .word 0x20000800 4: 00000009 .word 0x00000009 00000008 <start>: 8: 200a movs r0, #10 a: 2100 movs r1, #0 0000000c <loop>: c: 1809 adds r1, r1, r0 e: 3801 subs r0, #1 10: d1fc bne.n c <loop> 00000012 <deadloop>: 12: e7fe b.n 12 <deadloop>

Questions? Comments? Discussion?