Picoblaze Overview - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Picoblaze Overview

Description:

... sY : represents General Purpose Register Pc : Program Counter Tos : top-of-stack pointer of the call ... load Register and data RAM Fetch and Store ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 14
Provided by: yom54
Category:

less

Transcript and Presenter's Notes

Title: Picoblaze Overview


1
Picoblaze Overview
  • EENG 2910

2
Introduction
  • 8-bit microcontroller for Xilinx devices
  • Soft Core Soft Processor
  • 5 of the resources of spartan 3 (3S200 devicee)
  • Compact, and Flexible
  • Utilized for simple data processing and control

3
Introduction
  • 8-bit data width
  • 8-bit ALU with carry and zero flag
  • 16 8-bit general-purpose registers
  • 64-byte data memory
  • 18 bit instruction width
  • 10-bit instruction address (supports 1024 instr.)
  • 256 input ports and 256 output ports
  • 2 clock cycles per instruction

4
(No Transcript)
5
Instruction Set
  • Logical Instructions
  • Arithmetic Instruction
  • Compare and test Instruction
  • Shift and rotate Instruction
  • Data Movement Instruction
  • Program flow control Instructions
  • Interrupt related Instruction

6
Programming Model (Notation)
  • sX, sY represents General Purpose Register
  • Pc Program Counter
  • Tos top-of-stack pointer of the call/return
    stack
  • c, z, i carry, zero, and interrupt flags
  • Kk 8 bit constant or port id
  • Ss 6-bit constant data memory address
  • AAA 10-bit constant instruction memory address.

7
Instruction Format
  • op sX, sY register-register format (sX, sY
    operand, op operation, sX destination, sX ?
    sX op kk)
  • op sX, kk register-constant format (?)
  • op sX single register format used in
    shifting and rotating instructions with one
    operand.
  • op AAA single-address format. E.g jump and call
    instruction. AAA address.
  • Op - instruction without operand

8
Operations (Examples)
  • Logical Operation (6 instructions) and, or, xor
  • Arithmetic operation (8) add, addcy or addc
    (addcy add with carry flag), sub, subcy or
    subc.
  • Compare and Test operation compare sX, sY or
    comp sX, sY , compare sX, kk or comp sX, kk
  • if sXsY then z?1 else z?0
  • if sXgtsY then c?1 else c?0
  • test sX, SY
  • t ?s X and s Y
  • if t 0 then else z? 0
  • C ? t(7) xor t(6) xor ....xor t(0)

9
Operations
  • Shift and Rotate Instruction
  • sl0 sX Shift a register left 1 bit and shift 0
    into the LSB. sX ? sX(60) 0 c ?sX(7)
  • sl1 sX shift a register left 1 bit and shift 1
    into LSB. sX ? sX(60) sX(0) c ? sX(7)
  • slx sX shift a register left 1 bit and shift
    sX(0) into the LSB.
  • sla sX shift left 1 bit and shift c into LSB
  • similarly, sr0, sr1, srx, sra sX, rl sX, rr sX
    etc.

10
Data Movement
  • Computation done via Registers and ALU
  • Movement between
  • - registers load
  • Register and data RAM Fetch and Store
  • Register and I/O port input and output
  • Load sX, sY load sX, kk - sX ? (sY or kk)
  • fetch sX, (sY) or fetch (sX, sY)- sX ? RAM(sY)
  • Fetch sX, SS, - sX ? RAM(sY)
  • store sX, (sY) (or store sX, sY) RAMsX ? sX -
    move data from register to data RAM.
  • Input sX, (sY), or in sX, sY move data from
    input port to a register. sX ? in_port
  • Output sX, (sY) (out sX, sY) move data from a
    register to the input port

11
Program Flow
  • Jump, call, and return load a value to the
    program counter and modify program flow.
  • Unconditionally or conditionally based on zero
    and carry flags.
  • Jump AAA unconditional jump
  • Jump c, AAA jump if carry flag is set ( if c
    0 then pc ? AAA else pc pc 1)
  • Jump nc, AAA jump z, AAA jump nz, AAA

12
Program flow - Call and Return
  • Implementation of functions
  • Call loads a new value to the pc, saves it
    current value to a stack (special buffer).
  • The routine contains a return( obtains the saved
    value from the stack and increment by 1) at the
    end .
  • Picoblaze support nested function (LIFO) .
    Picoblaze has 31-word stack.

13
Program flow
  • Call AAA (unconditionally call subroutine)
  • tos ? tos
  • Stack tos ? pc
  • Pc ? AAA
  • Call c, AAA (conditionally call subroutine)
  • If (c 1)
  • tos ? tos
  • Stack tos ? pc
  • Pc ? AAA
  • Else
  • Pc ? pc 1
  • Return (ret)
  • Return c, (ret c)
Write a Comment
User Comments (0)
About PowerShow.com