Forum Discussion
Altera_Forum
Honored Contributor
16 years agoYes, it was sadly lost. It was great information.
If found this. In general, you can use a compiler directive like this: __attribute__ ((section (".ssram"))); after your function name. You use a similar __attribute__ directive after data variable declarations to put them in an alternate data section. However, I believe the guy used a custom linker script, and explicitly placed the names of the object files that needed to be located into a fast memory section there. I am by no means remotely familiar with linker scripts, so you are on your own for this subject. As far as the hardware CRC checksum, I would be surprised if Altera's TSE does not already do this and tack it on at the end of the packet being sent automatically. Likewise, calculated on the fly when receiving a packet for packet integrity validation. It would have been relatively simple to have incorporated it into the IP. You'd have to check the software driver implementation to verify if it calculates the CRC with software or not. If not, you'd generally have to make an avalon memory mapped slave with addresses for writing which would a) initialize the CRC, and b) calculate a new CRC with data written, and one read address to read the final calculated CRC value. The new 32 bit CRC value can be calculated with a new 32 bit data input in 1 clock cycle using combinational xor logic, so the IP can execute with zero waitstates. Sorry, I can't go into details of writing such a module--too much explaning. If I recall correctly (this may be wrong), the CRC value is complemented when sending it out for ethernet. You need to run some experiments to verify the output of your hardware CRC IP matches the output of the software calculated one. And of course, you have to modify the TSE driver to use your CRC IP to calculate it. However, here is a great link to generate the combinational logic code in Verilog for any CRC data width, polynomial expression, and arbitrary input data width. http://outputlogic.com/ Click on CRC generator. Wikipedia has the polynomial expression for many standards including ethernet. Search for CRC.