ECE 448 – FPGA and ASIC Design with VHDL Lecture 19 PicoBlaze Interrupt Interface & Assembly Code Development.

Slides:



Advertisements
Similar presentations
Lecture 16 PicoBlaze Instruction Set & Assembler Directives
Advertisements

1 ELE271 Mon. April 7, Review LPM -Morse Code Lab -.ref and.def -Multiplication, shift.
ECE 232 L6.Assemb.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 6 MIPS Assembly.
Microprocessors. Microprocessor Buses Address Bus Address Bus One way street over which microprocessor sends an address code to memory or other external.
Computer Organization & Assembly Language
PicoBlaze CPLD Microcontroller
COMP3221: Microprocessors and Embedded Systems--Lecture 8 1 COMP3221: Microprocessors and Embedded Systems Lecture 8: Program Control Instructions
Lecture 5 Sept 14 Goals: Chapter 2 continued MIPS assembly language instruction formats translating c into MIPS - examples.
ECE 448 – FPGA and ASIC Design with VHDL Lecture 13 PicoBlaze I/O & Interrupt Interface.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2:
ECE 447 Fall 2009 Lecture 5: TI MSP430 Software Development in C and Assembly pt. 2.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
Multiplication of signed-operands
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
ECE 448 – FPGA and ASIC Design with VHDL Lecture 12 PicoBlaze Overview.
ECE 448 – FPGA and ASIC Design with VHDL Lecture 12 PicoBlaze Overview.
Richard P. Paul, SPARC Architecture, Assembly Language Programming, and C Chapter 7 – Subroutines These are lecture notes to accompany the book SPARC Architecture,
Introduction to Experiment 7 Sorting Using PicoBlaze ECE 448 Spring 2010.
ECE 448 – FPGA and ASIC Design with VHDL George Mason University Lab 1 Introduction to Aldec Active HDL Implementing Combinational Logic in VHDL.
ECE Lecture 1 1 L8:Flowcharting a program Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
by Richard P. Paul, 2nd edition, 2000.
Lecture Set 4 Programming the 8051.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 8.
ECE 447 Fall 2009 Lecture 7: MSP430 Polling and Interrupts.
CDA 4253 FPGA System Design PicoBlaze Instruction Set Hao Zheng Comp Sci & Eng U of South Florida.
CDA 4253 FPGA System Design The PicoBlaze Microcontroller
ECE 448: Lab 6 Using PicoBlaze Fast Sorting. Part 1: Introduction to Lab 6 Part 2: Instruction Set of PicoBlaze-6 Part 3: Hands-on Session: OpenPICIDE.
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Picoblaze Overview EENG Introduction 8-bit microcontroller for Xilinx devices Soft Core – Soft Processor 5% of the resources of spartan 3 (3S200.
Lecture 13 PicoBlaze I/O & Interrupt Interface Example of Assembly Language Routine ECE 448 – FPGA and ASIC Design with VHDL.
ECE 447 Fall 2009 Lecture 4: TI MSP430 Architecture and Instruction Set.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
Introduction to Experiment 7 Replacing Hardwired Control Unit with the Picoblaze Microcontroller ECE 448 Spring 2009.
ECE 447: Lecture 11 Introduction to Programming in Assembly Language.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
ECE Lecture 1 1 The Hardware Multiplier Department of Electrical and Computer Engineering The Ohio State University ECE 2560.
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
Computer and Information Sciences College / Computer Science Department CS 206 D Computer Organization and Assembly Language.
CDA 4253 FPGA System Design PicoBlaze Interface Hao Zheng Comp Sci & Eng U of South Florida.
CDA 4253 FPGA System Design PicoBlaze Interface Hao Zheng Comp Sci & Eng U of South Florida.
Lecture 18 PicoBlaze Instruction Set & Assembler Directives
Lecture 8: TI MSP430 Interrupts, ISRs
68HC11 Interrupts & Resets.
Integer Multiplication and Division
CSCI206 - Computer Organization & Programming
Lecture 15 PicoBlaze Overview
Presented by: Chi Yan Hung
CS-401 Assembly Language Programming
Advisor: Prof. Gandhi Puvvada
Lecture 14 PicoBlaze Overview
Lecture 16 PicoBlaze I/O & Interrupt Interface
ECE 434 Advanced Digital System L13
ECE 434 Advanced Digital System L12
Lecture 16 PicoBlaze Overview
Introduction to ModelSim Implementing Sequential
Advisor: Prof. Gandhi Puvvada
Lecture 18 PicoBlaze I/O Interface
Lecture 1 Instruction set of 8086 Лектор: Люличева И.А. 1.
ECE 448: Lab 6 Using PicoBlaze Fast Sorting Class Exercise 2.
Lecture 13 PicoBlaze I/O & Interrupt Interface
L13b – 32 bit multiply Department of Electrical and
by Richard P. Paul, 2nd edition, 2000.
Lecture 15 PicoBlaze I/O & Interrupt Interface
ECE 434 Advanced Digital System L11
Lecture 13 PicoBlaze I/O & Interrupt Interface
Lecture 17 PicoBlaze I/O & Interrupt Interface
COMP3221: Microprocessors and Embedded Systems
CNET 315 Microprocessor & Assembly Language
Lecture 14 PicoBlaze Instruction Set
Presentation transcript:

ECE 448 – FPGA and ASIC Design with VHDL Lecture 19 PicoBlaze Interrupt Interface & Assembly Code Development

2 ECE 448 – FPGA and ASIC Design with VHDL Required reading P. Chu, FPGA Prototyping by VHDL Examples Chapter 17, PicoBlaze Interrupt Interface Chapter 15, Assembly Code Development

Program Flow Control Instructions (1) JUMP AAA PC <= AAA JUMP C, AAA if C=1 then PC <= AAA else PC <= PC + 1 JUMP NC, AAA if C=0 then PC <= AAA else PC <= PC + 1 JUMP Z, AAA if Z=1 then PC <= AAA else PC <= PC + 1 JUMP NC, AAA if Z=0 then PC <= AAA else PC <= PC + 1

Program Flow Control Instructions (2) CALL AAA TOS <= TOS+1; STACK[TOS] <= PC; PC <= AAA CALL C | Z, AAA if C | Z =1 then TOS <= TOS+1; STACK[TOS] <= PC; PC <= AAA else PC <= PC + 1 CALL NC | NZ, AAA if C | Z =0 then TOS <= TOS+1; STACK[TOS] <= PC; PC <= AAA else PC <= PC + 1

Program Flow Control Instructions (3) RETURN (RET) PC <= STACK[TOS] + 1; TOS <= TOS - 1 RETURN C | Z (RET C | Z ) if C | Z =1 then PC <= STACK[TOS] + 1; TOS <= TOS - 1 else PC <= PC + 1 RETURN NC | NZ (RET NC | NZ ) if C | Z =0 then PC <= STACK[TOS] + 1; TOS <= TOS - 1 else PC <= PC + 1

Interrupt Related Instructions RETURNI ENABLE (RETI ENABLE) PC <= STACK[TOS] ; TOS <= TOS – 1; I <= 1; C<= PRESERVED C; Z<= PRESERVED Z RETURNI DISABLE (RETI DISABLE) PC <= STACK[TOS] ; TOS <= TOS – 1; I <= 0; C<= PRESERVED C; Z<= PRESERVED Z ENABLE INTERRUPT (EINT) I <=1; DISABLE INTERRUPT (DINT) I <=0;

7 Interrupt Flow ECE 448 – FPGA and ASIC Design with VHDL

8 Timing Diagram of an Interrupt Event ECE 448 – FPGA and ASIC Design with VHDL

9

10 Interrupt Interface with a Single Event ECE 448 – FPGA and ASIC Design with VHDL

11 Interrupt Interface with Two Requests ECE 448 – FPGA and ASIC Design with VHDL

12 Interrupt Interface with a Timer ECE 448 – FPGA and ASIC Design with VHDL

13 Interrupt Interface with a Timer ECE 448 – FPGA and ASIC Design with VHDL

14 PicoBlaze Development Environments ECE 448 – FPGA and ASIC Design with VHDL

15 KCPSM3 Assembler Files ECE 448 – FPGA and ASIC Design with VHDL

16 Directives of Assembly Language ECE 448 – FPGA and ASIC Design with VHDL

17 Differences between Mnemonics of Instructions ECE 448 – FPGA and ASIC Design with VHDL

18 Differences between Mnemonics of Instructions ECE 448 – FPGA and ASIC Design with VHDL

19 Differences between Programs ECE 448 – FPGA and ASIC Design with VHDL

Example of a function in the PicoBlaze assembly language

Unsigned Multiplication – Basic Equations x =  x i  2 i i=0 k-1 p = a  x p = a  x =  a  x i  2 i = = x 0 a2 0 + x 1 a2 1 + x 2 a2 2 + … + x k-1 a2 k-1 i=0 k-1

Iterative Algorithm for Unsigned Multiplication Shift/Add Algorithm p = a  x = x 0 a2 0 + x 1 a2 1 + x 2 a2 2 + … + x k-1 a2 k-1 = (...((0 + x 0 a2 k )/2 + x 1 a2 k )/ x k-1 a2 k )/2 = k times = p (0) = 0 p = p (k) p (j+1) = (p (j) + x j a 2 k ) / 2 j=0..k-1

Unsigned Multiplication Computations pHpH pLpL 8 bits p x j a 8 bits pHpH pLpL pHpH pLpL 0 p (j+1) 2 p (j+1) p (j) + x j a 2 8 >> 1 PicoBlaze Registers p H = s5p L = s6 a = s3 x = s4 +

Unsigned Multiplication Subroutine (1) ;========================================================= ; routine: mult_soft ; function: 8-bit unsigned multiplier using ; shift-and-add algorithm ; input register: ; s3: multiplicand ; s4: multiplier ; output register: ; s5: upper byte of product ; s6: lower byte of product ; temp register: i ;=========================================================

Unsigned Multiplication Subroutine (2) mult_soft: load s5, 00 ;clear s5 load i, 08 ;initialize loop index mult_loop: sr0 s4 ;shift lsb to carry jump nc, shift_prod ;lsb is 0 add s5, s3 ;lsb is 1 shift_prod: sra s5 ;shift upper byte right, ;carry to MSB, LSB to carry sra s6 ;shift lower byte right, ;lsb of s5 to MSB of s6 sub i, 01 ;dec loop index jump nz, mult_loop ;repeat until i=0 return