简体   繁体   English

CRC /奇偶校验/汉明保护16位并行总线

[英]CRC/Parity/Hamming Protect 16-bit parallel bus

I've got a Cortex-M4 based MCU linked to a FPGA via a 16-bit parallel memory bus interface. 我有一个基于Cortex-M4的MCU通过一个16位并行存储器总线接口连接到FPGA。 In essence the FPGA behaves like an external memory mapped to the memory space of the MCU: the MCU presents an address followed by either a data word (write) or reading the word presented by the FPGA (read). 本质上,FPGA的行为类似于映射到MCU存储空间的外部存储器:MCU提供一个地址,后跟数据字(写入)或读取FPGA提供的字(读取)。

I want to protect both read and write against transmission errors both during addressing and data write/read. 我想在寻址和数据写/读期间保护读和写传输错误。 However, I don't expect many bit errors since the distance between both parts is short. 但是,由于两个部件之间的距离很短,我不希望发生很多误码。

I can easily implement checking and generating of either parity, hamming codes or CRC inside the FPGA. 我可以轻松地在FPGA内部实现奇偶校验,汉明码或CRC的检查和生成。 However, doing the same (checking and generating) in the uC seems comparatively harder since I don't want to cripple the throughput. 然而,在uC中做同样的事情(检查和生成)似乎相对更难,因为我不想削弱吞吐量。 Without error detection, reading and writing of 16-bit words takes around 4-6 processor cycles and is thus rather fast. 在没有错误检测的情况下,读取和写入16位字需要大约4-6个处理器周期,因此相当快。 Consequently I don't want to spend hundred of cycles on protective measures. 因此,我不想在保护措施上花费数百个周期。

In the end I am looking for a moderately efficient error detection method for 16-bit data that is implemented in a uC in as few cycles as possible. 最后,我正在寻找一种适用于16位数据的中等效率的错误检测方法,该方法在uC中以尽可能少的周期实现。

It's (in my experience) quite rare to protect a parallel bus like this. (根据我的经验)很难保护像这样的并行总线。 It's of course done in PC and server class hardware with ECC RAM and so on, but rarely in microcontrollers. 它当然是在带有ECC RAM等的PC和服务器级硬件中完成的,但很少在微控制器中完成。

If your particular Cortex-M4 implementation has a hardware CRC block, you might be able to stream the data there, assuming you can simply add a word of CRC to the end of each bus transfer. 如果您的特定Cortex-M4实现具有硬件CRC块,您可能能够在那里传输数据,假设您可以在每次总线传输结束时简单地添加CRC字。 That would probably still slow it down by at least a factor of 2-3 though, since each word coming to/from the FPGA must also be fed in software to the CRC unit. 这可能仍然会使其降低至少2-3倍,因为每个进出FPGA的字也必须以软件的形式馈送到CRC单元。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM