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

Subversion Repositories amber

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

Go to most recent revision | 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
`timescale  1 ns / 1 ps
44
`include "global_defines.v"
45
 
46
module dumpvcd();
47
 
48
 
49
// ======================================
50
// Dump Waves to VCD File
51
// ======================================
52
`ifdef AMBER_DUMP_VCD
53
initial
54
    begin
55
    $display ("VCD Dump enabled from %d to %d",
56
    ( `AMBER_DUMP_START                ),
57
    ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH ) );
58
 
59
    $dumpfile(`AMBER_VCD_FILE);
60
    $dumpvars(1, `U_TB.clk_count);
61
 
62
    $dumpvars(1, `U_DECOMPILE.xINSTRUCTION_EXECUTE);
63
    $dumpvars(1, `U_EXECUTE.o_write_enable);
64
    $dumpvars(1, `U_EXECUTE.o_exclusive);
65
    $dumpvars(1, `U_EXECUTE.o_write_data);
66
    $dumpvars(1, `U_EXECUTE.base_address);
67 17 csantifort
    $dumpvars(1, `U_EXECUTE.pc);
68 2 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r0);
69
    $dumpvars(1, `U_EXECUTE.u_register_bank.r1);
70
    $dumpvars(1, `U_EXECUTE.u_register_bank.r2);
71
    $dumpvars(1, `U_EXECUTE.u_register_bank.r3);
72
    $dumpvars(1, `U_EXECUTE.u_register_bank.r4);
73
    $dumpvars(1, `U_EXECUTE.u_register_bank.r5);
74
    $dumpvars(1, `U_EXECUTE.u_register_bank.r6);
75
    $dumpvars(1, `U_EXECUTE.u_register_bank.r7);
76
    $dumpvars(1, `U_EXECUTE.u_register_bank.r8);
77
    $dumpvars(1, `U_EXECUTE.u_register_bank.r9);
78
    $dumpvars(1, `U_EXECUTE.u_register_bank.r10);
79
    $dumpvars(1, `U_EXECUTE.u_register_bank.r11);
80
    $dumpvars(1, `U_EXECUTE.u_register_bank.r12);
81
    $dumpvars(1, `U_EXECUTE.u_register_bank.r13_out);
82
    $dumpvars(1, `U_EXECUTE.u_register_bank.r14_out);
83 17 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r14_irq);
84 2 csantifort
    $dumpvars(1, `U_EXECUTE.u_register_bank.r15);
85
 
86
 
87 15 csantifort
    $dumpvars(1, `U_FETCH);
88 2 csantifort
    $dumpvars(1, `U_CACHE);
89 15 csantifort
    $dumpvars(1, `U_DECODE);
90 2 csantifort
    $dumpvars(1, `U_WISHBONE);
91
    $dumpvars(1, `U_AMBER);
92 15 csantifort
 
93
    `ifdef AMBER_A25_CORE
94
    $dumpvars(1, `U_MEM);
95
    $dumpvars(1, `U_DCACHE);
96
    `endif
97
 
98 2 csantifort
    $dumpoff;
99
    end
100
 
101
always @(posedge `U_DECOMPILE.i_clk)
102
    begin
103
    if ( `U_DECOMPILE.clk_count == 10 )
104
        begin
105
        $dumpon;
106 17 csantifort
        $display("\nDump on at  %d ticks", `U_DECOMPILE.clk_count);
107 2 csantifort
        end
108
 
109
    if ( `U_DECOMPILE.clk_count == 20 )
110
        begin
111
        $dumpoff;
112 17 csantifort
        $display("\nDump off at %d ticks", `U_DECOMPILE.clk_count);
113 2 csantifort
        end
114
 
115
 
116
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + 0 ) )
117
        begin
118
        $dumpon;
119 17 csantifort
        $display("\nDump on at  %d ticks", `U_DECOMPILE.clk_count);
120 2 csantifort
        end
121
 
122
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH ) )
123
        begin
124
        $dumpoff;
125 17 csantifort
        $display("\nDump off at %d ticks", `U_DECOMPILE.clk_count);
126 2 csantifort
        end
127
 
128
    `ifdef AMBER_TERMINATE
129
    if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH + 100) )
130
        begin
131 17 csantifort
        $display("\nAutomatic test termination after dump has completed");
132 2 csantifort
        `TB_ERROR_MESSAGE
133
        end
134
    `endif
135
    end
136
 
137
 
138
 
139
`endif
140
 
141
 
142
 
143
endmodule

powered by: WebSVN 2.1.0

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