DspInterfaceTb.v 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //`timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // company:
  4. // engineer:
  5. //
  6. // create date: 16:37:06 07/11/2019
  7. // design name:
  8. // module name: dsp_linkport_interface
  9. // project name:
  10. // target devices:
  11. // tool versions:
  12. // description:
  13. //
  14. // dependencies:
  15. //
  16. // revision:
  17. // revision 0.01 - file created
  18. // additional comments:
  19. //
  20. //////////////////////////////////////////////////////////////////////////////////
  21. module DspInterfaceTb
  22. ();
  23. //================================================================================
  24. // REG/WIRE
  25. //================================================================================
  26. reg Clk_i;
  27. reg Rst_i;
  28. reg start;
  29. reg [31:0] MeasDataPattern1;
  30. reg [31:0] MeasDataPattern2;
  31. //================================================================================
  32. // ASSIGNMENTS
  33. //================================================================================
  34. //================================================================================
  35. // CODING
  36. //================================================================================
  37. always #10 Clk_i = ~Clk_i;
  38. initial begin
  39. Clk_i = 1'b1;
  40. Rst_i = 1'b1;
  41. start = 1'b0;
  42. MeasDataPattern1 = 32'hAAAAAAAA;
  43. MeasDataPattern2 = 32'hBBBBBBBB;
  44. #100;
  45. Rst_i = 1'b0;
  46. #200;
  47. start = 1'b1;
  48. #20;
  49. start = 1'b0;
  50. #100;
  51. MeasDataPattern1 = 32'hCCCCCCCC;
  52. MeasDataPattern2 = 32'hDDDDDDDD;
  53. #1000;
  54. start = 1'b1;
  55. #20;
  56. start = 1'b0;
  57. end
  58. DspInterface
  59. #(
  60. .ODataWidth (16),
  61. .ResultWidth (32),
  62. .ChNum (4),
  63. .CmdRegWidth (32),
  64. .CmdDataRegWith (24),
  65. .HeaderWidth (7),
  66. .DataCntWidth (5)
  67. )
  68. DspInterfaceInst
  69. (
  70. .Clk_i (Clk_i),
  71. .Rst_i (Rst_i),
  72. .Mosi_i (1'b0),
  73. .Sck_i (1'b0),
  74. .Ss_i (1'b0),
  75. .Mosi_o (),
  76. .Sck_o (),
  77. .Ss0_o (),
  78. .Ss1_o (),
  79. .Miso_i (1'b0),
  80. .Miso_o (),
  81. .CmdDataReg_o (),
  82. .CmdDataVal_o (),
  83. .AnsReg_i (32'b0),
  84. .AnsAddr_o (),
  85. .LpOutFs_o (),
  86. .LpOutClk_o (),
  87. .LpOutData_o (),
  88. .Adc1T1ImResult_i (MeasDataPattern1),
  89. .Adc1T1ReResult_i (MeasDataPattern2),
  90. .Adc1R1ImResult_i (MeasDataPattern1),
  91. .Adc1R1ReResult_i (MeasDataPattern2),
  92. .Adc2R2ImResult_i (MeasDataPattern1),
  93. .Adc2R2ReResult_i (MeasDataPattern2),
  94. .Adc2T2ImResult_i (MeasDataPattern1),
  95. .Adc2T2ReResult_i (MeasDataPattern2),
  96. .ServiseRegData_i (32'h8),
  97. .LpOutStart_i (start)
  98. );
  99. endmodule