Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

33
Topics of Lecture Topics of Lecture •Configuration •Test Bench •Encapsulation •Structural Decomposition
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    216
  • download

    0

Transcript of Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Page 1: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Topics of LectureTopics of Lecture•Configuration

•Test Bench

•Encapsulation

•Structural Decomposition

Page 2: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

TestBenchTestBench

Page 3: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Testbench ExampleTestbench Example• Configuration

• Clock

• Test Bench

• Behavioral to Structural

• After J. Pick, VHDL Techniques, Experiments, and Caveats,McGraw-Hill, 1996.

Page 4: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Counter Test Bench EntityCounter Test Bench Entity

entity Counter_Wrapper_TB is

end Counter_Wrapper_TB ;

No port clause since encapsulating counter to test it.

Page 5: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

First Counter ArchitectureFirst Counter Architecture

architecture Count_1 of Counter_Wrapper_TB is

signal Clock : bit := ‘0’ ;

begin

Page 6: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Local ClockLocal Clock

Clock_P_1 : process

begin

Clock <= not Clock after 50 ns;

wait on Clock ;

end process Clock_P_1 ;

Page 7: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Counter ProcessCounter Process

Inc_Cntr: process

variable Count_Now : integer := 0 ;

begin

--wait for trailing edge

wait until Clock = ‘0’ ;

Page 8: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Increment CounterIncrement Counter

--increment mod 8

if Count_Now = 7 then

Count_now := 0 ;

else

Count_now := Count_Now + 1 ;

end if ;

end process Inc_Cntr ;

end Count_1 ;

Page 9: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

2nd Counter Architecture2nd Counter Architecture

architecture Count_2 of Counter_Wrapper_TB is

signal Clock : bit := ‘0’ ;

begin

-- no change

Page 10: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Local Clock with Static Local Clock with Static Sensitivity ListSensitivity List

Clock_P_2 : process ( Clock )

begin

Clock <= not Clock after 50 ns;

-- removed ... wait on Clock ;

end process Clock_P_2 ;

Page 11: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Counter ProcessCounter ProcessInc_Cntr: process

variable Count_Now : integer := 0 ;

begin

--wait for trailing edge

wait until Clock = ‘0’ ;

-- no change

Page 12: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Increment CounterIncrement Counter--increment mod 8

if Count_Now = 7 then Count_now := 0 ;

else

Count_now := Count_Now + 1 ;

end if ;

-- no change

end process Inc_Cntr ;

end Count_2 ;

-- no change

Page 13: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

3rd Counter3rd Counter• Same As Others Except for Clock Generator

• Concurrent Clock Instead of Process

• Wrapper Slides Not Repeated Here

Page 14: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Concurrent Local ClockConcurrent Local Clock

Clock_P_3 :

-- removed process ( Clock )

-- removed begin

Clock <= not Clock after 50 ns;

-- removed ... wait on Clock ;

-- removed end process Clock_P_2;

Page 15: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Specific Configuration of CounterSpecific Configuration of Counter

configuration Conf_KJH_1 of

Counter_Wrapper_TB is

--no ambiguity here

--only one entity per library

for Count_1

--ambiguity so need to

--specify architecture

Page 16: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

End ConfigurationEnd Configurationend for ;

end Conf_KJH_1 ;

--architecture is now bound

--to entity

Page 17: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

EncapsulationEncapsulation

Counter_Wrapper_TB

Conf_KJH_1

Count_1

Page 18: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

2nd Specific Configuration 2nd Specific Configuration of Counterof Counter

configuration Conf_KJH_2 of

Counter_Wrapper_TB is

--no ambiguity here

--only one entity per library

for Count_2

--ambiguity so need to

--specify architecture

Page 19: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

End ConfigurationEnd Configurationend for ;

end Conf_KJH_2 ;

--different architecture is

--now bound to same entity

--mutually exclusive bindings

Page 20: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

EncapsulationEncapsulation

Counter_Wrapper_TB

Conf_KJH_2

Count_2

Page 21: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

EncapsulationEncapsulationConf_KJH_?Counter_Wrapper_TB

Count_?

Count_1

Count_2

Count_3Architectures

Page 22: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Structural Decomposition of Structural Decomposition of Counter_Wrapper_TBCounter_Wrapper_TB

Counter_Wrapper_TB

Count_3Counter

Counter_Wrapper_TB

Clock

Verify

Page 23: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

SD Counter Clock ComponentSD Counter Clock Component

architecture Count_SD of Counter_Wrapper_TB is

component Clock

generic (PW : time ) ;

port ( Clock : out bit );

end component Clock ;

Page 24: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

SD Counter ComponentSD Counter Component

component Counter_Mod_8

port (

Clock : in bit ;

DataOut : out bit_vector (2 downto 0 ) );

end component Counter_Mod_8 ;

Page 25: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

SD Verify ComponentSD Verify Component

component Verify

port (

DataIn : in bit_vector (2 downto 0 ) );

end component Verify ;

Page 26: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

SD SignalsSD Signalssignal Clock_Tic : bit := ‘0’ ;

signal Count_Data : bit_vector

(2 downto 0 ) := ( others => ‘0’ );

--initializes all values to ‘0’

Page 27: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Clock InstantiationClock Instantiation

begin

Synch : Clock

generic map ( PW => 50 ns )

--no ; required cause port next

port map ( Clock_Tic ) ;

Page 28: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Counter InstantiationCounter Instantiation

Counter_Instance : Counter_Mod_8

port map ( Clock_Tic , Count_Data ) ;

Page 29: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Verify InstantiationVerify InstantiationVerify_Instance : Verify

port map ( DataIn => Count_Data ) ;

end Count_SD ;

Page 30: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

Block Diagram of SDBlock Diagram of SD

Clock out

Clock in

DataOut (2)

DataOut (1)

DataOut (0)

Count_SD

Counter_Mod_8DataIn (2)

DataIn (1)

DataIn (0)

Verify

Page 31: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

ApproachApproach• Turn Counter_Mod_8 into an entity and put in a

library after it has been verified• Count_SD is a good start to a testbench where the

counter drives a signal generator which creates the sequential signals to excite the device under test

• Verify is a component which needs to be expanded with assert/report statements to verify performance

Page 32: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

End of LectureEnd of Lecture• Configuration

• Test Bench

• Structural Decomposition

Page 33: Topics of Lecture Configuration Test Bench Encapsulation Structural Decomposition.

SourcesSourcesProf. K. J. Hintz

Department of Electrical

and

Computer Engineering

George Mason University