Library of reusable VHDL components
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.

108 lines
3.4 KiB

  1. -- Copyright (c) 2014 - 2022 by Torsten Meissner
  2. --
  3. -- Licensed under the Apache License, Version 2.0 (the "License");
  4. -- you may not use this file except in compliance with the License.
  5. -- You may obtain a copy of the License at
  6. --
  7. -- https://www.apache.org/licenses/LICENSE-2.0
  8. --
  9. -- Unless required by applicable law or agreed to in writing, software
  10. -- distributed under the License is distributed on an "AS IS" BASIS,
  11. -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. -- See the License for the specific language governing permissions and
  13. -- limitations under the License.
  14. library ieee;
  15. use ieee.std_logic_1164.all;
  16. use ieee.numeric_std.all;
  17. entity WishBoneCheckerE is
  18. port (
  19. --+ wishbone system if
  20. WbRst_i : in std_logic;
  21. WbClk_i : in std_logic;
  22. --+ wishbone outputs
  23. WbMCyc_i : in std_logic;
  24. WbMStb_i : in std_logic;
  25. WbMWe_i : in std_logic;
  26. WbMAdr_i : in std_logic_vector;
  27. WbMDat_i : in std_logic_vector;
  28. --+ wishbone inputs
  29. WbSDat_i : in std_logic_vector;
  30. WbSAck_i : in std_logic;
  31. WbSErr_i : in std_logic;
  32. WbRty_i : in std_logic
  33. );
  34. end entity WishBoneCheckerE;
  35. architecture check of WishBoneCheckerE is
  36. begin
  37. -- psl default clock is rising_edge(WbClk_i);
  38. --
  39. -- Wishbone protocol checks
  40. --
  41. -- psl property initialize_interface (boolean init_state) is
  42. -- always ({WbRst_i} |=> {init_state[+] && {WbRst_i[*]; not(WbRst_i)}});
  43. --
  44. -- psl RULE_3_00 : assert initialize_interface (not(WbMCyc_i) and not(WbMStb_i) and not(WbMWe_i))
  45. -- report "Wishbone rule 3.00 violated";
  46. --
  47. -- psl property reset_signal is
  48. -- always {not(WbRst_i); WbRst_i} |=> {(WbRst_i and not(WbClk_i))[*]; WbRst_i and WbClk_i};
  49. --
  50. -- psl RULE_3_05 : assert reset_signal
  51. -- report "Wishbone rule 3.05 violated";
  52. --
  53. -- psl property CYC_O_signal is
  54. -- always {not(WbMStb_i); WbMStb_i} |-> {(WbMCyc_i and WbMStb_i)[+]; not(WbMStb_i)};
  55. --
  56. -- psl RULE_3_25 : assert CYC_O_signal
  57. -- report "Wishbone rule 3.25 violated";
  58. --
  59. -- psl property slave_no_response is
  60. -- always not(WbMCyc_i) -> not(WbSAck_i) and not(WbSErr_i);
  61. --
  62. -- psl property slave_response_to_master is
  63. -- always {not(WbMStb_i); WbMStb_i} |->
  64. -- {{(WbMStb_i and not(WbSAck_i))[*];
  65. -- WbMStb_i and WbSAck_i;
  66. -- not(WbMStb_i)} |
  67. -- {(WbMStb_i and not(WbSErr_i))[*];
  68. -- WbMStb_i and WbSErr_i;
  69. -- not(WbMStb_i)} |
  70. -- {(WbMStb_i and not(WbRty_i))[*];
  71. -- WbMStb_i and WbRty_i;
  72. -- not(WbMStb_i)}
  73. -- };
  74. --
  75. -- psl RULE_3_30_0 : assert slave_no_response
  76. -- report "Wishbone rule 3.30_0 violated";
  77. --
  78. -- psl RULE_3_30_1 : assert slave_response_to_master
  79. -- report "Wishbone rule 3.30_0 violated";
  80. --
  81. -- psl property slave_response is
  82. -- always {not(WbMStb_i); WbMCyc_i and WbMStb_i} |->
  83. -- {not(WbSAck_i or WbSErr_i or WbRty_i)[*]; WbSAck_i or WbSErr_i or WbRty_i};
  84. --
  85. -- psl RULE_3_35 : assert slave_response
  86. -- report "Wishbone rule 3.35 violated";
  87. --
  88. -- psl property response_signals is
  89. -- never ((WbSErr_i and WbRty_i) or (WbSErr_i and WbSAck_i) or (WbSAck_i and WbRty_i));
  90. --
  91. -- psl RULE_3_45 : assert response_signals
  92. -- report "Wishbone rule 3.45 violated";
  93. --
  94. -- -- psl property slave_negated_response is
  95. end architecture check;