| 1 | // ========== Copyright Header Begin ========================================== |
| 2 | // |
| 3 | // OpenSPARC T2 Processor File: dump.v |
| 4 | // Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 5 | // 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 6 | // |
| 7 | // * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 8 | // |
| 9 | // This program is free software; you can redistribute it and/or modify |
| 10 | // it under the terms of the GNU General Public License as published by |
| 11 | // the Free Software Foundation; version 2 of the License. |
| 12 | // |
| 13 | // This program is distributed in the hope that it will be useful, |
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | // GNU General Public License for more details. |
| 17 | // |
| 18 | // You should have received a copy of the GNU General Public License |
| 19 | // along with this program; if not, write to the Free Software |
| 20 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | // |
| 22 | // For the avoidance of doubt, and except that if any non-GPL license |
| 23 | // choice is available it will apply instead, Sun elects to use only |
| 24 | // the General Public License version 2 (GPLv2) at this time for any |
| 25 | // software where a choice of GPL license versions is made |
| 26 | // available with the language indicating that GPLv2 or any later version |
| 27 | // may be used, or where a choice of which version of the GPL is applied is |
| 28 | // otherwise unspecified. |
| 29 | // |
| 30 | // Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 31 | // CA 95054 USA or visit www.sun.com if you need additional information or |
| 32 | // have any questions. |
| 33 | // |
| 34 | // ========== Copyright Header End ============================================ |
| 35 | reg [2047:0] dumpfilename; |
| 36 | integer limit_dump; |
| 37 | integer start_dump; |
| 38 | integer stop_dump; |
| 39 | |
| 40 | initial |
| 41 | begin |
| 42 | limit_dump = 0; |
| 43 | end |
| 44 | |
| 45 | `ifndef ALL_DUMP_OFF |
| 46 | |
| 47 | `ifndef VCD_OFF |
| 48 | // VCD Dumpfile |
| 49 | // sims does file naming and start/stop for us. |
| 50 | |
| 51 | initial begin |
| 52 | if ($test$plusargs("vcd")) begin |
| 53 | $display("VCD dumping enabled"); |
| 54 | if ($test$plusargs("DUMP_ALL")) begin |
| 55 | // $dumpvars(1,t2_fpga); |
| 56 | $dumpvars(5,t2_fpga.t2.ccx); |
| 57 | $dumpvars(5,t2_fpga.t2.spc); |
| 58 | $dumpvars(5,t2_fpga.t2.spc2wbm0); |
| 59 | $dumpvars(5,t2_fpga.t2.spc2wbm1); |
| 60 | $dumpvars(5,t2_fpga.t2.spc2wbm_ncu); |
| 61 | |
| 62 | $display("VCD dumping w/ DUMP_ALL"); |
| 63 | end |
| 64 | else begin |
| 65 | // $dumpvars(4,t2_fpga); |
| 66 | $dumpvars(4,t2_fpga.t2.ccx); |
| 67 | $dumpvars(4,t2_fpga.t2.spc); |
| 68 | $dumpvars(4,t2_fpga.t2.spc2wbm0); |
| 69 | $dumpvars(4,t2_fpga.t2.spc2wbm1); |
| 70 | $dumpvars(4,t2_fpga.t2.spc2wbm_ncu); |
| 71 | $display("VCD dumping t2_fpga 4 level down"); |
| 72 | end |
| 73 | |
| 74 | |
| 75 | if ($test$plusargs("vcs+dumpon")) $dumpoff; |
| 76 | else $dumpon; |
| 77 | end |
| 78 | end |
| 79 | `endif |
| 80 | |
| 81 | `ifndef FSDB_OFF |
| 82 | // Debussy Dumpfile |
| 83 | initial begin |
| 84 | if ($test$plusargs("debussy")) begin |
| 85 | if ($test$plusargs("fsdbfile")) begin |
| 86 | if ($value$plusargs ("fsdbfile=%s", dumpfilename)) begin |
| 87 | $display ("debussy - filename=%s",dumpfilename); |
| 88 | end |
| 89 | end |
| 90 | else begin |
| 91 | dumpfilename = "t2_fpga.fsdb"; |
| 92 | $display("debussy - filename=t2_fpga.fsdb"); |
| 93 | end |
| 94 | |
| 95 | |
| 96 | if (!$test$plusargs("fsdbAutoSwitchDumpfile")) begin |
| 97 | if ($test$plusargs("fsdbDumplimit")) |
| 98 | begin |
| 99 | if ($value$plusargs ("fsdbDumplimit=%d", limit_dump)) |
| 100 | begin |
| 101 | // Minimum limit size is 10 Mbytes (10). |
| 102 | // Maximum size is 1800 Mbytes on a 32bit machine. |
| 103 | // Size is in Mbytes only. |
| 104 | // File will have latest data, *does not stop writing*. |
| 105 | // Do NOT use this from time zero if the fail is very |
| 106 | // late in time, use -dump_start=time |
| 107 | $fsdbDumplimit(limit_dump); |
| 108 | $display ("debussy - dump size limited to %d",limit_dump); |
| 109 | end |
| 110 | end // if ($test$plusargs("fsdbDumplimit")) |
| 111 | $fsdbDumpfile(dumpfilename); |
| 112 | end |
| 113 | |
| 114 | if ($test$plusargs("fsdbAutoSwitchDumpfile")) begin |
| 115 | if ($value$plusargs ("fsdbAutoSwitchDumpfile=%d", limit_dump)) |
| 116 | begin |
| 117 | // Minimum limit size is 2 Mbytes (2). |
| 118 | // Size is in Mbytes only. |
| 119 | // Once the fsdb file fills up, it will be closed and a new one started. |
| 120 | // file names will be dumpfilename_000.fsdb, dumpfilename_001.fsdb, ... |
| 121 | // dumpfilename.log will have the time ranges for each file |
| 122 | $fsdbAutoSwitchDumpfile(limit_dump, dumpfilename, 10); // only allow 10 fsdb files for now |
| 123 | $display("Debussy - fsdbAutoSwitchDumpfile with dump size limited to %d",limit_dump); |
| 124 | end |
| 125 | end |
| 126 | else begin |
| 127 | $fsdbAutoSwitchDumpfile(500, dumpfilename, 10); |
| 128 | end |
| 129 | |
| 130 | if ($test$plusargs("DUMP_ALL")) begin // { |
| 131 | // Dump TestBench t2_fpga and items not instantiated in t2_fpga (i.e. 0in) |
| 132 | $fsdbDumpvars(0,t2_fpga); |
| 133 | |
| 134 | end // } |
| 135 | else begin // { |
| 136 | // Dump 3 levels from TestBench t2_fpga |
| 137 | $fsdbDumpvars(2,t2_fpga); |
| 138 | $fsdbDumpvars(3,t2_fpga.t2.ccx); |
| 139 | $fsdbDumpvars(3,t2_fpga.t2.spc); |
| 140 | $fsdbDumpvars(3,t2_fpga.t2.spc2wbm0); |
| 141 | $fsdbDumpvars(3,t2_fpga.t2.spc2wbm1); |
| 142 | $fsdbDumpvars(3,t2_fpga.t2.spc2wbm_ncu); |
| 143 | end // } |
| 144 | |
| 145 | if ($test$plusargs("fsdb+dumpon")) $fsdbDumpoff; |
| 146 | else $fsdbDumpon; |
| 147 | |
| 148 | end |
| 149 | end //initial |
| 150 | |
| 151 | `endif |
| 152 | `endif |
| 153 | |