CDA 4253 FPGA System Design The PicoBlaze Microcontroller Hao Zheng - - PowerPoint PPT Presentation

cda 4253 fpga system design the picoblaze microcontroller
SMART_READER_LITE
LIVE PREVIEW

CDA 4253 FPGA System Design The PicoBlaze Microcontroller Hao Zheng - - PowerPoint PPT Presentation

CDA 4253 FPGA System Design The PicoBlaze Microcontroller Hao Zheng Comp Sci & Eng U of South Florida Overview of PicoBlaze So:-core microcontroller in VHDL: portable to other plaAorms. Small: occupies ~20 CLBs. Respectable


slide-1
SLIDE 1

CDA 4253 FPGA System Design The PicoBlaze Microcontroller

Hao Zheng Comp Sci & Eng U of South Florida

slide-2
SLIDE 2

2

Overview of PicoBlaze

  • So:-core microcontroller in VHDL: portable to
  • ther plaAorms.
  • Small: occupies ~20 CLBs.
  • Respectable performance: 50 MIPS
  • Predictable performance: every instrucOon

takes 2 cycles.

  • Suitable for simple data processing and control.
slide-3
SLIDE 3

3

Required Reading

  • P. Chu, FPGA Prototyping by VHDL Examples

Chapter 14, PicoBlaze Overview

Recommended Reading

  • PicoBlaxe 8-bit Embedded Microcontroller User

Guide (UG129)

  • K. Chapman, PicoBlaze for Spartan-6, Virtex-6,

and 7-Series (KCPSM6)

slide-4
SLIDE 4

4

Block diagram of a General-Purpose Processor

ctrl

slide-5
SLIDE 5

5

Block diagram of a General-Purpose Processor (Microcontroller)

slide-6
SLIDE 6

PicoBlaze Overview

6

8-bit data width, 18-bit instrucOon width, 10-bit program address

slide-7
SLIDE 7

Size of PicoBlaze-6 in Spartan 6

  • 1. Resource UOlizaOon in CLB Slices
  • 26 CLB Slices
  • 1.1% of Spartan-6 used in Nexys3
  • 2. Number of PicoBlaze-6 cores fi_ng inside of the

Spartan-6 FPGA (XC6SLX16) used in the Nexys3 FPGA board

  • 87 PicoBlaze cores
slide-8
SLIDE 8

Speed of PicoBlaze on Basys-3

  • 1. Maximum Clock Frequency
  • 100 MHz
  • 2. Maximum number of instrucOons per second
  • 50 millions of instrucOons per second (MIPS)

Fixed Oming: ideal for real-Ome control applicaOons, i.e. flight control, manufacturing process control, ...

slide-9
SLIDE 9

Register File of PicoBlaze-3

1 7 7 7

Address

7 7 7 7 7

16 Registers 8-bit

7 F

s0 s1 s2 s3 s4 s5 s6 s7

2 3 4 5 6 7

sF

9

slide-10
SLIDE 10

DefiniNon of Flags

Z = 1 if result = 0 0 otherwise Zero flag - Z

zero condition

Example* C = 1 if result > 28-1 (for addition) or result < 0 (for subtraction) 0 otherwise

*Applies only to addition or subtraction related instructions, refer to the following slides otherwise

Carry flag - C

  • verflow, underflow, or various conditions

Flags are set or reset after ALU operations

10

slide-11
SLIDE 11

11

Interface of PicoBlaze

KCPSM = constant (K) coded programmable state machine

Inputs Outputs

slide-12
SLIDE 12

12

Interface of PicoBlaze

in_port[7:0] – input data port that carries the data for the INPUT instrucOon.

slide-13
SLIDE 13

13

Interface of PicoBlaze

  • ut_port[7:0] – carries the output data for an OUTPUT

instrucOon.

slide-14
SLIDE 14

14

Interface of PicoBlaze

port_id[7:0] – addresses of components connected to

  • PicoBlaze. Holds for two cycles during an INPUT/OUTPUT

instrucOon.

slide-15
SLIDE 15

15

Interface of PicoBlaze

write_strobe – being asserted ‘1’ validates the data on the

  • utput_port[7:0].
