2 // PCI Parity Generator.
4 // PCI Target generates PAR in the data phase of a read cycle.
5 // The 1's sum on AD, CBE and PAR is even.
7 // Date Version Author Description
8 // 2005-05-13 R00A00 PAU First alfa revision (eng)
10 // Copyright (C) 2005 Peio Azkarate, peio@opencores.org
12 // This source file is free software; you can redistribute it |
13 // and/or modify it under the terms of the GNU Lesser General |
14 // Public License as published by the Free Software Foundation; |
15 // either version 2.1 of the License, or (at your option) any |
19 module pcipargen_new (clk_i, pcidatout_i, cbe_i, parOE_i, par_o);
22 input [31:0] pcidatout_i;
34 assign d = pcidatout_i;
36 assign pardat = d[0] ^ d[1] ^ d[2] ^ d[3] ^ d[4] ^ d[5] ^ d[6] ^ d[7] ^
37 d[8] ^ d[9] ^ d[10] ^ d[11] ^ d[12] ^ d[13] ^ d[14] ^ d[15] ^
38 d[16] ^ d[17] ^ d[18] ^ d[19] ^ d[20] ^ d[21] ^ d[22] ^ d[23] ^
39 d[24] ^ d[25] ^ d[26] ^ d[27] ^ d[28] ^ d[29] ^ d[30] ^ d[31];
41 assign parcbe = cbe_i[0] ^ cbe_i[1] ^ cbe_i[2] ^ cbe_i[3];
43 assign par = pardat ^ parcbe;
46 assign par_o = ( parOE_i == 1 ) ? par_s : 1'bZ;