当前位置:   article > 正文

获取FPGA芯片序号_dna_porte2

dna_porte2

往往可以通过获取xilinx芯片的DNA,然后再进一步加密运算,就可以实现代码的加密。具体获取DNA的代码如下所示:

  1. module dna_read(
  2. input sys_clk,
  3. input rst_n,
  4. output [95:0] dna_read_data,
  5. output dna_read_vld
  6. );
  7. wire dna_dout;
  8. wire dna_read;
  9. wire dna_shift;
  10. DNA_PORTE2 #(
  11. .SIM_DNA_VALUE(96'h0)
  12. )
  13. DNA_PORTE2_inst (
  14. .DOUT(dna_dout),
  15. .CLK(sys_clk),
  16. .DIN(dna_dout),
  17. .READ(dna_read),
  18. .SHIFT(dna_shift)
  19. );
  20. reg [95:0] dna_reg = 0;
  21. reg [7:0] dna_cnt = 0;
  22. always@(posedge sys_clk or negedge rst_n)
  23. begin
  24. if(!rst_n)
  25. dna_cnt <= 0;
  26. else
  27. dna_cnt <= dna_cnt+1;
  28. end
  29. assign dna_read =(dna_cnt==8'd63)?1'b1:1'b0;
  30. assign dna_shift =((dna_cnt>=8'd100)&&(dna_cnt<=8'd195))?1'b1:1'b0;
  31. always@(posedge sys_clk or negedge rst_n)
  32. begin
  33. if(!rst_n)
  34. dna_reg <= 0;
  35. else
  36. dna_reg <= {dna_dout,dna_reg[95:1]};
  37. end
  38. assign dna_read_data =dna_reg;
  39. assign dna_read_vld =(dna_cnt==8'd196)?1'b1:1'b0;

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/494237
推荐阅读
相关标签
  

闽ICP备14008679号