OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [hw/] [vlog/] [tb/] [dumpvcd.v] - Blame information for rev 82

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 csantifort
//////////////////////////////////////////////////////////////////
2
//                                                              //
3
//  Waveform Dumping Control                                    //
4
//                                                              //
5
//  This file is part of the Amber project                      //
6
//  http://www.opencores.org/project,amber                      //
7
//                                                              //
8
//  Description                                                 //
9
//  Its useful in very long simulations to be able to record    //
10
//  a set of signals for a limited window of time, so           //
11
//  that the dump file does not get too large.                  //
12
//                                                              //
13
//  Author(s):                                                  //
14
//      - Conor Santifort, csantifort.amber@gmail.com           //
15
//                                                              //
16
//////////////////////////////////////////////////////////////////
17
//                                                              //
18
// Copyright (C) 2010 Authors and OPENCORES.ORG                 //
19
//                                                              //
20
// This source file may be used and distributed without         //
21
// restriction provided that this copyright statement is not    //
22
// removed from the file and that any derivative work contains  //
23
// the original copyright notice and the associated disclaimer. //
24
//                                                              //
25
// This source file is free software; you can redistribute it   //
26
// and/or modify it under the terms of the GNU Lesser General   //
27
// Public License as published by the Free Software Foundation; //
28
// either version 2.1 of the License, or (at your option) any   //
29
// later version.                                               //
30
//                                                              //
31
// This source is distributed in the hope that it will be       //
32
// useful, but WITHOUT ANY WARRANTY; without even the implied   //
33
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      //
34
// PURPOSE.  See the GNU Lesser General Public License for more //
35
// details.                                                     //
36
//                                                              //
37
// You should have received a copy of the GNU Lesser General    //
38
// Public License along with this source; if not, download it   //
39
// from http://www.opencores.org/lgpl.shtml                     //
40
//                                                              //
41
//////////////////////////////////////////////////////////////////
42
 
43 82 csantifort
`include "global_defines.vh"
44 2 csantifort
 
45
module dumpvcd();
46
 
47
 
48
// ======================================
49
// Dump Waves to VCD File
50
// ======================================
51
`ifdef AMBER_DUMP_VCD
52
initial
53
    begin
54
    $display ("VCD Dump enabled from %d to %d",
55
    ( `AMBER_DUMP_START                ),
56
    ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH ) );
57
 
58
    $dumpfile(`AMBER_VCD_FILE);
59
    $dumpvars(1, `U_TB.clk_count);
60
 
61
    $dumpvars(1, `U_DECOMPILE.xINSTRUCTION_EXECUTE);
62
    $dumpvars(1, `U_EXECUTE.o_write_enable);
63
    $dumpvars(1, `U_EXECUTE.o_exclusive);
64
    $dumpvars(1, `U_EXECUTE.o_write_data);
65
    $dumpvars(1, `U_EXECUTE.base_address);
66 17 csantifort
    $dumpvars(1, `U_EXECUTE.pc);
67 2 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r0);
68
    $dumpvars(1, `U_EXECUTE.u_register_bank.r1);
69
    $dumpvars(1, `U_EXECUTE.u_register_bank.r2);
70
    $dumpvars(1, `U_EXECUTE.u_register_bank.r3);
71
    $dumpvars(1, `U_EXECUTE.u_register_bank.r4);
72
    $dumpvars(1, `U_EXECUTE.u_register_bank.r5);
73
    $dumpvars(1, `U_EXECUTE.u_register_bank.r6);
74
    $dumpvars(1, `U_EXECUTE.u_register_bank.r7);
75
    $dumpvars(1, `U_EXECUTE.u_register_bank.r8);
76
    $dumpvars(1, `U_EXECUTE.u_register_bank.r9);
77
    $dumpvars(1, `U_EXECUTE.u_register_bank.r10);
78
    $dumpvars(1, `U_EXECUTE.u_register_bank.r11);
79
    $dumpvars(1, `U_EXECUTE.u_register_bank.r12);
80
    $dumpvars(1, `U_EXECUTE.u_register_bank.r13_out);
81
    $dumpvars(1, `U_EXECUTE.u_register_bank.r14_out);
82 17 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r14_irq);
83 2 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r15);
84
 
85
 
86 15 csantifort
    $dumpvars(1, `U_FETCH);
87 2 csantifort
    $dumpvars(1, `U_CACHE);
88 15 csantifort
    $dumpvars(1, `U_DECODE);
89 2 csantifort
    $dumpvars(1, `U_WISHBONE);
90
    $dumpvars(1, `U_AMBER);
91 15 csantifort
 
92
    `ifdef AMBER_A25_CORE
93
    $dumpvars(1, `U_MEM);
94
    $dumpvars(1, `U_DCACHE);
95
    `endif
96
 
97 2 csantifort
    $dumpoff;
98
    end
99
 
100
always @(posedge `U_DECOMPILE.i_clk)
101
    begin
102
    if ( `U_DECOMPILE.clk_count == 10 )
103
        begin
104
        $dumpon;
105 17 csantifort
        $display("\nDump on at  %d ticks", `U_DECOMPILE.clk_count);
106 2 csantifort
        end
107
 
108
    if ( `U_DECOMPILE.clk_count == 20 )
109
        begin
110
        $dumpoff;
111 17 csantifort
        $display("\nDump off at %d ticks", `U_DECOMPILE.clk_count);
112 2 csantifort
        end
113
 
114
 
115
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + 0 ) )
116
        begin
117
        $dumpon;
118 17 csantifort
        $display("\nDump on at  %d ticks", `U_DECOMPILE.clk_count);
119 2 csantifort
        end
120
 
121
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH ) )
122
        begin
123
        $dumpoff;
124 17 csantifort
        $display("\nDump off at %d ticks", `U_DECOMPILE.clk_count);
125 2 csantifort
        end
126
 
127
    `ifdef AMBER_TERMINATE
128
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH + 100) )
129
        begin
130 17 csantifort
        $display("\nAutomatic test termination after dump has completed");
131 2 csantifort
        `TB_ERROR_MESSAGE
132
        end
133
    `endif
134
    end
135
 
136
 
137
 
138
`endif
139
 
140
 
141
 
142
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.