test_public_config_pkg.vhd 4.83 KB
Newer Older
1
--------------------------------------------------------------------------------
2
3
4
-- Fault InJection Instrumenter (FIJI)
-- https://embsys.technikum-wien.at/projects/vecs/fiji
--
5
6
7
8
-- The creation of this file has been supported by the publicly funded
-- R&D project Josef Ressel Center for Verification of Embedded Computing
-- Systems (VECS) managed by the Christian Doppler Gesellschaft (CDG).
--
9
10
11
-- Authors:
-- Christian Fibich <fibich@technikum-wien.at>
-- Stefan Tauner <tauner@technikum-wien.at>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--
-- Copyright and related rights are licensed under the Solderpad Hardware
-- License, Version 0.51 (the "License"); you may not use this file except
-- in compliance with the License. You may obtain a copy of the License at
-- http://solderpad.org/licenses/SHL-0.51. Unless required by applicable
-- law or agreed to in writing, software, hardware and materials
-- distributed under this License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or
-- implied. See the License for the specific language governing
-- permissions and limitations under the License.
--
-- See the LICENSE file for more details.
--
-- Description:
--  Default public config package for testbenches
27
28
--------------------------------------------------------------------------------

29
library ieee;
30
    use ieee.std_logic_1164.all;
31
32

library work;
33
    use work.fault_selection_type_pkg.all;
34
35
36
37

package public_config_pkg is

  ------------------------------------------------------------------------------
38
39
40
41
42
43
  -- Attention: Some test cases require the exact c_frequency and c_baudrate
  -- as set below and may lead to other results when these values are changed
  -- i.e. different coverage
  ------------------------------------------------------------------------------

  ------------------------------------------------------------------------------
44
45
46
47
48
49
  -- Design configuration
  ------------------------------------------------------------------------------
  -- The design's clock frequency
  constant c_frequency : positive := 200000000;
  -- The baud rate
  constant c_baudrate  : positive := 3000000;
50
51
  -- The invert mask for the fault detection signals
  constant c_fault_detect_invert_mask : std_logic_vector(1 downto 0) := "10";
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

  ------------------------------------------------------------------------------
  -- LFSR configuration
  ------------------------------------------------------------------------------

  -- Width of the LFSR for random FIU enable & stuck-open
  constant c_lfsr_width : natural                                   := 16;
  -- Polynomial for the LFSR
  constant c_lfsr_poly  : std_logic_vector(c_lfsr_width-1 downto 0) := X"002d";
  -- Initial value for the LFSR
  constant c_lfsr_seed  : std_logic_vector(c_lfsr_width-1 downto 0) := X"cafe";

  ------------------------------------------------------------------------------
  -- Controller Configuration
  ------------------------------------------------------------------------------

  -- Width of the timers in bytes.
69
70
  constant c_timer_width  : natural := 4;
  
71
  -- FIC -> DUT reset signal: active level
72
  constant c_reset_dut_in_active : std_logic := '0';
73
  -- reset duration
74
  constant c_reset_dut_in_duration : positive := 4;
75
76
77
78
79
80
81
82
83

  -- external reset signal: active level
  constant c_reset_ext_active : std_logic := '0';

  -- DUT -> FIC reset signal: active level
  constant c_reset_dut_out_active : std_logic := '0';


  -- active level of the external and internal triggers
84
85
  constant c_trigger_ext_active             : std_logic := '0';
  constant c_trigger_dut_active             : std_logic := '1';
86
87

  -- hardware id
88
  constant c_id    : std_logic_vector(15 downto 0) :=  X"0123";
89
90
91
92
93
94
95
96
97




  ------------------------------------------------------------------------------
  -- FIU Configuration
  ------------------------------------------------------------------------------

  type t_single_fiu_record is record
98
    fault_model             : t_select_fault_models;  -- Select dynamic or single fault model. See fault_injection_unit
99
    lfsr_mask               : std_logic_vector(c_lfsr_width-1 downto 0);  -- Select which LFSR bits to AND for Stuck-Open
100
101
102
103
104
105
  end record t_single_fiu_record;

  type t_fiu_records is array (natural range <>) of t_single_fiu_record;

  constant c_fiu_config : t_fiu_records := (

106
107
      (fault_model     => RUNTIME,
       lfsr_mask       => X"04D2"),
108

109
110
      (fault_model     => STUCK_AT_0,
       lfsr_mask       => X"0000"),
111

112
113
      (fault_model     => STUCK_AT_1,
       lfsr_mask       => X"0000"),
114

115
116
      (fault_model     => DELAY,
       lfsr_mask       => X"0000"),
117

118
119
      (fault_model     => SEU,
       lfsr_mask       => X"0000"),
120

121
122
      (fault_model     => STUCK_OPEN,
       lfsr_mask       => X"0001"),
123

124
125
      (fault_model     => PASS_THRU,
       lfsr_mask       => X"0000"),
126

127
128
      (fault_model     => RUNTIME,
       lfsr_mask       => X"8001")
129

130
  );
131
132

end package public_config_pkg;