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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [sdram_test_working/] [rtl/] [verilog/] [dbg_crc8_d1.v] - Blame information for rev 158

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  dbg_crc8_d1 crc1.v                                          ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the SoC/OpenRISC Development Interface ////
7
////  http://www.opencores.org/cores/DebugInterface/              ////
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) 2000,2001 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 44 mohor
// Revision 1.6  2002/04/09 14:19:22  mohor
49
// Function changed to logic because of some synthesis warnings.
50
//
51 41 mohor
// Revision 1.5  2001/12/06 10:01:57  mohor
52
// Warnings from synthesys tools fixed.
53
//
54 26 mohor
// Revision 1.4  2001/11/26 10:47:09  mohor
55
// Crc generation is different for read or write commands. Small synthesys fixes.
56
//
57 20 mohor
// Revision 1.3  2001/10/19 11:40:02  mohor
58
// dbg_timescale.v changed to timescale.v This is done for the simulation of
59
// few different cores in a single project.
60
//
61 17 mohor
// Revision 1.2  2001/09/20 10:11:25  mohor
62
// Working version. Few bugs fixed, comments added.
63
//
64 9 mohor
// Revision 1.1.1.1  2001/09/13 13:49:19  mohor
65
// Initial official release.
66
//
67 2 mohor
// Revision 1.3  2001/06/01 22:22:36  mohor
68
// This is a backup. It is not a fully working version. Not for use, yet.
69
//
70
// Revision 1.2  2001/05/18 13:10:00  mohor
71
// Headers changed. All additional information is now avaliable in the README.txt file.
72
//
73
// Revision 1.1.1.1  2001/05/18 06:35:03  mohor
74
// Initial release
75
//
76
//
77
///////////////////////////////////////////////////////////////////////
78
// File:  CRC8_D1.v
79
// Date:  Fri Apr 27 20:56:55 2001
80
//
81
// Copyright (C) 1999 Easics NV.
82
// This source file may be used and distributed without restriction
83
// provided that this copyright statement is not removed from the file
84
// and that any derivative work contains the original copyright notice
85
// and the associated disclaimer.
86
//
87
// THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS
88
// OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
89
// WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
90
//
91
// Purpose: Verilog module containing a synthesizable CRC function
92
//   * polynomial: (0 1 2 8)
93
//   * data width: 1
94
//
95
// Info: jand@easics.be (Jan Decaluwe)
96
//       http://www.easics.com
97
///////////////////////////////////////////////////////////////////////
98
 
99 20 mohor
// synopsys translate_off
100 17 mohor
`include "timescale.v"
101 20 mohor
// synopsys translate_on
102 2 mohor
`include "dbg_defines.v"
103
 
104
 
105 44 mohor
module dbg_crc8_d1 (data, enable_crc, reset, sync_rst_crc, crc_out, clk);
106 2 mohor
 
107
parameter Tp = 1;
108
 
109
 
110 44 mohor
input data;
111
input enable_crc;
112
input reset;
113
input sync_rst_crc;
114
input clk;
115 2 mohor
 
116
 
117 44 mohor
output [7:0] crc_out;
118
reg    [7:0] crc_out;
119 2 mohor
 
120 41 mohor
wire [7:0] NewCRC;
121 2 mohor
 
122 44 mohor
assign NewCRC[0] = data ^ crc_out[7];
123
assign NewCRC[1] = data ^ crc_out[0] ^ crc_out[7];
124
assign NewCRC[2] = data ^ crc_out[1] ^ crc_out[7];
125
assign NewCRC[3] = crc_out[2];
126
assign NewCRC[4] = crc_out[3];
127
assign NewCRC[5] = crc_out[4];
128
assign NewCRC[6] = crc_out[5];
129
assign NewCRC[7] = crc_out[6];
130 2 mohor
 
131
 
132 26 mohor
 
133 44 mohor
always @ (posedge clk or posedge reset)
134 26 mohor
begin
135 44 mohor
  if(reset)
136
    crc_out[7:0] <= #Tp 0;
137 26 mohor
  else
138 44 mohor
  if(sync_rst_crc)
139
    crc_out[7:0] <= #Tp 0;
140 26 mohor
  else
141 44 mohor
  if(enable_crc)
142
    crc_out[7:0] <= #Tp NewCRC;
143 26 mohor
end
144
 
145
 
146
 
147 2 mohor
endmodule

powered by: WebSVN 2.1.0

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