| Theodora Yeung theodora@cs.washington.edu

|  Test Script for 7-segment display with up and down buttons.

|========================SETUP the Stimulus environment==============

|

|delete any existing waveforms in the window

|

logfile ON

delete_signals

|--------------------------

| Restart to time zero

|

restart

|

|--------------------------

| Setup a 8 bit vector named OUT. This vector include a 8-bit bus named DOUT

|vector OUT DOUT[7:0]

 

|--------------------------

| Watch Outputs

| WATCH is the keyword and net/pin signal appeared after the keyword will be shown in the waveform.

WATCH LED0 LED1 LED2 LED3 LED4 LED5 LED6 UP DN RST CLK EUP EDN

|

 

|--------------------------

| assign input 7 bit vector to display decimal results

| (hex - hexadecimal, bin - binary)

| in the waveform viewer to easily see how many inputs are on.

|

| radix dec OUT

|

 

|--------------------------

| set the clock step size

stepsize 5.0us

clock CLK 0 1

|

|--------------------------

| intialization

|

|--------------------------

| begin driving the input bus

|

 

|assign, check, cycle are keywords

|assign sig x - assign value x to net sig

|                     if x is the value, x\b signals that x is in binary, \d for decimal and \h for hex.

|cycle x - simulate for x cycles

|check sig x - check that net sig has value x.

|                     if value does not match, error message would be displayed in the command file.

 

| Test resetting

assign RST 1     | RESET signal

assign UP 0

assign DN 0

cycle 2

check LED0 1

check LED1 1

check LED2 1

check LED3 1

check LED4 1

check LED5 1

check LED6 0

cycle 5

assign RST 0

cycle 5