We use seed as all F's when we calculate CRC. I have to work on a large data; which is broken down into slabs and fed to the CRC engine to calculate the CRC of that particular slab. Now this CRC needs to be used as a seed for the next slab of data. How can this be implemented?
My data slabs are 256 bits each. And the CRC is a 32 bit CRC. I have an online generated code. I just need to know how to use the CRC generated as the seed for the next slab of data.
I am pasting a part of the code. How the CRC is calculated is not important here as its available online.
You should just feed more data into the crc module.
Apply the new data and crc_en='1' for one clock cycle.
Do you really need to process 256 input bits per clock cycle?
You will get the same result with a crc calculator that takes the input in multiple clock cycles.
You'll achieve what you've asked in your post if you do what comment # 2 says, but you'll probably also need to implement some logic to check if the last slab of data has been received and then reset your lfsr_q register.
You should just feed more data into the crc module.
Apply the new data and crc_en='1' for one clock cycle.
Do you really need to process 256 input bits per clock cycle?
You will get the same result with a crc calculator that takes the input in multiple clock cycles.
Yes, my data bus is 256 bits. So i can only process 256 bits at a time. I need to do this over several iterations and keep using the previous CRC as the new seed. I dont think I will need any logic to check if last data was received because a CRC module that takes 256 bits as input will produce the CRC for that data in one clock cycle. I just need some logic that will work on clock and take the CRC from the previous clock cycle as the new seed.
Or do the codes found on online generators take care of this already?
You do understand that a CRC has a feedback that uses whatever is already there to compute the next CRC of the input data. This is why you have to INITIALIZE the CRC to all 1's normally at the start of a CRC calculation. If you are chaining the CRC between blocks then you don't reset anything just keep using the CRC value left from the last CRC calculation. Just make sure the CRC isn't clocked if you don't have input data and are just looking at the result.