MasterFpgaTopTb.v 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. `timescale 1ns / 1ps
  2. //////////////////////////////////////////////////////////////////////////////////
  3. // Company:
  4. // Engineer:
  5. //
  6. // Create Date: 10.10.2018 01:07:38
  7. // Design Name:
  8. // Module Name: sram_ctrl2
  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 MasterFpgaTopTb
  22. (
  23. input Clk_i
  24. );
  25. //================================================================================
  26. // REG/WIRE
  27. reg clk120Dsp;
  28. reg clk120Fpga;
  29. reg start;
  30. reg rstN;
  31. reg ForceRstN;
  32. wire [15:0] data;
  33. wire [24:0] addr;
  34. wire awe;
  35. wire amsn;
  36. wire aoe;
  37. wire are;
  38. wire [1:0] be;
  39. //================================================================================
  40. // LOCALPARAM
  41. //================================================================================
  42. // ASSIGNMENTS
  43. always #4.2 clk120Dsp = ~clk120Dsp;
  44. always #4.2 clk120Fpga = ~clk120Fpga;
  45. //================================================================================
  46. // CODING
  47. initial begin
  48. rstN = 0;
  49. ForceRstN = 0;
  50. clk120Dsp = 1;
  51. start = 0;
  52. clk120Fpga = 0;
  53. #20
  54. rstN = 1;
  55. ForceRstN = 1;
  56. #100
  57. start = 1;
  58. #4.2
  59. start = 0;
  60. end
  61. DspSramModel DspSramInterface
  62. (
  63. .Clk120MHz_i (clk120Dsp),
  64. .RstN_i (rstN),
  65. .SmcD_o (data),
  66. .SmcA_o (addr),
  67. .SmcAwe_o (awe),
  68. .SmcAmsN_o (amsn),
  69. .SmcAoe_o (aoe),
  70. .SmcAre_o (are),
  71. .SmcBe_o (be),
  72. .Start_i (start)
  73. );
  74. MasterFpgaTop MasterFpgaTop
  75. (
  76. .Clk_i (clk120Fpga),
  77. .RstN_i (rstN),
  78. .ForceRstN_i(ForceRstN),
  79. .SmcD_i (data),
  80. .SmcA_i (addr),
  81. .SmcAwe_i (awe),
  82. .SmcAmsN_i (amsn),
  83. .SmcAoe_i (aoe),
  84. .SmcAre_i (are),
  85. .SmcBe_i (be),
  86. .Data_o (),
  87. .Addr_o (),
  88. .Val_o ()
  89. );
  90. endmodule