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 20

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

powered by: WebSVN 2.1.0

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