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

Subversion Repositories apb_slave

[/] [apb_slave/] [trunk/] [src/] [base/] [apb_slave_trace.v] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eyalhoc
<##//////////////////////////////////////////////////////////////////
2 2 eyalhoc
////                                                             ////
3
////  Author: Eyal Hochberg                                      ////
4
////          eyal@provartec.com                                 ////
5
////                                                             ////
6
////  Downloaded from: http://www.opencores.org                  ////
7
/////////////////////////////////////////////////////////////////////
8
////                                                             ////
9
//// Copyright (C) 2010 Provartec LTD                            ////
10
//// www.provartec.com                                           ////
11
//// info@provartec.com                                          ////
12
////                                                             ////
13
//// This source file may be used and distributed without        ////
14
//// restriction provided that this copyright statement is not   ////
15
//// removed from the file and that any derivative work contains ////
16
//// the original copyright notice and the associated disclaimer.////
17
////                                                             ////
18
//// This source file is free software; you can redistribute it  ////
19
//// and/or modify it under the terms of the GNU Lesser General  ////
20
//// Public License as published by the Free Software Foundation.////
21
////                                                             ////
22
//// This source is distributed in the hope that it will be      ////
23
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
24
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
25
//// PURPOSE.  See the GNU Lesser General Public License for more////
26
//// details. http://www.gnu.org/licenses/lgpl.html              ////
27
////                                                             ////
28 9 eyalhoc
//////////////////////////////////////////////////////////////////##>
29 2 eyalhoc
 
30
OUTFILE PREFIX_trace.v
31
 
32
INCLUDE def_apb_slave.txt
33
 
34
module PREFIX_trace(PORTS);
35
 
36
   parameter                  SLAVE_NUM = 0;
37
 
38
   parameter                  FILE_NAME     = "PREFIX.trc";
39
 
40
   input                      clk;
41
   input                      reset;
42
 
43
   input                      GROUP_STUB_MEM;
44
 
45
 
46
   reg                        RD_d;
47
   reg [ADDR_BITS-1:0]         ADDR_RD_d;
48
 
49
   wire [31:0]                 ADDR_WR_disp =  ADDR_WR;
50
   wire [31:0]                 ADDR_RD_disp =  ADDR_RD_d;
51
 
52
   integer                    file_ptr;
53
 
54
   initial
55
     file_ptr = $fopen(FILE_NAME, "w");
56
 
57
 
58
   always @(posedge clk or posedge reset)
59
     if (reset)
60
       begin
61
          ADDR_RD_d <= #FFD 'd0;
62
          RD_d <= #FFD 'd0;
63
       end
64
     else
65
       begin
66
          ADDR_RD_d <= #FFD ADDR_RD;
67
          RD_d <= #FFD RD;
68
       end
69
 
70
   always @(posedge clk)
71
     if (WR)
72
       $fwrite(file_ptr, "%16d: %0s WR: Addr: 0x%8h, Data: 0x%8h, Bsel: 0x%2h\n", $time, FILE_NAME, ADDR_WR_disp, DIN, BSEL);
73
 
74
   always @(posedge clk)
75
     if (RD_d)
76
       $fwrite(file_ptr, "%16d: %0s RD: Addr: 0x%8h, Data: 0x%8h\n", $time, FILE_NAME, ADDR_RD_disp, DOUT);
77
 
78
 
79
endmodule
80
 
81
 

powered by: WebSVN 2.1.0

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