Testbench 2 - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Testbench 2

Description:

Set to state 'red', then repeat above. Try different clock rate ... Algorithmic State Machines. Walk though all paths of the algorithm ... – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 11
Provided by: LiCW9
Category:
Tags: machines | of | set | testbench

less

Transcript and Presenter's Notes

Title: Testbench 2


1
Testbench 2
  • Lecture 30

2
Example
  • Traffic light controller
  • Input clock, reset and pedx
  • Output car_light, ped_light
  • State car_light
  • Feature 1 If reset is high, car_light is red
  • Set to state green, then reset
  • Set to state yellow, then reset
  • Set to state red, then reset
  • Repeat for pedx low and high
  • Repeat for a few clock cycles

3
Feature 2
  • If both reset and pedx are low, repeat green 100,
    yellow 10 and red 20
  • Set to state red, then run for 500 cycles
  • Set to state yellow, then repeat above ?
  • Set to state red, then repeat above ?
  • Try different clock rate
  • Try race condition between reset low and clock

4
Feature 3
  • If reset is low and pedx is high
  • If state is green, go to yellow
  • Set to state green, then pedx
  • Set pedx high at various time, duration
  • If state is yellow, normal flow
  • Set to state yellow, then pedx
  • Set pedx high at various time, duration and
    multiple pedx
  • If state is red, stay on red for 20 cycles
  • Set to state red, then pedx
  • Set pedx high at various time, duration and
    multiple pedx

5
Verifying Output
  • Automatic

traffic_light_controller c1 (clock, reset,
pedx, car_light, car_light) always begin
clock0 10 clock1 10 end initial begin
reset 1 pedx 0 1 if (car_light !
RED) display(error) end
6
Exhaustive or Random
  • Exhaust all input combinations
  • Complete
  • Time consuming
  • Suitable for small modules
  • Random input
  • random(seed)

7
Numerical Variables
  • All boundaries
  • if (x gt y)
  • Try xy, xy1 and xy-1
  • Also try max x and min x, max y and min y

8
Explicit FSM
  • Set to each state
  • Using input to reach each state takes too long
  • Use force-release
  • Try each input combination
  • Verify next state and output

9
Algorithmic State Machines
  • Walk though all paths of the algorithm
  • Force each state and provide input
  • Verify next state and output for each edge of the
    ASM
  • Example (up_down_counter)

10
Handshaking
  • Verify each state machine independently
  • Verify each edge of handshaking
Write a Comment
User Comments (0)
About PowerShow.com