Docsity

Regression Testing and MemAccess Block - Lecture Slides | ECE 406, Study notes of Electrical and Electronics Engineering

Toggle sidebar
bg1
Spring 2008W. Rhett Davis NC State University ECE 406 Slide 1
ECE 406
ECE 406 –
–Design of Complex
Design of Complex
Digital Systems
Digital Systems
Lecture 13: Regression Testing,
Lecture 13: Regression Testing,
MemAccess
MemAccess Block
Block
Spring 2008
Spring 2008
W. Rhett Davis
W. Rhett Davis
NC State University
NC State University
with significant material from Paul Franzon, Bill Allen, &
with significant material from Paul Franzon, Bill Allen, & Xun
Xun Liu
Liu
Spring 2008W. Rhett Davis NC State University ECE 406 Slide 2
Announcements
zHW#5 Due Today
zHW#6 Due in 2 Weeks
zProject #1 Due in 3 Weeks
Spring 2008W. Rhett Davis NC State University ECE 406 Slide 3
Today’s Lecture
zRegression Testing
zMemAccess Block Specification
Spring 2008W. Rhett Davis NC State University ECE 406 Slide 4
A Complicated Testing Problem
z… and now you must design the Fetch block.
zYou designed the
Controller in
HW5…
clock
addr[15:0] dout[15:0]
complete
din[15:0]
rd
Memory
z… and a model for
the Memory is given
to you in HW6…
pf3
pf4
pf5
pf8

Partial preview of the text

Download Regression Testing and MemAccess Block - Lecture Slides | ECE 406 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

Spring 2008 ECE 406^

Slide 1

ECE 406 –– Design of ComplexDesign of Complex^ ECE 406Digital SystemsDigital SystemsLecture 13: Regression Testing,Lecture 13: Regression Testing,MemAccess BlockMemAccess

BlockSpring 2008Spring 2008W. Rhett DavisW. Rhett DavisNC State UniversityNC State University

with significant material from Paul Franzon, Bill Allen, &with significant material from Paul Franzon, Bill Allen, & Xun

Xun LiuLiu

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Announcements z HW#5 Due Today z HW#6 Due in 2 Weeks z Project #1 Due in 3 Weeks

Spring 2008 ECE 406^

Slide 3

Today’s Lecture z Regression Testing z MemAccess Block Specification

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

A Complicated Testing Problem z^ … and now you must design the Fetch block.

z^ You designed theController inHW5…Memoryclockcompleterd addr[15:0]^ dout[15:0]din[15:0]

z^ … and a model forthe Memory is givento you in HW6…

Spring 2008 ECE 406^

Slide 5

How to Test the Fetch Block? z What kinds of test-caseswould you choose?

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

How to Test the Fetch Block? z Now suppose that the previous test-benchworks properly, how do you know that theController, Fetch, and Memory blocks will worktogether? »^ Need to design another test-bench that includes allthree (this is the only one you need to turn in) z What kinds of test-cases will this test-benchhave?

Spring 2008 ECE 406^

Slide 7

Combined Test-Bench Setup^ clock

ControllerC_Control[5:0]resetcompletestate[3:0] Fetchstate[3:0]clockrdresetpc[15:0]npc[15:0]br_takentaddr[15:0] global clockglobal reset Memoryclockcompleterdaddr[15:0]^ dout[15:0]din[15:0] global clockglobal reset

globalclock to Writeback& Executefrom MemAccess from Executefrom Execute

from Decode to MemAccess& Decode

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Test-Bench Tips z Include instances of all three blocks in thetest-bench z Give the blocks recognizable instancenames, rather than I0, I1, etc.Controller ctrl(…);Memory mem(…);Fetch fetch(…);

Spring 2008 ECE 406^

Slide 13

Example Test-Case z Recall that the Controller test-benchshowed that it was possible to carry yourstate machines through the proper states bysetting the input signals:•^ 0 Fetch Instruction•^ 10 Decode•^ 20 Execute Operate Instructions•^ 30 Update Register File•^ 40 Update PC•^ 50 Fetch Instruction•^ 60 Decode•^ 70 Compute Target PC•^ 80 Update PC•^ 90 Fetch Instruction•^ …

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Example Test-Case z For the new test-case, we can use thesame state display code z Add $display statements for the contentsof the PC (which which will be the addresslines) and dout from Memory:• always @(dout)• $display($time," dout=%h",dout);• • always @(addr)• $display($time," addr=%h",addr);

