Вы находитесь на странице: 1из 3

Regular Arrear Examination - December 2013

Course : EEE575 - Scripting Languages and Verification

Time : Three Hours Max.Marks:100

Answer ALL Questions

1. Create a new TCL command called “ldelete” which deletes a particular element in a [10]
list, It takes two arguments a list and a value , it deletes the element specified by the

2. a) Give the value returned by the Following TCL Commands [5]

(i) linsert {1 2} 0 new stuff
set x [list a {b c} e d]
(ii) lreplace $x 1 2 B C
(iii) lrange $x 1 3
(iv) lsearch {here is a list} l*
(v) lindex {a b {c d e} f} 2

b) Write a TCl script to count no. of lines in a text file. [5]

3.(a) Create a new TCL command called ”lincrement” which takes two arguments a list and [10]
a value , list contains N number of integers , all integers should be incremented by the
value given in the argument.The default incremental value should be 1 if the value is
not mentioned in the argument.
For eg:
X= 3 4 5
lincrement {$X 10}
The answer should be 13 14 15


3.(b) Write a perl subroutine to take a numeric value from 1 to 9 as an argument and return [10]
the English name (such as one, two, or nine). If the value is out of range, return the
original number as the name instead.

Page 1 of 3
4. Write a PERL script to collect all the component instantiations from an gate level [10]

5. Write a perl script that reads a list of numbers (on separate lines) until the number 999 [10]
is read, and then prints the total of all the numbers added together. (Be sure not to add
in the 999!) For example, if you enter 1, 2, 3, and 999, the program should reply with
the answer of 6 (1+2+3).

6. Write a short note on the following terms bringing out the difference between the two [10]
with examples:
a) Formal and functional based verification
b) Random and Directed verification
c) Error based test case and performance test case.

7. a) Compute the expression coverage for the following expression in a run that has [5]
encountered these values for a, b and c: (1,1,0), (0,0,1), (1,0,1) and (0,1,0).

b) Consider the following property of an asynchronous handshake between Block1 and [5]
Block2. Property: The ack signal goes high on the assertion of req followed by two
positive edges of the clock signals. Choose the suitable verification topology and test
cases to verify the suitable design.

8.(a) A clock signal (C) is to be gated on and off by another signal (S). The gating network [10]
must be such that only complete clock pulses appear at the output (Z) even though S
may change in the middle of a clock pulse. S will always be on or off for at least two
clock pulses.
Draw the timing diagram for the specification and model the same by using task.


Page 2 of 3
8.(b) Packets dispatched can be of 3 network types: atm, ieee or Ethernet. The packets have [10]
a Boolean flag field which indicates whether the packet is “good” or “bad”. The header
of the packets is 32 bits in length. When the packet is atm, the entire header is
randomly generated, but when it is ieee or Ethernet the lowest 4 bits are always zero.
20% of the time atm packets are generated, while remaining time ieee or Ethernet
packets are generated uniformly. Model the BFM and testcase scenarios using Verilog

9. Declare a two dimensional array mem, using the following statement: [10]
reg [M-1:0] mem [N-1:0];
Use the address to field to either read from or write onto a memory address location,
depending on the value of the ~READ or ~WR signals. Declare data as inout and
address as input.
READ: Select the memory by lowering a CS signal. Latch the address, after 3ns
(enable) lower the READ signal, hold the READ signal low for 5ns (so that the read
data is stable)
WRITE: Select the memory by selecting a CS signal. Signal WE must wait for 3 ns
after the address is stable, after which the WE signal is lowered (enabled). The WE
signal is held low for a time of 5ns after the data is stable.
Draw the timing diagram for read and write protocol. Write verilog tasks (BFMs) for
the read and write operations.

10. What is code coverage in verification? Difference between code coverage and [10]
functional coverage. Explain different types of code coverage and its examples.


Page 3 of 3