la.c
1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**************************************************************************
* *
* Copyright (C) 1993, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/*
* la.c $Revision: 1.1.1.1 $
*
* 8/1/94 RJM Simplified logic analyzer, just do simple dumps
* 8/7/94 RJM Make to work with new pointer passing
*/
#include "la.h"
void
la(la_t **pp0, la_t **pp1)
{
int i;
char str[256];
la_t *p0, *p1;
p0 = *pp0;
p1 = *pp1;
if(p1->n_trace > 0)
{
for(i = 0;i < p1->n_trace; i++)
{
sprintf(str,"%%0%dx ",(p1->trace[i].size+3)/4);
printf(str,p0->trace[i].value);
}
printf("\n");
}
/* if(p1->time > 10000)
p1->exit = 1; */
p1->time = p1->time + 1;
}
void
la_init(la_t *p0, la_t *p1)
{
int i,j,k;
int stop[64];
/* print signal names vertically */
for(i=0;i<p1->n_trace;i++)
stop[i] = 0;
if(p1->n_trace>0) for(j=0;1;j++)
{
for(i=0;i<p1->n_trace;i++)
{
if(stop[i]==0)
{
if(p1->trace[i].name[j]==0)
{
stop[i] = 1;
printf(" ");
}
else
printf("%c",p1->trace[i].name[j]);
}
else
printf(" ");
for(k=0;k<(p1->trace[i].size+3)/4;k++)
printf(" ");
}
printf("\n");
for(i=0;i<p1->n_trace;i++)
if(stop[i]==0)
break;
if(i==p1->n_trace)
break;
}
p0->time = p1->time = 0;
p0->exit = p1->exit = 0;
p0->gclk = p1->gclk = 0;
p0->gclk_old = p1->gclk_old = 0;
}