Spring 2008 ECE 406^

Slide 15

Example Test-Case z Resulting output is easy to verify by a quickvisual inspection:•^ 0 Fetch Instruction•^ 0 addr=3000•^ 5 dout=54a0•^ 10 Decode•^ 20 Compute Target PC•^ 30 Update PC•^ 35 addr=3001•^ 40 Fetch Instruction•^ 45 dout=14aa•^ 50 Decode•^ …

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Today’s Lecture z Regression Testing z MemAccess Block Specification

Spring 2008 ECE 406^

Slide 17

MemAccess z Receives Address to be read/written from Execute block z Receives Data to be written from Decode block z Master of the shared Memory bus during the“Read Memory”, “Write Memory”, and “Indirect AddressRead” states. z Provides Data read from Memory to Writeback block

Fetch MemAccess^ Memory Controller PC ExecuteWritebackALU DecodeRegFileIRStatePSR

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Detail of Memory BusFetchclockresetstate[3:0]rdpc[15:0]br_takentaddr[15:0]npc[15:0]MemAccessstate[3:0]^ addr[15:0]M_Control^ din[15:0]

Memoryclock rdaddr[15:0]din[15:0]dout[15:0]complete global clockglobal reset

globalclock from Controllerfrom Executefrom Executeto Writeback& Executefrom Controllerfrom DecoderdM_Data[15:0]M_Addr[15:0]dout[15:0]memout[15:0]

totoDecodeController from Decodefrom Executeto Writeback Spring 2008 ECE 406^

Slide 19

MemAccess Signals z What is meant by the M_Data signal? Why does itcome from the Decode block? z What is meant by the M_Addr signal? Why does itcome from the Execute block? z What is meant by the memout signal?

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

MemAccess States UpdateFetchDecodePCInstruction^ ComputeMemoryAddress

complete==0 InstructionInstructionInstructionType==1Type==2Type==0ExecuteALUComputeTarget PCOperations complete==0IndirectAddressReadReadMemory UpdateWriteRegisterMemoryFilecomplete== Store PC==0 Store PC==1Memory AccessMode==3InvalidState complete==1 Memory AccessMemory AccessMode==0Mode==1Load==1complete==0Memory AccessMode==2complete==1Load==0 complete==

Spring 2008 ECE 406^

Slide 25

Example: STI z Location of Indirect Address:^

16’h300A

z^ Indirect Address:^

16’h

z^ Value to be Stored at Indirect Address:

16’h1234 Note that dout is the same as addr

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Read Indirect Address State z During this state, what will

dout^ be set to?

z^ What needs to happen to this value on the nextcycle? z^ How can we ensure that this happens?

Spring 2008 ECE 406^

Slide 27

Read/Write Memory States Revisited^ z^ Read StateMemory Bus Signals:^ »^ rd^ »^ addr^ »^ din

z^ Write StateMemory Bus Signals:^ »^ rd^ »^ addr^ »^ din

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Verilog Code for MemAccess z Read Memory State:^ »^ if(M_Control==0)addr<=M_Addr;elseaddr<=dout;^ »^ din<=16'h0; // don’t care^ »^ rd<=1'b1; z Read Indirect Address State:^ »^ addr<=M_Addr;^ »^ din<=16'h0; // don’t care^ »^ rd<=1'b1;

z^ Write Memory State:^ »^ if(M_Control==0)addr<=M_Addr;elseaddr<=dout;^ »^ din<=M_Data;^ »^ rd<=1'b0; z^ All Other States:^ »^ addr<=16'hz;^ »^ din<=16'h0; // don’t care^ »^ rd<=1'bz; Remember that this is combinational logic!

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Slide 29

Complete the TableM_ControlmodeOperation^0 ADD^10 AND^1 NOT^ BRJMP/RETJSRJSRRLDLDRLDILEASTSTRSTI

Spring 2008 W. Rhett Davis^ NC State University

ECE 406^

Slide 30

What about^ memout

z^ memout^ needs to present the value readfrom memory to the

Writeback^ block.

z^ There’s really no reason why it can’t justbe connected to

dout^ permanently (withan assign statement).

z^ assign memout = dout;