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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_21/] [bench/] [verilog/] [cpu_behavioral.v] - Blame information for rev 101

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 101 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// cpu_behavioral.v                                             ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the SoC/OpenRISC Development Interface ////
7
////  http://www.opencores.org/projects/DebugInterface/           ////
8
////                                                              ////
9
////  Author(s):                                                  ////
10
////       Igor Mohor (igorm@opencores.org)                       ////
11
////                                                              ////
12
////                                                              ////
13
////  All additional information is avaliable in the README.txt   ////
14
////  file.                                                       ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18
//// Copyright (C) 2000 - 2004 Authors                            ////
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
// CVS Revision History
44
//
45
// $Log: not supported by cvs2svn $
46
//
47
//
48
//
49
//
50
`include "timescale.v"
51
`include "dbg_cpu_defines.v"
52
 
53
 
54
 
55
module cpu_behavioral
56
                   (
57
                    // CPU signals
58
                    cpu_rst_i,
59
                    cpu_clk_o,
60
                    cpu_addr_i,
61
                    cpu_data_o,
62
                    cpu_data_i,
63
                    cpu_bp_o,
64
                    cpu_stall_i,
65
                    cpu_stall_all_i,
66
                    cpu_stb_i,
67
                    cpu_sel_i,
68
                    cpu_we_i,
69
                    cpu_ack_o,
70
                    cpu_rst_o
71
                   );
72
 
73
 
74
// CPU signals
75
input         cpu_rst_i;
76
output        cpu_clk_o;
77
input  [31:0] cpu_addr_i;
78
output [31:0] cpu_data_o;
79
input  [31:0] cpu_data_i;
80
output        cpu_bp_o;
81
input         cpu_stall_i;
82
input         cpu_stall_all_i;
83
input         cpu_stb_i;
84
input [`CPU_NUM -1:0]  cpu_sel_i;
85
input         cpu_we_i;
86
output        cpu_ack_o;
87
output        cpu_rst_o;
88
 
89
reg           cpu_clk_o;
90
reg    [31:0] tmp_data;
91
 
92
initial
93
begin
94
  cpu_clk_o = 1'b0;
95
  forever #5 cpu_clk_o = ~cpu_clk_o;
96
end
97
 
98
 
99
assign cpu_bp_o = 1'b0;
100
 
101
assign #200 cpu_ack_o = cpu_stall_i & cpu_stb_i;
102
 
103
 
104
 
105
always @ (posedge cpu_clk_o or posedge cpu_rst_i)
106
begin
107
  if (cpu_rst_i)
108
    tmp_data <= #1 32'h11111111;
109
  else if ((cpu_addr_i == 32'h32323232) & cpu_we_i & cpu_ack_o)
110
    tmp_data <= #1 32'hdeaddead;
111
  else if ((cpu_addr_i == 32'h08080808) & cpu_we_i & cpu_ack_o)
112
    tmp_data <= #1 32'hbeefbeef;
113
end
114
 
115
 
116
 
117
 
118
endmodule
119
 

powered by: WebSVN 2.1.0

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