IEE5650: VLSI Testing
Assignment #2 (Due: Mar. 28,2016)
last update: Mar. 11,2016
Reading:
- Source codes provided in homework #0.
-
Please put all results into a report and try to discuss the them.
-
Please compress the folder containing your source codes and reports to a file named by "
HW2_your student ID" and upload it to E3
(http://dcpc.nctu.edu.tw/)
-
The report should include
- The algorithm or idea of your code.
- Several case result
- Discuss your result
- How to compile your code
- Other information(optional)
Homework Problem:
1.(10 pts) Run the program as a logic simulator on circuits C17.bench and C7552.bench.
-
To verify the correctness, please use c17.input as a set of input vectors for
C17.bench and their corresponding correct output responses
from c17.output. Also the c7552.input (inputs)
and c7552.output (outputs) are available for c7552.bench.
2. (90 pts) (Single Pattern Logic Simulator)
-
(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.
-
(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.
Alsoplease generate random patterns with Xs, so that you can test your new program.
Grading:
- Correctness 90%
- Report 10%
Attention:
-
The commands of 2.-a. are as follow:
- ./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.output c17.bench
-
The command of 2.-b. is as follow:
- ./atpg -mod_logicsim -input [input_name] [circuit_name]
Example:
Input: ./atpg -mod_logicsim -input c17.input c17.bench
-
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");