top_tb.v 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. * top_tb.v
  3. *
  4. * vim: ts=4 sw=4
  5. *
  6. * Copyright (C) 2019 Sylvain Munaut <tnt@246tNt.com>
  7. * All rights reserved.
  8. *
  9. * BSD 3-clause, see LICENSE.bsd
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions are met:
  13. * * Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * * Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * * Neither the name of the <organization> nor the
  19. * names of its contributors may be used to endorse or promote products
  20. * derived from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  23. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  24. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  25. * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  26. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  27. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  29. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. `default_nettype none
  34. module top_tb;
  35. // Signals
  36. // -------
  37. wire spi_mosi;
  38. wire spi_miso;
  39. wire spi_flash_cs_n;
  40. wire spi_clk;
  41. wire usb_dp;
  42. wire usb_dn;
  43. wire usb_pu;
  44. wire uart_rx;
  45. wire uart_tx;
  46. // Setup recording
  47. // ---------------
  48. initial begin
  49. $dumpfile("top_tb.vcd");
  50. $dumpvars(0,top_tb);
  51. # 2000000 $finish;
  52. end
  53. // DUT
  54. // ---
  55. top dut_I (
  56. .spi_mosi(spi_mosi),
  57. .spi_miso(spi_miso),
  58. .spi_flash_cs_n(spi_flash_cs_n),
  59. .spi_clk(spi_clk),
  60. .usb_dp(usb_dp),
  61. .usb_dn(usb_dn),
  62. .usb_pu(usb_pu),
  63. .uart_rx(uart_rx),
  64. .uart_tx(uart_tx),
  65. .rgb(),
  66. .clk_in(1'b0)
  67. );
  68. // Support
  69. // -------
  70. pullup(usb_dp);
  71. pullup(usb_dn);
  72. pullup(uart_tx);
  73. pullup(uart_rx);
  74. spiflash flash_I (
  75. .csb(spi_flash_cs_n),
  76. .clk(spi_clk),
  77. .io0(spi_mosi),
  78. .io1(spi_miso),
  79. .io2(),
  80. .io3()
  81. );
  82. endmodule // top_tb