1 |
8 |
mohor |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// can_testbench_defines.v ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// ////
|
6 |
9 |
mohor |
//// This file is part of the CAN Protocol Controller ////
|
7 |
8 |
mohor |
//// http://www.opencores.org/projects/can/ ////
|
8 |
|
|
//// ////
|
9 |
|
|
//// ////
|
10 |
|
|
//// Author(s): ////
|
11 |
|
|
//// Igor Mohor ////
|
12 |
|
|
//// igorm@opencores.org ////
|
13 |
|
|
//// ////
|
14 |
|
|
//// ////
|
15 |
9 |
mohor |
//// All additional information is available in the README.txt ////
|
16 |
8 |
mohor |
//// file. ////
|
17 |
|
|
//// ////
|
18 |
|
|
//////////////////////////////////////////////////////////////////////
|
19 |
|
|
//// ////
|
20 |
9 |
mohor |
//// Copyright (C) 2002, 2003 Authors ////
|
21 |
8 |
mohor |
//// ////
|
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 |
28 |
mohor |
//// The CAN protocol is developed by Robert Bosch GmbH and ////
|
44 |
|
|
//// protected by patents. Anybody who wants to implement this ////
|
45 |
|
|
//// CAN IP core on silicon has to obtain a CAN protocol license ////
|
46 |
|
|
//// from Bosch. ////
|
47 |
|
|
//// ////
|
48 |
8 |
mohor |
//////////////////////////////////////////////////////////////////////
|
49 |
|
|
//
|
50 |
|
|
// CVS Revision History
|
51 |
|
|
//
|
52 |
|
|
// $Log: not supported by cvs2svn $
|
53 |
160 |
igorm |
// Revision 1.9 2003/09/30 20:53:58 mohor
|
54 |
|
|
// Fixing the core to be Bosch VHDL Reference compatible.
|
55 |
|
|
//
|
56 |
127 |
mohor |
// Revision 1.8 2003/02/18 00:17:44 mohor
|
57 |
|
|
// Define CAN_CLOCK_DIVIDER_MODE not used any more. Deleted.
|
58 |
|
|
//
|
59 |
37 |
mohor |
// Revision 1.7 2003/02/09 02:24:11 mohor
|
60 |
|
|
// Bosch license warning added. Error counters finished. Overload frames
|
61 |
|
|
// still need to be fixed.
|
62 |
|
|
//
|
63 |
28 |
mohor |
// Revision 1.6 2003/01/14 12:19:29 mohor
|
64 |
|
|
// rx_fifo is now working.
|
65 |
|
|
//
|
66 |
16 |
mohor |
// Revision 1.5 2003/01/09 14:46:52 mohor
|
67 |
|
|
// Temporary files (backup).
|
68 |
|
|
//
|
69 |
13 |
mohor |
// Revision 1.4 2003/01/08 02:09:44 mohor
|
70 |
|
|
// Acceptance filter added.
|
71 |
|
|
//
|
72 |
11 |
mohor |
// Revision 1.3 2002/12/28 04:13:53 mohor
|
73 |
|
|
// Backup version.
|
74 |
|
|
//
|
75 |
10 |
mohor |
// Revision 1.2 2002/12/27 00:12:48 mohor
|
76 |
|
|
// Header changed, testbench improved to send a frame (crc still missing).
|
77 |
|
|
//
|
78 |
9 |
mohor |
// Revision 1.1 2002/12/26 16:00:29 mohor
|
79 |
|
|
// Testbench define file added. Clock divider register added.
|
80 |
8 |
mohor |
//
|
81 |
|
|
//
|
82 |
|
|
//
|
83 |
9 |
mohor |
//
|
84 |
8 |
mohor |
|
85 |
16 |
mohor |
/* Mode register */
|
86 |
|
|
`define CAN_MODE_RESET 1'h1 /* Reset mode */
|
87 |
10 |
mohor |
|
88 |
16 |
mohor |
/* Bit Timing 0 register value */
|
89 |
160 |
igorm |
//`define CAN_TIMING0_BRP 6'h0 /* Baud rate prescaler (2*(value+1)) */
|
90 |
|
|
//`define CAN_TIMING0_SJW 2'h2 /* SJW (value+1) */
|
91 |
8 |
mohor |
|
92 |
160 |
igorm |
`define CAN_TIMING0_BRP 6'h3 /* Baud rate prescaler (2*(value+1)) */
|
93 |
|
|
`define CAN_TIMING0_SJW 2'h1 /* SJW (value+1) */
|
94 |
|
|
|
95 |
16 |
mohor |
/* Bit Timing 1 register value */
|
96 |
160 |
igorm |
//`define CAN_TIMING1_TSEG1 4'h4 /* TSEG1 segment (value+1) */
|
97 |
|
|
//`define CAN_TIMING1_TSEG2 3'h3 /* TSEG2 segment (value+1) */
|
98 |
|
|
//`define CAN_TIMING1_SAM 1'h0 /* Triple sampling */
|
99 |
|
|
|
100 |
|
|
`define CAN_TIMING1_TSEG1 4'hf /* TSEG1 segment (value+1) */
|
101 |
|
|
`define CAN_TIMING1_TSEG2 3'h2 /* TSEG2 segment (value+1) */
|
102 |
16 |
mohor |
`define CAN_TIMING1_SAM 1'h0 /* Triple sampling */
|
103 |
8 |
mohor |
|
104 |
16 |
mohor |
|