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 158

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 120 mohor
// Revision 1.2  2004/01/17 18:01:31  mohor
47
// New version.
48
//
49 102 mohor
// Revision 1.1  2004/01/17 17:01:25  mohor
50
// Almost finished.
51 101 mohor
//
52
//
53
//
54
//
55 102 mohor
//
56 101 mohor
`include "timescale.v"
57
`include "dbg_cpu_defines.v"
58
 
59
 
60
 
61
module cpu_behavioral
62
                   (
63
                    // CPU signals
64
                    cpu_rst_i,
65
                    cpu_clk_o,
66
                    cpu_addr_i,
67
                    cpu_data_o,
68
                    cpu_data_i,
69
                    cpu_bp_o,
70
                    cpu_stall_i,
71
                    cpu_stall_all_i,
72
                    cpu_stb_i,
73
                    cpu_sel_i,
74
                    cpu_we_i,
75
                    cpu_ack_o,
76
                    cpu_rst_o
77
                   );
78
 
79
 
80
// CPU signals
81
input         cpu_rst_i;
82
output        cpu_clk_o;
83
input  [31:0] cpu_addr_i;
84
output [31:0] cpu_data_o;
85
input  [31:0] cpu_data_i;
86
output        cpu_bp_o;
87
input         cpu_stall_i;
88
input         cpu_stall_all_i;
89
input         cpu_stb_i;
90
input [`CPU_NUM -1:0]  cpu_sel_i;
91
input         cpu_we_i;
92
output        cpu_ack_o;
93
output        cpu_rst_o;
94
 
95
reg           cpu_clk_o;
96 102 mohor
reg    [31:0] cpu_data_o;
97 120 mohor
reg           cpu_bp_o;
98 101 mohor
 
99
initial
100
begin
101
  cpu_clk_o = 1'b0;
102
  forever #5 cpu_clk_o = ~cpu_clk_o;
103
end
104
 
105
 
106 120 mohor
initial
107
begin
108
  cpu_bp_o = 1'b0;
109
end
110 101 mohor
 
111
assign #200 cpu_ack_o = cpu_stall_i & cpu_stb_i;
112
 
113
 
114
 
115
always @ (posedge cpu_clk_o or posedge cpu_rst_i)
116
begin
117
  if (cpu_rst_i)
118 102 mohor
    cpu_data_o <= #1 32'h11111111;
119 101 mohor
  else if ((cpu_addr_i == 32'h32323232) & cpu_we_i & cpu_ack_o)
120 102 mohor
    cpu_data_o <= #1 cpu_data_i + 1'd1;
121 101 mohor
  else if ((cpu_addr_i == 32'h08080808) & cpu_we_i & cpu_ack_o)
122 102 mohor
    cpu_data_o <= #1 cpu_data_i + 2'd2;
123 101 mohor
end
124
 
125
 
126
 
127
 
128
endmodule
129
 

powered by: WebSVN 2.1.0

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