pro_epi.c
2.17 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
#include <stdio.h>
#include "vudefs.h"
prolog(fp)
FILE *fp;
{
int i;
fprintf(fp,"/*******************************\n");
fprintf(fp," *prog name: %s \n",prog_name);
fprintf(fp," *******************************/\n");
fprintf(fp," \n");
/*
fprintf(fp,"#include \"/hosts/yogi/usr/people/kishor/mdevroot/PR/rspsim/vuregre/src/include/VU_AVP.h\" \n");
*/
fprintf(fp,"#include \"VU_AVP.h\" \n");
fprintf(fp," \n");
fprintf(fp," .text \n");
fprintf(fp," lui $26, 0x0000 \n");
fprintf(fp," ori $26, 0x0040 \n");
fprintf(fp," lui $27, 0x0000 \n");
fprintf(fp," ori $27, 0x0fe0 \n");
fprintf(fp," \n");
for (i=0; i<8; i++) data[data_pntr++] = 0x4000;
for (i=0; i<8; i++) data[data_pntr++] = 0x0001;
for (i=0; i<8; i++) data[data_pntr++] = 0x0000;
for (i=0; i<8; i++) data[data_pntr++] = 0x0000;
}
epilog(fp)
FILE *fp;
{
fprintf(fp," \n");
fprintf(fp," lui $31,0xfeed \n");
fprintf(fp," ori $31,0x0000 \n");
fprintf(fp," sw $31, 0($0) \n");
fprintf(fp," nop \n");
fprintf(fp," break \n");
fprintf(fp," nop \n");
fprintf(fp," nop \n");
fprintf(fp," nop \n");
fprintf(fp," nop \n");
fprintf(fp,"Fail: \n");
fprintf(fp," lui $31,0xdead \n");
fprintf(fp," ori $31,0xbeef \n");
fprintf(fp," sw $31, 0($0) \n");
fprintf(fp," nop \n");
fprintf(fp," break \n");
fprintf(fp," nop \n");
fprintf(fp," nop \n");
}
dump_data(fp)
FILE *fp;
{
int i;
fprintf(fp," \n");
fprintf(fp,"/**************************************/\n");
fprintf(fp," \n");
fprintf(fp,".data \n");
fprintf(fp," \n");
if (data_pntr>=2048){
fprintf(fp,"******ERROR*****Data Segment exceeds 4K \n");
printf("******ERROR*****Data Segment exceeds 4K \n");
}
else
for (i=0; i<data_pntr; i++) fprintf(fp," .half 0x%4.4X \n",data[i]);
}