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_FETCH.o_read_data);
|
63 |
|
|
$dumpvars(1, `U_DECOMPILE.xINSTRUCTION_EXECUTE);
|
64 |
|
|
$dumpvars(1, `U_DECODE.firq_request);
|
65 |
|
|
$dumpvars(1, `U_DECODE.irq_request);
|
66 |
|
|
$dumpvars(1, `U_DECODE.swi_request);
|
67 |
|
|
$dumpvars(1, `U_DECODE.interrupt);
|
68 |
|
|
$dumpvars(1, `U_DECODE.next_interrupt);
|
69 |
|
|
$dumpvars(1, `U_DECODE.interrupt_mode);
|
70 |
|
|
$dumpvars(1, `U_DECODE.instruction_valid);
|
71 |
|
|
$dumpvars(1, `U_DECODE.instruction_execute);
|
72 |
|
|
$dumpvars(1, `U_DECODE.instruction);
|
73 |
|
|
$dumpvars(1, `U_EXECUTE.i_fetch_stall);
|
74 |
|
|
$dumpvars(1, `U_EXECUTE.o_write_enable);
|
75 |
|
|
$dumpvars(1, `U_EXECUTE.o_exclusive);
|
76 |
|
|
$dumpvars(1, `U_EXECUTE.o_write_data);
|
77 |
|
|
$dumpvars(1, `U_EXECUTE.o_address);
|
78 |
|
|
$dumpvars(1, `U_EXECUTE.base_address);
|
79 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r0);
|
80 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r1);
|
81 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r2);
|
82 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r3);
|
83 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r4);
|
84 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r5);
|
85 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r6);
|
86 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r7);
|
87 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r8);
|
88 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r9);
|
89 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r10);
|
90 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r11);
|
91 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r12);
|
92 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r13_out);
|
93 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r14_out);
|
94 |
|
|
$dumpvars(1, `U_EXECUTE.u_register_bank.r15);
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
$dumpvars(1, `U_COPRO15);
|
98 |
|
|
$dumpvars(1, `U_CACHE);
|
99 |
|
|
$dumpvars(1, `U_WISHBONE);
|
100 |
|
|
$dumpvars(1, `U_AMBER);
|
101 |
|
|
|
102 |
|
|
$dumpvars(1, `U_SYSTEM.u_main_mem);
|
103 |
|
|
|
104 |
|
|
$dumpoff;
|
105 |
|
|
end
|
106 |
|
|
|
107 |
|
|
always @(posedge `U_DECOMPILE.i_clk)
|
108 |
|
|
begin
|
109 |
|
|
if ( `U_DECOMPILE.clk_count == 10 )
|
110 |
|
|
begin
|
111 |
|
|
$dumpon;
|
112 |
|
|
$display("Dump on at %d ticks", `U_DECOMPILE.clk_count);
|
113 |
|
|
end
|
114 |
|
|
|
115 |
|
|
if ( `U_DECOMPILE.clk_count == 20 )
|
116 |
|
|
begin
|
117 |
|
|
$dumpoff;
|
118 |
|
|
$display("Dump off at %d ticks", `U_DECOMPILE.clk_count);
|
119 |
|
|
end
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + 0 ) )
|
123 |
|
|
begin
|
124 |
|
|
$dumpon;
|
125 |
|
|
$display("Dump on at %d ticks", `U_DECOMPILE.clk_count);
|
126 |
|
|
end
|
127 |
|
|
|
128 |
|
|
if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH ) )
|
129 |
|
|
begin
|
130 |
|
|
$dumpoff;
|
131 |
|
|
$display("Dump off at %d ticks", `U_DECOMPILE.clk_count);
|
132 |
|
|
end
|
133 |
|
|
|
134 |
|
|
`ifdef AMBER_TERMINATE
|
135 |
|
|
if ( `U_DECOMPILE.clk_count == ( `AMBER_DUMP_START + `AMBER_DUMP_LENGTH + 100) )
|
136 |
|
|
begin
|
137 |
|
|
$display("Automatic test termination after dump has completed");
|
138 |
|
|
`TB_ERROR_MESSAGE
|
139 |
|
|
end
|
140 |
|
|
`endif
|
141 |
|
|
end
|
142 |
|
|
|
143 |
|
|
|
144 |
|
|
|
145 |
|
|
`endif
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
|
|
endmodule
|