SURF  1.0
SemWrapper.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SemWrapper.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2017-02-08
5 -- Last update: 2017-02-08
6 -------------------------------------------------------------------------------
7 -- Description: Wrapper for 7-series SEM module
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 library ieee;
19 use ieee.std_logic_1164.all;
20 use ieee.std_logic_unsigned.all;
21 use ieee.std_logic_arith.all;
22 
23 use work.StdRtlPkg.all;
24 use work.SemPkg.all;
25 
26 library unisim;
27 use unisim.vcomponents.all;
28 
29 --! @see entity
30  --! @ingroup xilinx_7Series_sem
31 entity SemWrapper is
32  generic (
33  TPD_G : time := 1 ns);
34  port (
35  -- Clock and Reset
36  semClk : in sl;
37  semRst : in sl;
38  -- IPROG Interface
39  fpgaReload : in sl := '0';
40  fpgaReloadAddr : in slv(31 downto 0) := (others => '0');
41  -- SEM Interface
43  semOb : out SemObType);
44 end entity SemWrapper;
45 
46 architecture mapping of SemWrapper is
47 
48  component SemCore
49  port (
50  status_heartbeat : out std_logic;
51  status_initialization : out std_logic;
52  status_observation : out std_logic;
53  status_correction : out std_logic;
54  status_classification : out std_logic;
55  status_injection : out std_logic;
56  status_essential : out std_logic;
57  status_uncorrectable : out std_logic;
58  monitor_txdata : out std_logic_vector(7 downto 0);
59  monitor_txwrite : out std_logic;
60  monitor_txfull : in std_logic;
61  monitor_rxdata : in std_logic_vector(7 downto 0);
62  monitor_rxread : out std_logic;
63  monitor_rxempty : in std_logic;
64  inject_strobe : in std_logic;
65  inject_address : in std_logic_vector(39 downto 0);
66  icap_o : in std_logic_vector(31 downto 0);
67  icap_csib : out std_logic;
68  icap_rdwrb : out std_logic;
69  icap_i : out std_logic_vector(31 downto 0);
70  icap_clk : in std_logic;
71  icap_request : out std_logic;
72  icap_grant : in std_logic;
73  fecc_crcerr : in std_logic;
74  fecc_eccerr : in std_logic;
75  fecc_eccerrsingle : in std_logic;
76  fecc_syndromevalid : in std_logic;
77  fecc_syndrome : in std_logic_vector(12 downto 0);
78  fecc_far : in std_logic_vector(25 downto 0);
79  fecc_synbit : in std_logic_vector(4 downto 0);
80  fecc_synword : in std_logic_vector(6 downto 0));
81  end component;
82 
83  signal fecc_crcerr : sl;
84  signal fecc_eccerr : sl;
87  signal fecc_syndrome : slv(12 downto 0);
88  signal fecc_far : slv(25 downto 0);
89  signal fecc_synbit : slv(4 downto 0);
90  signal fecc_synword : slv(6 downto 0);
91 
92  signal icap_o : slv(31 downto 0);
93 
94  signal icap_i : slv(31 downto 0);
95  signal icap_csib : sl;
96  signal icap_rdwrb : sl;
97 
98  signal sem_icap_csib : sl;
99  signal sem_icap_rdwrb : sl;
100  signal sem_icap_i : slv(31 downto 0);
101 
102  signal iprogIcapReq : sl;
103  signal iprogIcapGrant : sl;
104  signal iprogIcapCsl : sl;
105  signal iprogIcapRnw : sl;
106  signal iprogIcapI : slv(31 downto 0);
107 
108 begin
109 
110  U_FRAME_ECCE2 : FRAME_ECCE2
111  generic map (
112  FRAME_RBT_IN_FILENAME => "NONE",
113  FARSRC => "EFAR")
114  port map (
115  CRCERROR => fecc_crcerr,
116  ECCERROR => fecc_eccerr,
117  ECCERRORSINGLE => fecc_eccerrsingle,
118  FAR => fecc_far,
119  SYNBIT => fecc_synbit,
120  SYNDROME => fecc_syndrome,
121  SYNDROMEVALID => fecc_syndromevalid,
122  SYNWORD => fecc_synword);
123 
124  U_ICAPE2 : ICAPE2
125  generic map (
126  SIM_CFG_FILE_NAME => "NONE",
127  DEVICE_ID => X"FFFFFFFF",
128  ICAP_WIDTH => "X32")
129  port map (
130  O => icap_o,
131  CLK => semClk,
132  CSIB => icap_csib,
133  I => icap_i,
134  RDWRB => icap_rdwrb);
135 
136  U_IPROG : entity work.Iprog7SeriesCore
137  generic map (
138  TPD_G => TPD_G,
139  SYNC_RELOAD_G => true)
140  port map (
141  reload => fpgaReload,
143  icapClk => semClk,
144  icapClkRst => semRst,
145  icapReq => semOb.iprogIcapReq,
149  icapI => iprogIcapI);
150 
152  icap_csib <= iprogIcapCsl when (iprogIcapGrant = '1') else sem_icap_csib;
153  icap_i <= iprogIcapI when (iprogIcapGrant = '1') else sem_icap_i;
154 
155  U_SemCore : SemCore
156  port map (
157  -- Status Vector
158  status_heartbeat => semOb.heartbeat,
159  status_initialization => semOb.initialization,
160  status_observation => semOb.observation,
161  status_correction => semOb.correction,
162  status_classification => semOb.classification,
163  status_injection => semOb.injection,
164  status_essential => semOb.essential,
165  status_uncorrectable => semOb.uncorrectable,
166  -- Byte Stream Interface
167  monitor_txdata => semOb.txData,
168  monitor_txwrite => semOb.txWrite,
169  monitor_txfull => semIb.txFull,
170  monitor_rxdata => semIb.rxData,
171  monitor_rxread => semOb.rxRead,
172  monitor_rxempty => semIb.rxEmpty,
173  -- Test Injection Interface
174  inject_strobe => semIb.injectStrobe,
175  inject_address => semIb.injectAddress,
176  -- ICAPE2 Interface
177  icap_o => icap_o,
178  icap_csib => sem_icap_csib,
179  icap_rdwrb => sem_icap_rdwrb,
180  icap_i => sem_icap_i,
181  icap_clk => semClk,
182  icap_request => open,
183  icap_grant => '1',
184  -- FRAME_ECCE2 Interface
185  fecc_crcerr => fecc_crcerr,
186  fecc_eccerr => fecc_eccerr,
187  fecc_eccerrsingle => fecc_eccerrsingle,
188  fecc_syndromevalid => fecc_syndromevalid,
189  fecc_syndrome => fecc_syndrome,
190  fecc_far => fecc_far,
191  fecc_synbit => fecc_synbit,
192  fecc_synword => fecc_synword);
193 
194 end mapping;
in fpgaReloadsl := '0'
Definition: SemWrapper.vhd:39
SemIbType
Definition: SemPkg.vhd:42
std_logic sl
Definition: StdRtlPkg.vhd:28
slv( 31 downto 0) iprogIcapI
Definition: SemWrapper.vhd:106
slv( 12 downto 0) fecc_syndrome
Definition: SemWrapper.vhd:87
out icapIslv( 31 downto 0)
in semIbSemIbType
Definition: SemWrapper.vhd:42
in reloadAddrslv( 31 downto 0) := X"00000000"
slv( 4 downto 0) fecc_synbit
Definition: SemWrapper.vhd:89
SYNC_RELOAD_Gboolean := true
in icapGrantsl := '1'
TPD_Gtime := 1 ns
Definition: SemWrapper.vhd:33
SemObType
Definition: SemPkg.vhd:27
in semClksl
Definition: SemWrapper.vhd:36
_library_ ieeeieee
Definition: SemPkg.vhd:18
in semRstsl
Definition: SemWrapper.vhd:37
in fpgaReloadAddrslv( 31 downto 0) :=( others => '0')
Definition: SemWrapper.vhd:40
slv( 31 downto 0) icap_o
Definition: SemWrapper.vhd:92
out semObSemObType
Definition: SemWrapper.vhd:43
slv( 25 downto 0) fecc_far
Definition: SemWrapper.vhd:88
slv( 31 downto 0) sem_icap_i
Definition: SemWrapper.vhd:100
slv( 6 downto 0) fecc_synword
Definition: SemWrapper.vhd:90
slv( 31 downto 0) icap_i
Definition: SemWrapper.vhd:94
std_logic_vector slv
Definition: StdRtlPkg.vhd:29