EEIE30069 HW3

EEIE30069: VLSI Testing

Assignment #3  (Due: Oct. 30, 2023 23:59:99)

Last update: Oct. 16, 2023


Reading:

Homework Description:

  1. (150 pts) (Parallel pattern logic simulator)
    1. (20 pts) Please pack different number of patterns (1, 4, 8, 16) into a simulation run. Compare CPU times and memory usage on different circuits.
    2. (30 pts) Please calculate the average number of gate evaluations for different number of packed patterns. We can collect the number of gate evaluations of each pattern and then average the number of all patterns. DOES this number has correlation with the CPU times? What is the percentage of average gate evaluations over the total number of gates?
    3. (100 pts) Please write a compiled code simulator based on a fixed number (16) of parallel patterns. You can implement the "simulator" as a method of CIRCUIT class. In the method, you will output gate evaluation code in a levelized way (like ParallelLogicSim() in psim.cc), but all gates will be scheduled. Save the output code in a .c or .cc file and compile it as a program. Please compare the CPU time and memory usage with corresponding event-driven simulators.
      When comparing CPU times, please do not perform any IO functions (e.g. cout), which dramatically slows down the program.
      • The parallel logic simulation result by your simulator about c7552 circuit should be named c7552.out. The PI & PO sequence must follow the sequence in podem (PIlist & POlist).
      In this assignment, TA will only use combinational circuits to evaluate your program.

Grading:

Attention:

  1. A new option "-simulator" you should create is as follows :

    ./atpg -simulator [output_name] -input [input_pattern_file] [circuit_name]

    Input:

    ./atpg -simulator c17.cc -input c17.input c17.bench

    Example files:

  2. Memory usage examples:
    1. In command line:

      /usr/bin/time -f "Average memory usage: %K \nMaximum memory usage: %M\n" ./atpg c17.bench

    2. 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);

    3. In main.cc, add:

      system("ps aux|grep atpg");