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

Subversion Repositories can

[/] [can/] [tags/] [initial/] [rtl/] [verilog/] [can_top.v] - Blame information for rev 3

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

Line No. Rev Author Line
1 2 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  can_top.v                                                   ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the CAN Protocal Controller            ////
7
////  http://www.opencores.org/projects/can/                      ////
8
////                                                              ////
9
////                                                              ////
10
////  Author(s):                                                  ////
11
////       Igor Mohor                                             ////
12
////       igorm@opencores.org                                    ////
13
////                                                              ////
14
////                                                              ////
15
////  All additional information is avaliable in the README.txt   ////
16
////  file.                                                       ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2002 Authors                                   ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
//
49
//
50
 
51
// synopsys translate_off
52
`include "timescale.v"
53
// synopsys translate_on
54
`include "can_defines.v"
55
 
56
module can_top
57
(
58
  clk,
59
  rst,
60
  data_in,
61
  data_out,
62
  cs, rw, addr,
63
  rx,
64
  idle    /* REMOVE and use correct "idle state" signal instead */
65
);
66
 
67
parameter Tp = 1;
68
 
69
input        clk;
70
input        rst;
71
input  [7:0] data_in;
72
output [7:0] data_out;
73
input        cs, rw;
74
input  [7:0] addr;
75
input        rx;
76
input        idle;   /* REMOVE and use correct "idle state" signal instead */
77
 
78
 
79
/* Mode register */
80
wire         reset_mode;
81
wire         listen_only_mode;
82
wire         acceptance_filter_mode;
83
wire         sleep_mode;
84
 
85
/* Bus Timing 0 register */
86
wire    [5:0] baud_r_presc;
87
wire    [1:0] sync_jump_width;
88
 
89
/* Bus Timing 1 register */
90
wire    [3:0] time_segment1;
91
wire    [2:0] time_segment2;
92
wire          triple_sampling;
93
 
94
 
95
 
96
 
97
 
98
/* Connecting can_registers module */
99
can_registers i_can_registers
100
(
101
  .clk(clk),
102
  .rst(rst),
103
  .cs(cs),
104
  .rw(rw),
105
  .addr(addr),
106
  .data_in(data_in),
107
  .data_out(data_out),
108
 
109
  /* Mode register */
110
  .reset_mode(reset_mode),
111
  .listen_only_mode(listen_only_mode),
112
  .acceptance_filter_mode(acceptance_filter_mode),
113
  .sleep_mode(sleep_mode),
114
 
115
  /* Bus Timing 0 register */
116
  .baud_r_presc(baud_r_presc),
117
  .sync_jump_width(sync_jump_width),
118
 
119
  /* Bus Timing 1 register */
120
  .time_segment1(time_segment1),
121
  .time_segment2(time_segment2),
122
  .triple_sampling(triple_sampling)
123
 
124
);
125
 
126
 
127
/* Output signals from can_btl module */
128
wire        take_sample;
129
wire        clk_en;
130
 
131
/* output signals from can_bsp (bit stream processor) module */
132
wire sync_mode;
133
 
134
 
135
 
136
/* Connecting can_btl module */
137
can_btl i_can_btl
138
(
139
  .clk(clk),
140
  .rst(rst),
141
  .rx(rx),
142
 
143
  /* Mode register */
144
  .reset_mode(reset_mode),
145
 
146
  /* Bus Timing 0 register */
147
  .baud_r_presc(baud_r_presc),
148
  .sync_jump_width(sync_jump_width),
149
 
150
  /* Bus Timing 1 register */
151
  .time_segment1(time_segment1),
152
  .time_segment2(time_segment2),
153
  .triple_sampling(triple_sampling),
154
 
155
  /* Output signals from this module */
156
  .take_sample(take_sample),
157
  .clk_en(clk_en),
158
 
159
  /* States */
160
  .idle(idle),
161
 
162
  /* bit stream processor (can_bsp.v) */
163
  .sync_mode(sync_mode)
164
 
165
 
166
);
167
 
168
 
169
 
170
can_bsp i_can_bsp
171
(
172
  .clk(clk),
173
  .rst(rst),
174
  .sync_mode(sync_mode)
175
 
176
);
177
 
178
 
179
 
180
 
181
endmodule

powered by: WebSVN 2.1.0

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