1 / 29

Lecture 17 PicoBlaze Overview

Lecture 17 PicoBlaze Overview. ECE 448 – FPGA and ASIC Design with VHDL. Required reading. P. Chu, FPGA Prototyping by VHDL Examples Chapter 14, PicoBlaze Overview. Recommended reading. PicoBlaze 8-bit Embedded Microcontroller User Guide

taran
Download Presentation

Lecture 17 PicoBlaze Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 17PicoBlaze Overview ECE 448 – FPGA and ASIC Design with VHDL

  2. Required reading • P. Chu, FPGA Prototyping by VHDL Examples • Chapter 14, PicoBlaze Overview Recommended reading PicoBlaze 8-bit Embedded Microcontroller User Guide for Spartan-3, Virtex-II, and Virtex-II Pro FPGAs (search for it using Google or Xilinx website documentation search) ECE 448 – FPGA and ASIC Design with VHDL

  3. Block diagram of a Single-Purpose Processor (FSMD – Finite State Machine with Datapath) ECE 448 – FPGA and ASIC Design with VHDL

  4. Block diagram of a General-Purpose Processor (Microcontroller) ECE 448 – FPGA and ASIC Design with VHDL

  5. PicoBlaze ECE 448 – FPGA and ASIC Design with VHDL

  6. PicoBlaze Overview

  7. Register File of PicoBlaze 8-bit Address s0 s1 s2 s3 s4 s5 s6 s7 0 7 0 1 0 7 2 7 0 3 7 0 4 7 0 5 7 0 16 Registers 7 0 6 7 0 7 sF F 7 0

  8. Definition of Flags Flags are set or reset after ALU operations Zero flag - Z zero condition Z = 1 if result = 0 0 otherwise overflow, underflow, or various conditions Carry flag - C Example* C = 1 if result > 28-1 or result < 0 0 otherwise *Applies only to addition or subtraction related instructions, refer to following slides otherwise

  9. Interface of PicoBlaze ECE 448 – FPGA and ASIC Design with VHDL

  10. Development Flow of a System with PicoBlaze ECE 448 – FPGA and ASIC Design with VHDL

  11. PicoBlaze Programming Model ECE 448 – FPGA and ASIC Design with VHDL

  12. Syntax and Terminology Syntax Example Definition sX KK PORT(KK) PORT((sX)) RAM(KK) Value at register 15 Value 14 Input value from port 2 Input value from port specified by register 10 Value from RAM location 4 s15 14 PORT(2) PORT((s10)) RAM(4)

  13. Addressing modes Immediate mode s2 + 15 + C  s2 s7 – 7  s7 ADDCY s2, 15 SUB s7, 7 Direct mode PORT(28)  s10 s10 + s15  s10 INPUT s10, 28 ADD s10, s15 Indirect mode PORT((s2))  s9 s3 RAM((s10)) INPUT s9, s2 STORE s3, s10

  14. PicoBlaze ALU Instruction Set Summary (1)

  15. PicoBlaze ALU Instruction Set Summary (2)

  16. PicoBlaze ALU Instruction Set Summary (3)

  17. Logic instructions C Z • AND • AND sX, sY • sX and sY => sX • AND sX, KK • sX and KK => sX • 2. OR • OR sX, sY • sX or sY => sX • OR sX, KK • sX or KK => sX • 3. XOR • XOR sX, sY • sX xor sY => sX • XOR sX, KK • sX xor KK => sX 0 IMM, DIR 0 IMM, DIR IMM, DIR 0

  18. Arithmetic Instructions (1) C Z IMM, DIR Addition ADD sX, sY sX + sY => sX ADD sX, KK sX + KK => sX ADDCY sX, sY sX + sY + CARRY => sX ADDCY sX, KK sX + KK + CARRY => sX

  19. Arithmetic Instructions (2) C Z IMM, DIR Subtraction SUB sX, sY sX – sY => sX SUB sX, KK sX – KK => sX SUBCY sX, sY sX – sY – CARRY => sX SUBCY sX, KK sX – KK – CARRY => sX

  20. Test and Compare Instructions C Z TEST TEST sX, sY sX and sY => none TEST sX, KK sX and KK => none COMPARE COMPARE sX, sY sX – sY => none COMPARE sX, KK sX – KK => none IMM, DIR C = parity of the result IMM, DIR

  21. Data Movement Instructions (1) C Z - - LOAD LOAD sX, sY sY => sX LOAD sX, KK KK => sX IMM, DIR

  22. Data Movement Instructions (2) C Z - - DIR, IND STORE STORE sX, KK sX => RAM(KK) STORE sX, (sY) sX => RAM((sY)) - - DIR, IND FETCH FETCH sX, KK RAM(KK) => sX FETCH sX, (sY) RAM((sY)) => sX

  23. Data Movement Instructions (3) C Z - - DIR, IND INPUT INPUT sX, KK sX <= PORT(KK) INPUT sX, (sY) sX <= PORT((sY)) OUTPUT OUTPUT sX, KK PORT(KK) <= sX OUTPUT sX, (sY) PORT((sY)) <= sX - - DIR, IND

  24. Edit instructions - Shifts *All shift instructions affect Zero and Carry flags

  25. Edit instructions - Rotations *All rotate instructions affect Zero and Carry flags

  26. 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

  27. 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

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

  29. Interrupt Related Instructions RETURNI ENABLE PC <= STACK[TOS] ; TOS <= TOS – 1; I <= 1; C<= PRESERVED C; Z<= PRESERVED Z RETURNI DISABLE PC <= STACK[TOS] ; TOS <= TOS – 1; I <= 0; C<= PRESERVED C; Z<= PRESERVED Z ENABLE INTERRUPT I <=1; DISABLE INTERRUPT I <=0;

More Related