rcpgate_misc_test
3.49 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/sbin/perl
if ($ENV{"ROOT"}) {
$ROOT = $ENV{"ROOT"};
}
else {
die "ROOT env not set. Plaase set ROOT environment first \n";
}
$VUREGRES = $ROOT."/PR/rspsim/vuregre";
$TEST_SRC_DIR = $VUREGRES."/rcp_misc_tests";
$hw2 = 1;
$HW = "hw2";
$MAKE_REAL_MAKEFILE = "make_reality_makefile2";
$TOOL = $VUREGRES."/bin";
$RSPASM = $ROOT."/PR/rspasm1201";
$RSPSIM = $ROOT."/PR/rspsim";
$REALITY_PATH = $ROOT."/PR/".$HW."/chip/sim";
$VCSDIR = "/ecad/vcs/vcs_2.2/sgi";
$WORKDIR = `pwd`;
chop($WORKDIR);
$DESIGNC = $WORKDIR."/designc";
$OPTION_VCSCOMPILE = 1;
$OPTION_VCSRUN = 1;
$OPTION_GATE = 0;
@PlusArgs = ();
$TEST = "";
while ($#ARGV >= 0) {
if ($ARGV[0] eq '-nocompile') {
shift (@ARGV);
$OPTION_VCSCOMPILE = 0;
$OPTION_ASM = 0;
}
elsif ($ARGV[0] eq '-norun') {
shift (@ARGV);
$OPTION_VCSRUN = 0;
}
elsif ($ARGV[0] eq '+freeze_vclk_false') {
$PlusArgs = push(@PlusArgs,shift(@ARGV));
$PlusArgs = push(@PlusArgs,"+test_bypass");
}
elsif ($ARGV[0] eq '+rcp_test_tssi') {
$PlusArgs = push(@PlusArgs,shift(@ARGV));
$PlusArgs = push(@PlusArgs,"+test_bypass");
}
elsif ($ARGV[0] eq '+dumpvars') {
$PlusArgs = push(@PlusArgs,shift(@ARGV));
}
elsif ($ARGV[0] eq '+rsp_mon') {
$PlusArgs = push(@PlusArgs,shift(@ARGV));
}
elsif ($ARGV[0] =~ /^\+reality=/) {
($TEMP,$plus_arg) = split(/=/,shift(@ARGV));
$PlusArgs = push(@PlusArgs,"+".$plus_arg);
}
elsif ($ARGV[0] =~ /^\+test=/) {
($TEMP,$TEST) = split(/=/,shift(@ARGV));
$TEST = $TEST.".v";
}
elsif ($ARGV[0] eq '-h') {
shift (@ARGV);
print "\n";
print "\n";
exit;
}
else {
die "Illigal option provided \n";
}
} #while ($#ARGV >= 0)
if (!(-e $DESIGNC && -d $DESIGNC)) {
print "Creating the $DESIGNC directory\n";
mkdir ($DESIGNC,0777) || die "Cant make $DESIGNC \n";
}
if (!(-r $REALITY_PATH."/Makefile")){
die "$REALITY_PATH/Makefile not found. Please p_tupdate $REALITY_PATH \n";
}
if (-r $REALITY_PATH."/Makefile"){
print "Getting file $REALITY_PATH/Makefile \n";
system("cat $REALITY_PATH/Makefile | $TOOL/$MAKE_REAL_MAKEFILE > $WORKDIR/Makefile")==0
|| die " System Call interrupt";
chmod(0666,$WORKDIR."/Makefile");
}
else {
die "$REALITY_PATH/Makefile not found. Please p_tupdate $REALITY_PATH \n";
}
if (-r $TEST_SRC_DIR."/$TEST") {
print "Getting file $TEST_SRC_DIR/$TEST \n";
system("cp $TEST_SRC_DIR/$TEST rcp_misc_test.v")==0 || die " System Call interrupt";
chmod(0666, rcp_misc_test.v);
}
else {
die "$TEST_SRC_DIR/$TEST not found. Please p_tupdate $REALITY_PATH \n";
}
if ($OPTION_VCSCOMPILE) {
print "\n\nVCS Compile in progress\n\n";
chdir ("$WORKDIR");
if (-r "$WORKDIR/designc/simv"){
system("rm $WORKDIR/designc/simv")==0 || die "System Interrupt";
}
chdir ("$WORKDIR");
system("make simv_rcpgate_misc_test")==0 || die "VCS compile interupt";
system("mv simv_rcpgate_misc_test designc/simv_rcpgate_misc_test")==0 || die "System Interrupt";
}
$SIMV = "simv";
$HW_TYPE = "on HW2";
if ($OPTION_VCSRUN) {
chdir ("$WORKDIR");
print "\n\n Running (RSP RCP_PIN_LEVEL, $GATE_LEVEL, $HW_TYPE) Simulation\n\n";
print "plusargs passed to vcs are: @PlusArgs \n";
system("/bin/csh -c 'setenv LD_LIBRARY_PATH $VCSDIR/lib; ".
"time designc/simv_rcpgate_misc_test -q @PlusArgs ' > ,out")==0
|| die("Interrupt occured, cannot run regression");
print "SImulation Complete\n";
}