Docsity

Design Assignment - Binary Up and Down Counter - Lecture Notes | CSCE 491, Assignments of Computer Science

Toggle sidebar
bg1
2004/8/25
Lecture 4
Design Assignment – Binary Up/Down Counter
© 2003 Dr. James P. Davis
CSCE 491
CSCE 491
Computer
Computer Engr
Engr. Design Project
. Design Project
Page 2
© 2002 Dr. James P. Davis
Lecture 4 Assignment
Lecture 4 Assignment -
-Outline
Outline
zObjective: To start an example to give you more insight on:
zHow to start a design model from an analysis model
zHow to think about digital systems modeling using ASM charts.
zTo explore the connection between the analysis and design activities
of Computer Engineering discipline.
zMeans:
9The Binary Up/Down Counter example.
zResult:
zYou should be able to create this design in Nimbus for HW #4.
Analysis
Architecture
& Design
Problem
Domain
Analysis
Model
(UM L )
Design
Model
(ASM)
pf3
pf4
pf5

Partial preview of the text

Download Design Assignment - Binary Up and Down Counter - Lecture Notes | CSCE 491 and more Assignments Computer Science in PDF only on Docsity!

Lecture 4

Design Assignment – Binary Up/Down Counter

© 2003 Dr. James P. Davis

CSCE 491CSCE 491

Computer EngrComputerEngr. Design Project. Design Project

Lecture 4 Assignment - Lecture 4 Assignment- OutlineOutline

z Objective: To start an example to give you more insight on: z How to start a design model from an analysis model

z z How to think about digital systems modeling using ASM charts.To explore the connection between the analysis and design activities

of Computer Engineering discipline.

z Means: 9 The Binary Up/Down Counter example.

z Result:

z You should be able to create this design in Nimbus for HW #4.

A n a ly s is

A rc h ite c tu re& D e s ig n

P ro b le mD o m a in

A n a ly s isM o d e l (U M L )

D e s ig nM o d e l (A S M )

© 2002 Dr. James P. Davis Page 3

The Binary Up/Down Counter – The Binary Up/Down Counter– Register LevelRegister Level z The Binary Up/Down Counter 9 This multi-mode counter block takes an input “seed”value, and counts up or down from this value,based on the direction of count. 9 Each count cycle theEnable pulse is set, the Direction bit can be set tocount in one or the other direction, and the Seed andNoCounts values are set. 9 The counter will run for thenumber of cycles indicated by input NoCounts.

NoCounts 8 Seed 8 Direction 1 Enable 1

8 CountValue 1 Valid

Up/Down Counter Model – Up/Down Counter Model– Use Case DiagramUse Case Diagram z Use cases and actors: 9 We have two different Use Case models, one that ismore abstract than the 9 other.The more abstract one is created from the 1analysis of the Counter, the st^ pass (^2) more detailed look. nd^ one is created from a

Set_NoCounts Set_Seed Set_Direction Set_Enable Reset Count_Up

Count_Down

U-D_Counter

Output_CountValue Set_ValidFlag

" User"

Specify_Count_Up " Us er" Specify_Count_Down 2 nd^ Pass Analysis Model. 1 st^ Pass Analysis Reset Model.

© 2002 Dr. James P. Davis Page 7

Systems Design Method – Systems Design Method– Test ProcessTest Process z Approach to Verification 9 Create a set of stimuli that can be used to verify observed behavior against expected 9 behavior.We’ll use different levels of design and test specification, to take advantage of fast turnaround in gaining functional and cycle-level timing verification, then obtaining gate-leveltiming and load analysis, post-layout. The same test harness will be used at both levels.

s t i m u l u s^ S im u la t o r r e s p o n s e l o a d e d H D L m o d e l

o b s e r v e d

s y s t e m s p e c r e s p o n s e^ e x p e c t e d O = E?? W _ R e c v N o Y e s^ " r e a dy to s e n d " f r om^ r em o te?

C le a r f la g s o n R e s e t. D r o p " c le ar to s e n d " to rem o te. R e c v D a ta N o Y e s^ R e c e ive c o u n t re ac h e d?

I n c rem e n t R E C V S h if t in c u r re n t s e r ia l b it. S e t " c le ar to s e n d " to r em o te. L o a d R e g (^) s ta tu s b its .L o a d ne w R e c v D a ta C h e c k a n d c lea r s er ia l^ re g .d a ta^ in to

b it c o u n te r.

R e c e ive r

D i n^ R E S A D D R b '1 1 1 1 0 0 0 0b ' 1 h ' 0 4 R D b ' 0

D b u s o u t = h ' F 0 D bu s o u t = h ' F 0

Creating a Test PlanCreating a Test Plan –– Use Case DiagramUse Case Diagram z Use cases and actors: 9 Use Cases have been used in the analysis part of ourprocess. 9 We now want to employthem in helping us to identify and articulatespecific test scenarios, and localize test “points” in thedesign model. 9 In the analysis model, weidentified the “user” as an entity external to theCounter; we’ll create a test model that provides some ofits functionality for purposes of feeding test data to ourdesign model. 9 The Use Case model givesus the set of actions and interactions we’ll need to beconcerned with.

Set_NoCounts Set_Seed Set_Direction Set_Enable Reset Count_Up

Count_Down

U-D_Counter

Output_CountValue Set_ValidFlag

We’ll set up a test model to “stimulate” thedesign model through these inputs." User"

We’ll set up a test model to “assess” thedesign model’s behavior through these outputs.

© 2002 Dr. James P. Davis Page 9

Creating a Test Plan – Creating a Test Plan– Class DiagramClass Diagram

CountUp CountDown

Enable CountDirection

Valid(Done)

CountOutput

No_CounterLoops SeedValue

CountingRun

HasStartingCounterValue 1

HasSetNumberOfTimesToCount 1

GeneratesRunOutput 1

(^1) HasStartingSignal HasDoneIndicator 1 HasDirectionOfCount 1

z Classes: 9 We start our process of examining the specific“interface points” to our design model by lookingat the data definitions at the boundaries of thedesign. 9 The Class diagram for thedesign model allows us to identify specific boundaryvalues and conditions for evaluating whether thedesign operates correctly under “benign” and “error”conditions. 9 Characteristics such as:(1) order of inputs, (2) input values, (3) changingvalues once set, and (4) Any invalid seed value range?What about “negative” or “zero”? value dependencies areplaces to look.

Any invalid loop value range?What about “negative” or “zero”?

What is we change the directionafter it has already been set? What about after it has beenlatched?

What if we toggle the enable signal?What if we don’t hold it long enough?

© 2002 Dr. James P. Davis^ Page 10

Test Planning Worksheet Test Planning Worksheet

1 2 3 4

Give each test case ameaningful name, so someone reading yourtest plan gets an idea of what you’re testing.

We may need to setup a test to occur at some cycle offset intothe execution of the design. We indicatethis information here. Each test caseinvolves setting up some of the Inputbuses to specified values. Do this here. Each test case involves some expected result.You specify this in terms of the values on buses, and at what point in the simulation you expect it to happen.

Once you runa simulation, what did youobserve? Did it work asexpected? If not, why?