7 static void print_condition(FILE *fp,
char * name,
TIME chtime,
int index,
int lvalue,
int printstep,
int stepnr)
9 char sign = lvalue?
'<':
'>';
11 fprintf(fp,
"if chFAIL = 0\n");
13 fprintf(fp,
"\tstep %d\n", stepnr);
14 fprintf(fp,
"\tif (%s[%d]) %c vthreshold%d\n", name, index, sign, lvalue);
15 fprintf(fp,
"\t\tchFAIL = 1\n");
16 fprintf(fp,
"\t\techo FAILED FOR TIME = %.1f ps\n", chtime*1.0e12);
17 fprintf(fp,
"\tend\n");
18 fprintf(fp,
"end\n\n");
35 if(check_time < ne->exact_time)
50 EDGE **prev_edge, *clk_edge;
51 TIME check_time, check_norm_time, clk_pulse_bgn, clk_pulse_end, total_time;
63 if(prev_edge == NULL) {
66 for(sig_num=0; sig_num<sp->
outs_num; sig_num++) {
79 clk_edge=clk_edge->
next;
83 clk_pulse_end = total_time;
93 check_time = clk_pulse_bgn +
109 last_index = check_index;
112 clk_edge=clk_edge->
next;
117 #define STEP_PARTS 10 138 npf->
index = curr_index;
139 npf->
time = check_time;
140 npf->
value = curr_value;
152 if(curr_index < cpf->
index) {
160 if(curr_index < cpf->index)
176 int stepnum, indexlimit, edgenum;
189 while(cpf->
index < indexlimit) {
210 TIME total_time, last_edge, next_edge, curr_time, check_time;
217 TIME min_interval_to_edge;
238 last_edge_dir = 1 - last_edge_dir;
239 next_edge = total_time;
250 curr_time = (next_edge + last_edge)/2;
258 while(curr_time < next_edge - min_interval_to_edge) {
266 curr_value = 1 - curr_value;
267 last_edge = next_edge;
288 fp=fopen(filename,
"w");
292 fprintf(fp,
"%s\n", filename);
293 fprintf(fp,
".control\n\n");
299 fprintf(fp,
"run\n\n");
306 fprintf(fp,
"if chFAIL = 1\n");
307 fprintf(fp,
"\tfree all yes\n");
308 fprintf(fp,
"\tchFAIL = 1\n");
309 fprintf(fp,
"end\n\n");
311 fprintf(fp,
"if chFAIL = 0\n");
312 fprintf(fp,
"\tfree all yes\n");
313 fprintf(fp,
"\tchFAIL = 0\n");
314 fprintf(fp,
"end\n\n");
static void print_condition(FILE *fp, char *name, TIME chtime, int index, int lvalue, int printstep, int stepnr)
static int generate_async_latch_passfail(FILE *fp, SIGNALS *sp, int runall)
static int collect_passfail_condition(PF_CONDITION **bpf, int sig_num, TIME check_time, int curr_index, int curr_value)
int generate_latch_passfail_file(SIGNALS *sp, char *filename, int runall)
struct passfail_condition * next
TIME min_interval_to_falledge
TIME min_interval_to_riseedge
static int latch_signal_value(TIME check_time, EDGE **prev_edge, int init_value)
static void print_passfail_conditions(FILE *fp, SIGNALS *sp, PF_CONDITION *bpf, int runall)
static int generate_sync_latch_passfail(FILE *fp, SIGNALS *sp, int runall)
char(* jspice_voltage_names)[NAME_LENGTH]
static char filename[LINE_LENGTH]