当前位置:   article > 正文

fpga控制dsp6657上电启动配置

fpga控制dsp6657上电启动配置

1 Verilog代码

 dspboot_config.v

  1. `timescale 1ns / 1ps
  2. //dsp上电启动配置
  3. module dspboot_config (
  4. ///时钟和复位
  5. input SYS_CLK_50MHz,
  6. input SYS_RST_n,
  7. //DSP启动配置
  8. output DSP_POR,
  9. output DSP_RESETFULL,
  10. output DSP_RESET,
  11. inout [12:0] DSP_BOOTMODE,
  12. inout DSP_LENDIAN
  13. );
  14. wire sys_reset_n;
  15. reg [27:0] delay_counter;
  16. reg [1:0] counter;
  17. reg clk_25m;
  18. reg dsp_boot_en;
  19. reg DSP_PRO_reg;
  20. reg DSP_RESETFULL_reg;
  21. assign sys_reset_n = SYS_RST_n;
  22. assign DSP_RESET = SYS_RST_n; //DSP复位接口
  23. assign DSP_LENDIAN = dsp_boot_en ? 1'b1 : 1'bz; //决定DSP的大小端,1工作在小端模式,0工作在大端模式
  24. //assign DSP_BOOTMODE = dsp_boot_en ? 13'b0110000000000 : 13'hz;//决定DSP的启动模式
  25. assign DSP_BOOTMODE = dsp_boot_en ? 13'b0000000000000 : 13'hz; //noboot模式(调试模式)
  26. assign DSP_POR = DSP_PRO_reg;
  27. assign DSP_RESETFULL = DSP_RESETFULL_reg;
  28. always @(posedge SYS_CLK_50MHz or negedge sys_reset_n) begin
  29. if (!sys_reset_n) begin
  30. clk_25m <= 0;
  31. counter <= 0;
  32. end else if (counter == 1) begin
  33. clk_25m <= ~clk_25m; //生成25Mhz时钟
  34. counter <= 0;
  35. end else begin
  36. counter <= counter + 1;
  37. end
  38. end
  39. always @(posedge clk_25m or negedge sys_reset_n)
  40. if (!sys_reset_n) begin
  41. delay_counter <= 28'h0;
  42. end else if (delay_counter <= 2000000) begin
  43. delay_counter <= delay_counter + 28'h1;
  44. end else begin
  45. delay_counter <= delay_counter;
  46. end
  47. always @(posedge clk_25m or negedge sys_reset_n)
  48. if (!sys_reset_n) begin
  49. DSP_PRO_reg <= 1'b0;
  50. end else if (delay_counter == 1565500) begin
  51. DSP_PRO_reg <= 1'b1;
  52. end else begin
  53. DSP_PRO_reg <= DSP_PRO_reg;
  54. end
  55. always @(posedge clk_25m or negedge sys_reset_n)
  56. if (!sys_reset_n) begin
  57. DSP_RESETFULL_reg <= 1'b0;
  58. end else if (delay_counter == 1631000) begin
  59. DSP_RESETFULL_reg <= 1'b1;
  60. end else begin
  61. DSP_RESETFULL_reg <= DSP_RESETFULL_reg;
  62. end
  63. always @(posedge clk_25m or negedge sys_reset_n)
  64. if (!sys_reset_n) begin
  65. dsp_boot_en <= 1'b0;
  66. end else if ((delay_counter > 1620000) & (delay_counter < 1640000)) begin
  67. dsp_boot_en <= 1'b1;
  68. end else begin
  69. dsp_boot_en <= 1'b0;
  70. end
  71. endmodule

2 引脚约束(v5)

pin.ucf 

  1. NET "SYS_CLK_50MHz" LOC = AM16;
  2. NET "SYS_CLK_50MHz" PERIOD = 20 ns HIGH 50 %;
  3. NET "SYS_RST_n" LOC = AH34;
  4. NET "DSP_POR" LOC = H9;
  5. NET "DSP_LENDIAN" LOC = E8;
  6. NET "DSP_RESET" LOC = AG7;
  7. NET "DSP_RESETFULL" LOC = K7;
  8. NET "DSP_BOOTMODE[0]" LOC = F9;
  9. NET "DSP_BOOTMODE[1]" LOC = E9;
  10. NET "DSP_BOOTMODE[2]" LOC = D7;
  11. NET "DSP_BOOTMODE[3]" LOC = L5;
  12. NET "DSP_BOOTMODE[4]" LOC = E7;
  13. NET "DSP_BOOTMODE[5]" LOC = K4;
  14. NET "DSP_BOOTMODE[6]" LOC = K5;
  15. NET "DSP_BOOTMODE[7]" LOC = F6;
  16. NET "DSP_BOOTMODE[8]" LOC = F7;
  17. NET "DSP_BOOTMODE[9]" LOC = E5;
  18. NET "DSP_BOOTMODE[10]" LOC = H5;
  19. NET "DSP_BOOTMODE[11]" LOC = J5;
  20. NET "DSP_BOOTMODE[12]" LOC = F5;

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

闽ICP备14008679号