Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | .########################################################################## |
2 | .# | |
3 | .# File: mcusat_cov_inc.pal | |
4 | .# | |
5 | .# Description: | |
6 | .# ----------- | |
7 | .# Common Pal header file that uses a map of the sys(tem) being | |
8 | .# simulated and decides on: | |
9 | .# number of cores | |
10 | .# instance path for each core (for dram) | |
11 | .# $Id: mcusat_cov_inc.pal,v 1.6 2003/03/13 00:03:32 rp139827 Exp $ | |
12 | .# | |
13 | .########################################################################## | |
14 | . $cores = 1; # default settings | |
15 | . $drc = 4; # default settings, # of channel 4 (02 & 13 are grouped) | |
16 | . $sys = "DRAM"; # default system being simulated | |
17 | .# END_INIT | |
18 | . $THREADS_PER_CORE = 4; # a frequently used constant | |
19 | . | |
20 | . $prefix = "mcusat"; # prefix for sample names and cov class | |
21 | . if ( $sys eq "CMP1" ) { $cores = 2; } | |
22 | . if ( $sys eq "DRAM" ) { $prefix = ""; } | |
23 | // sys = $sys, cores = $cores | |
24 | . | |
25 | // This is the dram monitor path where all signals are brought in | |
26 | //. $DRAM_MON_PATH = "cmp_top.cmp_dram.cmp_dram_mon.dram_mon0"; | |
27 | . $DRAM_MON_PATH = "`TOP_MOD.mcusat_cov_mon"; | |
28 | . $MCU0_PATH = "`TOP_MOD.cpu.mcu0"; | |
29 | . $MCU1_PATH = "`TOP_MOD.cpu.mcu1"; | |
30 | . $MCU2_PATH = "`TOP_MOD.cpu.mcu2"; | |
31 | . $MCU3_PATH = "`TOP_MOD.cpu.mcu3"; | |
32 | . for ( $i = 0; $i < $cores; $i++ ) { | |
33 | . $CORE_STR[$i] = $i; | |
34 | //. $SPARC_COV_PATHS[$i] = "cmp_top.iop.cmp.sparc${i}"; | |
35 | . $SPARC_COV_PATHS[$i] = "`TOP_MOD_INST.cmp.sparc${i}"; | |
36 | . } | |
37 | . for ( $i = 0; $i < $drc; $i++ ) { | |
38 | . $DRC_STR[$i] = $i; | |
39 | . } | |
40 | ||
41 | .########################################################################### | |
42 | .# toggle - use to generate toggle type coverage for a signal or field. | |
43 | .# just pass the number of bits in the variable. Use like this: | |
44 | .# | |
45 | .# sample variable_toggle_sample (variable[5:0]) { | |
46 | .# . &toggle(6); | |
47 | .# } | |
48 | .# | |
49 | .########################################################################## | |
50 | .sub toggle { | |
51 | . local($num_bits) = @_; | |
52 | . | |
53 | . for($i=$num_bits-1; $i >= 0; $i--) { | |
54 | . printf (" wildcard state s_bit_%02d_0 ( %d\'b", $i, $num_bits ); | |
55 | . for($j=$num_bits-1; $j >= 0; $j--) { | |
56 | . if( $i == $j ) { print "0"; } | |
57 | . else { print "x"; } | |
58 | . } | |
59 | . print " );\n"; | |
60 | . printf (" wildcard state s_bit_%02d_1 ( %d\'b", $i, $num_bits ); | |
61 | . for($j=$num_bits-1; $j >= 0; $j--) { | |
62 | . if( $i == $j ) { print "1"; } | |
63 | . else { print "x"; } | |
64 | . } | |
65 | . print " );\n"; | |
66 | . } | |
67 | .} | |
68 | . | |
69 | .########################################################################### | |
70 | .# toggle2 - use to generate toggle type coverage for a signal or field. | |
71 | .# just pass the number of bits in the variable andn its name like this: | |
72 | .# | |
73 | .# sample variable_toggle_sample (variable[5:0]) { | |
74 | .# . &toggle2(6, "variable" ); | |
75 | .# } | |
76 | .# | |
77 | .# &toggle uses wildcards which are said to hurt performance. This uses | |
78 | .# a different technique. | |
79 | .########################################################################## | |
80 | .#sub toggle2 { | |
81 | .# local($num_bits,$variable) = @_; | |
82 | .# | |
83 | .# for($i=$num_bits-1; $i >= 0; $i--) { | |
84 | .# printf(" state s_bit_%02d_0 ( %s[%d] == 1'b0 );\n", $i, $variable, $i ); | |
85 | .# printf(" state s_bit_%02d_1 ( %s[%d] == 1'b1 );\n", $i, $variable, $i ); | |
86 | .# } | |
87 | .#} |