You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stimuli.sv 2.8KB

1 year ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //------------------------------------------------------
  2. //
  3. // File : stimuli.sv
  4. // Related Files :
  5. // Author(s) : Mueller
  6. // Email : muelleral82290@th-nuernberg.de
  7. // Organization : Georg-Simon-Ohm-Hochschule Nuernberg
  8. // Notes : Stimuli Modul
  9. //
  10. //------------------------------------------------------
  11. // History
  12. //------------------------------------------------------
  13. // Version| Author | Mod. Date | Changes Made:
  14. // v1.00 | Mueller | 11/05/2023 | first code
  15. //------------------------------------------------------
  16. //interface for LED
  17. //reg [2:0]rbg stores rgb values that depend on dip[3:2]
  18. //interface for DIPSCHALER
  19. // dip[3:2] -> select colour, dip[1] -> read ~ 1/write ~ 0, dip[0] -> on ~ 1/off ~ 0
  20. //interface for FRAM
  21. // sck -> 0 ~ cummonication enabled, 1 ~ communication disabled
  22. // clk -> system clock / timer
  23. // miso -> testbench output
  24. // mosi -> testbench input
  25. //testbenchclock replaces the oscillator on the board
  26. // 27.04.23 -> #delay/#oszillatordelay is not set jet
  27. // 09.06.23 -> removed fram_if.fram_port_stim fram_spi from the stimuli parameters, moved to "fram_module"
  28. // 09.06.23 -> oszillatordelay = 1, delay = 5
  29. `timescale 10ns/10ps
  30. module stimuli(led_if.led_port_stim led_stim, dip_if.dip_port_stim dip_stim, clock_if.clock_port_stim clk_stim);
  31. // generate oszillator signal for the timer block (clock_if)
  32. reg oszillator;
  33. initial oszillator = 0;
  34. always
  35. begin
  36. #1 oszillator <= ! oszillator;
  37. clk_stim.clk <= ! oszillator;
  38. end
  39. initial
  40. begin
  41. /*~~~~toplevel is set to off~~~~~~~~*/
  42. /*~~~~dip[0] is set to 0~~~~~~~~~~~~*/
  43. dip_stim.dip = 4'b0000;
  44. #500 dip_stim.dip = 4'b0010;
  45. #500 dip_stim.dip = 4'b0100;
  46. #500 dip_stim.dip = 4'b0110;
  47. #500 dip_stim.dip = 4'b1000;
  48. #500 dip_stim.dip = 4'b1010;
  49. #500 dip_stim.dip = 4'b1100;
  50. #500 dip_stim.dip = 4'b1110;
  51. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  52. /*~~~~toplevel is set to on~~~~~~~~~*/
  53. /*~~~~dip[0] is set to 1~~~~~~~~~~~~*/
  54. /*~~fram is set to write~~~~~~~~*/
  55. /*~~~~dip[1] is set to 0~~~~~~~~*/
  56. #800 dip_stim.dip = 4'b0001;
  57. #2000 dip_stim.dip = 4'b0101;
  58. #2000 dip_stim.dip = 4'b1001;
  59. #2000 dip_stim.dip = 4'b1101;
  60. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  61. /*~~fram is set to read~~~~~~~~~*/
  62. /*~~~~dip[1] is set to 1~~~~~~~~*/
  63. #2000 dip_stim.dip = 4'b0011;
  64. #2000 dip_stim.dip = 4'b0111;
  65. #2000 dip_stim.dip = 4'b1011;
  66. #2000 dip_stim.dip = 4'b1111;
  67. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  68. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  69. end
  70. endmodule : stimuli