当前位置:   article > 正文

搭建DDR3的仿真环境_error : the port "ddr3_dq[0]" is not aligned with

error : the port "ddr3_dq[0]" is not aligned with its strobe pair "ddr3_dqs_
  1. /*****************************方式1***********************/
  2. wire [63:0] ddr3_dq;
  3. wire [7:0] ddr3_dqs_n;
  4. wire [7:0] ddr3_dqs_p;
  5. wire [14:0] ddr3_addr;
  6. wire [2:0] ddr3_ba;
  7. wire ddr3_ras_n;
  8. wire ddr3_cas_n;
  9. wire ddr3_we_n;
  10. wire ddr3_reset_n;
  11. wire [0:0] ddr3_ck_p;
  12. wire [0:0] ddr3_ck_n;
  13. wire [0:0] ddr3_cke;
  14. wire [0:0] ddr3_cs_n;
  15. wire [7:0] ddr3_dm;
  16. wire [0:0] ddr3_odt;
  17. ddr3_model u_ddr3_model_0(
  18. .rst_n (sys_rst),
  19. .ck (ddr3_ck_p),
  20. .ck_n (ddr3_ck_n),
  21. .cke (ddr3_cke),
  22. .cs_n (ddr3_cs_n),
  23. .ras_n (ddr3_ras_n),
  24. .cas_n (ddr3_cas_n),
  25. .we_n (ddr3_we_n),
  26. .dm_tdqs(ddr3_dm[1:0]),
  27. .ba (ddr3_ba),
  28. .addr (ddr3_addr),
  29. .dq (ddr3_dq[15:0]),
  30. .dqs (ddr3_dqs_p[1:0]),
  31. .dqs_n (ddr3_dqs_n[1:0]),
  32. .tdqs_n (),
  33. .odt (ddr3_odt)
  34. );
  35. ddr3_model u_ddr3_model_1(
  36. .rst_n (sys_rst),
  37. .ck (ddr3_ck_p),
  38. .ck_n (ddr3_ck_n),
  39. .cke (ddr3_cke),
  40. .cs_n (ddr3_cs_n),
  41. .ras_n (ddr3_ras_n),
  42. .cas_n (ddr3_cas_n),
  43. .we_n (ddr3_we_n),
  44. .dm_tdqs(ddr3_dm[3:2]),
  45. .ba (ddr3_ba),
  46. .addr (ddr3_addr),
  47. .dq (ddr3_dq[31:16]),
  48. .dqs (ddr3_dqs_p[3:2]),
  49. .dqs_n (ddr3_dqs_n[3:2]),
  50. .tdqs_n (),
  51. .odt (ddr3_odt)
  52. );
  53. ddr3_model u_ddr3_model_2(
  54. .rst_n (sys_rst),
  55. .ck (ddr3_ck_p),
  56. .ck_n (ddr3_ck_n),
  57. .cke (ddr3_cke),
  58. .cs_n (ddr3_cs_n),
  59. .ras_n (ddr3_ras_n),
  60. .cas_n (ddr3_cas_n),
  61. .we_n (ddr3_we_n),
  62. .dm_tdqs(ddr3_dm[5:4]),
  63. .ba (ddr3_ba),
  64. .addr (ddr3_addr),
  65. .dq (ddr3_dq[47:32]),
  66. .dqs (ddr3_dqs_p[5:4]),
  67. .dqs_n (ddr3_dqs_n[5:4]),
  68. .tdqs_n (),
  69. .odt (ddr3_odt)
  70. );
  71. ddr3_model u_ddr3_model_3(
  72. .rst_n (sys_rst),
  73. .ck (ddr3_ck_p),
  74. .ck_n (ddr3_ck_n),
  75. .cke (ddr3_cke),
  76. .cs_n (ddr3_cs_n),
  77. .ras_n (ddr3_ras_n),
  78. .cas_n (ddr3_cas_n),
  79. .we_n (ddr3_we_n),
  80. .dm_tdqs(ddr3_dm[7:6]),
  81. .ba (ddr3_ba),
  82. .addr (ddr3_addr),
  83. .dq (ddr3_dq[63:48]),
  84. .dqs (ddr3_dqs_p[7:6]),
  85. .dqs_n (ddr3_dqs_n[7:6]),
  86. .tdqs_n (),
  87. .odt (ddr3_odt)
  88. );
  89. /***************************方式2*********************/
  90. wire [63:0] ddr3_dq;
  91. wire [7:0] ddr3_dqs_n;
  92. wire [7:0] ddr3_dqs_p;
  93. wire [14:0] ddr3_addr;
  94. wire [2:0] ddr3_ba;
  95. wire ddr3_ras_n;
  96. wire ddr3_cas_n;
  97. wire ddr3_we_n;
  98. wire ddr3_reset_n;
  99. wire [0:0] ddr3_ck_p;
  100. wire [0:0] ddr3_ck_n;
  101. wire [0:0] ddr3_cke;
  102. wire [0:0] ddr3_cs_n;
  103. wire [7:0] ddr3_dm;
  104. wire [0:0] ddr3_odt;
  105. genvar i;
  106. generate
  107. for (i=0;i<4;i=i+1) begin : gen_mem_0
  108. ddr3_model u_ddr3_model_1
  109. (
  110. .rst_n(sys_rst_n),
  111. .ck(ddr3_ck_p_0),
  112. .ck_n(ddr3_ck_n_0),
  113. .cke(ddr3_cke_0),
  114. .cs_n(ddr3_cs_n_0),
  115. .ras_n(ddr3_ras_n_0),
  116. .we_n(ddr3_we_n_0),
  117. .cas_n (ddr3_cas_n_0),
  118. .dm_tdqs (ddr3_dm_0[(2*(i+1)-1):(2*i)]),
  119. .ba (ddr3_ba_0),
  120. .addr (ddr3_addr_0),
  121. .dq (ddr3_dq_0[16*(i+1)-1:16*(i)]),
  122. .dqs (ddr3_dqs_p_0[(2*(i+1)-1):(2*i)]),
  123. .dqs_n (ddr3_dqs_n_0[(2*(i+1)-1):(2*i)]),
  124. .tdqs_n (),
  125. .odt (ddr3_odt_0)
  126. );
  127. end
  128. endgenerate

此代码是仿真64位宽DDR的必要代码,在自己的仿真文件中加入进去即可

ddr3_model的位宽默认是16位的,可以例化多个来实现64位操作,仿真时只需要添加ddr3_model_parameters.v和ddr3_model.v即可,这两个文件在example design中可以找到,如果想仿真更多的地址,需要将ddr3_model_parameters.v中的MEM_BITS(默认为10)改大,2^MEM_BITS个地址

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

闽ICP备14008679号