slide-16
SLIDE 16

16

Interface of PicoBlaze

read_strobe – being asserted ‘1’ indicates the capture of the data on the input_port[7:0] during an INPUT instrucOon.

slide-17
SLIDE 17

17

Interface of PicoBlaze

reset – needs to be asserted for at least one cycle.

slide-18
SLIDE 18

18

Interface of PicoBlaze

interrupt – assert it for at least two cycles to trigger an interrupt event in PicoBlaze.

slide-19
SLIDE 19

19

Interface of PicoBlaze

interrupt_ack – acknowledges the current interrupt has been recognized by PicoBlaze. Used to clear the current interrupt.

slide-20
SLIDE 20

20

Interface of PicoBlaze – Summary

Name Direction Size Function clk input 1 System clock signal. reset input 1 Reset signal. address

  • utput

10 Address of the instruction memory. Specifies address of the instruction to be retrieved. instruction input 18 Fetched instruction. port_id

  • utput

8 Address of the input or output port. in_port input 8 Input data from I/O peripherals. read_strobe

  • utput

1 Strobe associated with the input

  • peration.
  • ut_port
  • utput

8 Output data to I/O peripherals. write_strobe

  • utput

1 Strobe associated with the output

  • peration.

interrupt input 1 Interrupt request from I/O peripherals. interrupt_ack

  • utput

1 Interrupt acknowledgment to I/O peripherals

slide-21
SLIDE 21

21

Use of PicoBlaze in VHDL Design

component KCPSM3 port ( address : out std_logic_vector( 9 downto 0); instruction : in std_logic_vector(17 downto 0); port_id : out std_logic_vector( 7 downto 0); write_strobe : out std_logic;

  • ut_port : out std_logic_vector( 7 downto 0);

read_strobe : out std_logic; in_port : in std_logic_vector( 7 downto 0); interrupt : in std_logic; interrupt_ack : out std_logic; reset : in std_logic; clk : in std_logic ); end component;

PicoBlaze Component DeclaraOon

slide-22
SLIDE 22

22

Use of PicoBlaze in VHDL Design

PicoBlaze Component InstanOaOon

processor: kcpsm3 port map( address => address_signal, instruction => instruction_signal, port_id => port_id_signal, write_strobe => write_strobe_signal,

  • ut_port => out_port_signal,

read_strobe => read_strobe_signal, in_port => in_port_signal, interrupt => interrupt_signal, interrupt_ack => interrupt_ack_signal, reset => reset_signal, clk => clk_signal );

slide-23
SLIDE 23

23

Use of PicoBlaze in VHDL Design

PicoBlaze Program ROM Component DeclaraOon/ InstanOaOon

component prog_rom port ( address : in std_logic_vector( 9 downto 0); instruction : out std_logic_vector(17 downto 0); clk : in std_logic ); end component; program: prog_rom port map( address => address_signal, instruction => instruction_signal, clk => clk_signal ); KCPSM3 and prog_rom are generated automaOcally by the assembler.

slide-24
SLIDE 24

PicoBlaze Design Flow

– ROM_form.vhd ROM_form.v (Template) KCPSM6 Assembler your_program.psm your_program.vhd your_program.v (Used in design) instruction codes. It then reads an HDL template file called ‘ROM_form.vhd’ (or

slide-25
SLIDE 25

25

Development Flow of a System with PicoBlaze

slide-26
SLIDE 26

26

PicoBlaze Programming Model

slide-27
SLIDE 27

Addressing Modes

Direct mode ADD sa, sf INPUT s5, 2a sa sa + sf PORT_ID 2a s5 IN_PORT Indirect mode STORE s3, (sa) INPUT s9, (s2) RAM[sa] s3 PORT_ID s2 s9 IN_PORT s7 s7 – 07 s2 s2 + 08 + C Immediate mode SUB s7, 07 ADDCY s2, 08

27

← ← ← ← ← ← ← ←

slide-28
SLIDE 28

PicoBlaze InstrucNon Set Summary (1)

28

slide-29
SLIDE 29

PicoBlaze InstrucNon Set Summary (2)

29

slide-30
SLIDE 30

PicoBlaze InstrucNon Set Summary (3)

30