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.

interface.sv 1.8KB

1 year ago
1 year ago
1 year ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //------------------------------------------------------
  2. //
  3. // File : interface.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. //eoh
  17. //interface for LED
  18. //reg [2:0]rbg stores rgb values that depend on dip[3:2]
  19. interface led_if();
  20. logic [2:0]rgb;
  21. logic [2:0]rgbn;
  22. modport led_port_stim(input rgb, rgbn);
  23. modport led_port_top(output rgb, rgbn);
  24. endinterface : led_if
  25. //interface for DIPSCHALER
  26. // dip[3:2] -> select colour, dip[1] -> read ~ 1/write ~ 0, dip[0] -> on ~ 1/off ~ 0
  27. interface dip_if();
  28. logic [3:0]dip;
  29. modport dip_port_stim(output dip);
  30. modport dip_port_top(input dip);
  31. endinterface : dip_if
  32. //interface for FRAM
  33. // sck -> 0 ~ cummonication enabled, 1 ~ communication disabled
  34. // clk -> system clock / timer
  35. // miso -> testbench output
  36. // mosi -> testbench input
  37. interface fram_if();
  38. logic ss;
  39. logic mosi;
  40. logic miso;
  41. logic sclk;
  42. modport fram_port_stim(input mosi, sclk, ss, output miso);
  43. modport fram_port_top(output mosi, sclk, ss, input miso);
  44. endinterface : fram_if
  45. //testbenchclock replaces the oscillator on the board
  46. interface clock_if();
  47. logic clk;
  48. modport clock_port_stim(output clk);
  49. modport clock_port_top(input clk);
  50. endinterface : clock_if