Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
parallel CRC and ragged words
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matt  
View profile  
 More options Feb 8, 5:09 pm
Newsgroups: comp.lang.vhdl, comp.lang.verilog
Followup-To: comp.lang.vhdl
From: Matt <maplant...@gmail.com>
Date: Wed, 8 Feb 2012 14:09:40 -0800 (PST)
Local: Wed, Feb 8 2012 5:09 pm
Subject: parallel CRC and ragged words
I've been looking over the following post concerning parallel crc
computation and how to handle a multi-byte parallel bus where the data
can end in any 8b position:
http://groups.google.com/group/comp.lang.vhdl/browse_frm/thread/587b1...

All of the identities Allan calls out make perfect sense, except when
I try
#5.) If the CRC register is initialised to zero,
CRC(A & B) = CRC(CRC(A) & B))

If I use some some test code, and the easics crc generator (http://
www.easics.com/webtools/crctool) :

reg [31:0]a = 32'haaaaaaaa;
reg [31:0]b = 32'hbbbbbbbb;

        @(posedge clk)  crca = nextCRC32_D64({{32{1'b0}},a}, {32{1'b0}});
        @(posedge clk)  crcab = nextCRC32_D64({a,b}, {32{1'b0}});
        @(posedge clk)  crcab2 = nextCRC32_D64({crca,b}, {32{1'b0}});

where nextCRC32_D64 is the easics CRC function, arguments are (data,
lfsr state)

I do not get CRC({A,  B}) = CRC({CRC(A) , B}))

I'm replacing the &'s with {}'s, since this originally came from a
vhdl group, and I'm assuming he's referring to the vhdl concat
operator.

What I actually get is
CRC(A) = 85f89652
CRC({a,b}) = 8a0c00ba
CRC({CRC(A),b} = cae34aea

I'm sure I must have missed something along the way, but I don't know
what it is.

Any help or direction you could provide would be greatly appreciated.

Thank you


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Allan Herriman  
View profile  
 More options Feb 9, 5:30 am
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: Allan Herriman <allanherri...@hotmail.com>
Date: 09 Feb 2012 10:30:19 GMT
Local: Thurs, Feb 9 2012 5:30 am
Subject: Re: parallel CRC and ragged words

On Wed, 08 Feb 2012 14:09:40 -0800, Matt wrote:
> I've been looking over the following post concerning parallel crc
> computation and how to handle a multi-byte parallel bus where the data
> can end in any 8b position:
> http://groups.google.com/group/comp.lang.vhdl/browse_frm/

thread/587b14d0fc43dbc1

The answer to your question is that the statement #5 I made isn't
actually correct (which is another way of saying that it is wrong).

It's *almost* right, but there's something wrong in the detail.  I didn't
discover this until a co-worker tried to implement a wide CRC following
those guidelines and came unstuck, just as you did.

In hand-waving terms, statement #5 says that you can break up the
calculation into two parts, which really helps at the end of a packet.

I'll look up some actual code (that works) to see if I can find the error.

Regards,
Allan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Allan Herriman  
View profile  
 More options Feb 9, 6:34 am
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: Allan Herriman <allanherri...@hotmail.com>
Date: 09 Feb 2012 11:34:10 GMT
Local: Thurs, Feb 9 2012 6:34 am
Subject: Re: parallel CRC and ragged words

Got it.

Here's what I originally posted:

#5.) If the CRC register is initialised to zero,
     CRC(A & B) = CRC(CRC(A) & B))

I'm inserting CRC(A) 32 bits too soon.  Gah!

Instead of "CRC(A) & B" it really should say that the CRC(A) gets xored
with the first 32 bits of B, then we take the CRC of that result.

I think B might need to be at least 32 bits long, i.e. it will be the
last two words of the packet.

(Apologies to the c.l.verilog readers: ampersand (&) is the VHDL
concatenation operator.)

Regards,
Allan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Feb 9, 12:31 pm
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: Matt <maplant...@gmail.com>
Date: Thu, 9 Feb 2012 09:31:18 -0800 (PST)
Local: Thurs, Feb 9 2012 12:31 pm
Subject: Re: parallel CRC and ragged words
On Feb 9, 6:34 am, Allan Herriman <allanherri...@hotmail.com> wrote:

Hi Allan,

Thanks for the correction!  I tried your update, and was able to
generate a correct CRC on a 64b bus for a packet that ended on a 32b
boundary

i.e.

...
64'h2223242526272829;
64'h2a2b2c2d00000000; // last 32b invalid data

However I've been unable to get a correct crc for a packet ending in
any arbitrary position, like:

...
64'h2a2b2c2d2e2f3031;
64'h3200000000000000; // last 56b invalid data

xor'ing the previous crc with the last32b (if you pull from the
previous word, so 32'h2f303132) doesn't work; nor does it work if you
try to xor an 8b chunk of the previous crc with the remaining valid 8b
of data (if proceeded by 0's and the last crc is initialized to 0's).

Is there something else I should be doing?

Thanks for your help,

-- Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Allan Herriman  
View profile  
 More options Feb 9, 5:05 pm
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: Allan Herriman <allanherri...@hotmail.com>
Date: 09 Feb 2012 22:05:13 GMT
Local: Thurs, Feb 9 2012 5:05 pm
Subject: Re: parallel CRC and ragged words

I think it's meant to work like this:

64'h1a1b1c1d1e1f2021;
64'h2223242526272829;   // end of 'A'
---------------------
64'h2a2b2c2d2e2f3031;   // start of 'B'
64'h3200000000000000;   // last 56b invalid data

Lets assume that the CRC register was FFFF after the 'A' calculation.
Take that value, xor it into the start of the 'B' contents
(i.e. the 2a2b2c2d part).

This gives the following:

64'h d5d4d3d22e2f3031;   // start of 'B'
64'h 32xxxxxxxxxxxxxx;   // last 56b invalid data

Then rotate it so that the end is aligned:

64'hxxxxxxxxxxxxxxd5;
64'hd4d3d22e2f303132;

and zero out the unwanted leading octets:

64'h00000000000000d5;
64'hd4d3d22e2f303132;

Then take the CRC.

Sorry if I'm a bit rusty; I haven't done one of these at this level for
about a decade.

Regards,
Allan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt  
View profile  
 More options Feb 9, 9:37 pm
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: Matt <maplant...@gmail.com>
Date: Thu, 9 Feb 2012 18:37:14 -0800 (PST)
Local: Thurs, Feb 9 2012 9:37 pm
Subject: Re: parallel CRC and ragged words
On Feb 9, 5:05 pm, Allan Herriman <allanherri...@hotmail.com> wrote:

Allan,

I looks like that may have worked.  Thanks for all of your help!

BTW, Mark, I did grab a copy of that "Pipelined Cycle Redundancy Check
(CRC) Calculation" paper you mentioned.  Very interesting.  I'm a
little confused about where the G matrix comes from and how to
generate subsequent G^P's.  I've generated their H up to 16384 and
matched that matrix.

Cheers,

-- Matt

-- Matt


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Curry  
View profile  
 More options Feb 10, 12:02 pm
Newsgroups: comp.lang.vhdl, comp.lang.verilog
From: gtw...@sonic.net (Mark Curry)
Date: Fri, 10 Feb 2012 17:02:07 +0000 (UTC)
Local: Fri, Feb 10 2012 12:02 pm
Subject: Re: parallel CRC and ragged words
In article <a9dbb914-48ad-4bcc-b2f2-589ebb28c...@o4g2000pbc.googlegroups.com>,

Matt  <maplant...@gmail.com> wrote:

>BTW, Mark, I did grab a copy of that "Pipelined Cycle Redundancy Check
>(CRC) Calculation" paper you mentioned.  Very interesting.  I'm a
>little confused about where the G matrix comes from and how to
>generate subsequent G^P's.  I've generated their H up to 16384 and
>matched that matrix.

My goals in using the paper were a little different - I didn't need
the G matrix, but looks to me it's just the inverse operation of H.
H allows you to "shift N zeros" onto the previous CRC state.
G allows you to unshift N zeros back off.  In your case, you'd use
it like - always assume you're shifting through for the full 32 bits.
But, in the case of only 1 byte of the last 4 was valid, you need
to reverse the final shift by three bytes.  The G matrix allows
that.

I imagine you calculate it like H - calculate the matrix for one
bit unshift, then raise the matrix to the power of n for the other
bits.

--Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »