[独创算法] HotCRC CRC64R_D800000000000000_0000000000000000_0000000000000000 FPGA模块 HotPower@163.com(菜农独创)

[复制链接]
 楼主| hotpower 发表于 2023-9-21 12:11 | 显示全部楼层 |阅读模式
  1. /*-----------------------------------------------------------------------------------------------
  2.       HotCRC CRC64R_D800000000000000_0000000000000000_0000000000000000 FPGA模块 HotPower[url=home.php?mod=space&uid=516618]@163.com[/url] 2023-09-21 12:10:15
  3. -----------------------------------------------------------------------------------------------*/
  4. module CRC64R_D800000000000000(clk, rst, data, outcrc64)
  5. input clk, rst;
  6. input [7:0] data;
  7. output reg[63:0] outcrc64;
  8. reg [63:0] crc64;

  9. task CRC64R_D800000000000000;
  10. inout[63:0] crc64;
  11. input[7:0] indata;
  12.     crc64 = crc64[63:8] ^ CRC64R_D800000000000000_Table(crc64[7:0] ^ indata);
  13. endtask

  14. function [63:0] CRC64R_D800000000000000_Table;
  15.     input [7:0] data;
  16.     CRC64R_D800000000000000_Table = CRC64R_D800000000000000_Table0(data[1:0]) ^ CRC64R_D800000000000000_Table1(data[3:2]) ^ CRC64R_D800000000000000_Table2(data[5:4]) ^ CRC64R_D800000000000000_Table3(data[7:6]);
  17. endfunction

  18. function [63:0] CRC64R_D800000000000000_Table0;
  19.     input[1:0] data;
  20.     case(data)
  21.         2'b00: CRC64R_D800000000000000_Table0 = 64'h0000000000000000; 2'b01: CRC64R_D800000000000000_Table0 = 64'h01B0000000000000; 2'b10: CRC64R_D800000000000000_Table0 = 64'h0360000000000000; 2'b11: CRC64R_D800000000000000_Table0 = 64'h02D0000000000000;
  22.         default: CRC64R_D800000000000000_Table0 = 64'h0000_0000_0000_0000_0000_0000_0000_0000;
  23.     endcase
  24. endfunction

  25. function [63:0] CRC64R_D800000000000000_Table1;
  26.     input[1:0] data;
  27.     case(data)
  28.         2'b00: CRC64R_D800000000000000_Table1 = 64'h0000000000000000; 2'b01: CRC64R_D800000000000000_Table1 = 64'h06C0000000000000; 2'b10: CRC64R_D800000000000000_Table1 = 64'h0D80000000000000; 2'b11: CRC64R_D800000000000000_Table1 = 64'h0B40000000000000;
  29.         default: CRC64R_D800000000000000_Table1 = 64'h0000_0000_0000_0000_0000_0000_0000_0000;
  30.     endcase
  31. endfunction

  32. function [63:0] CRC64R_D800000000000000_Table2;
  33.     input[1:0] data;
  34.     case(data)
  35.         2'b00: CRC64R_D800000000000000_Table2 = 64'h0000000000000000; 2'b01: CRC64R_D800000000000000_Table2 = 64'h1B00000000000000; 2'b10: CRC64R_D800000000000000_Table2 = 64'h3600000000000000; 2'b11: CRC64R_D800000000000000_Table2 = 64'h2D00000000000000;
  36.         default: CRC64R_D800000000000000_Table2 = 64'h0000_0000_0000_0000_0000_0000_0000_0000;
  37.     endcase
  38. endfunction

  39. function [63:0] CRC64R_D800000000000000_Table3;
  40.     input[1:0] data;
  41.     case(data)
  42.         2'b00: CRC64R_D800000000000000_Table3 = 64'h0000000000000000; 2'b01: CRC64R_D800000000000000_Table3 = 64'h6C00000000000000; 2'b10: CRC64R_D800000000000000_Table3 = 64'hD800000000000000; 2'b11: CRC64R_D800000000000000_Table3 = 64'hB400000000000000;
  43.         default: CRC64R_D800000000000000_Table3 = 64'h0000_0000_0000_0000_0000_0000_0000_0000;
  44.     endcase
  45. endfunction


  46. always [url=home.php?mod=space&uid=72445]@[/url] (posedge clk or negedge rst)
  47. begin
  48.     if (!rst)
  49.     begin
  50.         crc64 <= 64'h0000000000000000;
  51.     end
  52.     else
  53.     begin
  54.         CRC64R_D800000000000000(crc64, data);
  55.         outcrc64 <= crc64;
  56.         crc64 <= crc64;
  57.     end
  58. end
  59. endmodule


HotCRC CRC64R_D800000000000000_0000000000000000_0000000000000000 FPGA模块 HotPow.png
微信扫码截图.jpg
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:[url=http://www.21ic.com/tools/HotWC3_V1.23.html]

1460

主题

21619

帖子

508

粉丝
快速回复 在线客服 返回列表 返回顶部
个人签名:[url=http://www.21ic.com/tools/HotWC3_V1.23.html]

1460

主题

21619

帖子

508

粉丝
快速回复 在线客服 返回列表 返回顶部