IEE5650: VLSI Testing

Assignment #2  (Due: Mar. 13,2017)

last update: Mar. 5,2017


Reading:

Homework Problem:

1.(10 pts) Run the program as a logic simulator on circuits C17.bench and C7552.bench.

2. (90 pts) (Single Pattern Logic Simulator)

  1. (40 pts) Generate 100, 1000, 10000 or more random patterns, and apply the generated patterns to logic simulation of combinational benchmarks. Please compare CPU times and memory usage of different circuits in your report.
    • To measure the memory usage, please check the suggestions.
    • You will need to write a small routine for the random number generator. Please be careful that you can't simply take the last bit out of any random functions such as rand(), because it's not a random bit at all. It is recommended (but not required) to use GSL. Please read the explanation page for generating pseudo-random numbers.
  2. (50 pts) In our current implementation of the logic simulator, we use different tables for AND and OR and NOT operations. Please revise the program such that we use CPU instructions to compute the results directly. Note that we have to consider unknown values (X). To handle unknowns, we have to use at least two bits in a integer. Also please generate random patterns with Xs, so that you can test your new program.

Grading:

Attention:

  1. The commands of 2.-a. are as follows:
    • ./atpg -pattern -num {integer} -output [output_name] [circuit_name] (Generate patterns w/o unknown)
    • ./atpg -pattern -num {integer} -unknown -output [output_name] [circuit_name] (Generate patterns w/ unknown)
    Example:
    Input: ./atpg -pattern -num 100 -output c17.input c17.bench
  2.  

  3. The command of 2.-b. is as follows:
    • ./atpg -mod_logicsim -input [input_name] [circuit_name]
    Example:
    Input: ./atpg -mod_logicsim -input c17.input c17.bench
  4.  

  5. Memory usage example:
    • In command line:
      > /usr/bin/time -f "Average memory usage: %K \nMaximum memory usage: %M\n" ./atpg c17.bench
    • In main.cc, add:
      #include<sys/types.h>
      #include<unistd.h>
      int pid=(int) getpid();
      char buf[1024];
      sprintf(buf, "cat /proc/%d/statm",pid);
      system(buf);
    • In main.cc, add:
      system("ps aux|grep atpg");