SURF  1.0
UartSem.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : UartSem.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2017-02-08
5 -- Last update: 2017-05-08
6 -------------------------------------------------------------------------------
7 -- Description: UART 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 --! @see entity
27  --! @ingroup xilinx_7Series_sem
28 entity UartSem is
29  generic (
30  TPD_G : time := 1 ns;
31  CLK_FREQ_G : real := 100.0E+6;
32  BAUD_RATE_G : positive := 115200;
33  FIFO_BRAM_EN_G : boolean := false;
34  FIFO_ADDR_WIDTH_G : positive := 5);
35  port (
36  -- Clock and Reset
37  semClk : in sl;
38  semRst : in sl;
39  -- IPROG Interface
40  fpgaReload : in sl := '0';
41  fpgaReloadAddr : in slv(31 downto 0) := (others => '0');
42  -- UART Serial Interface
43  uartTx : out sl;
44  uartRx : in sl);
45 end entity UartSem;
46 
47 architecture mapping of UartSem is
48 
49  signal wrData : sl;
50  signal wrValid : sl;
51  signal wrFull : sl;
52  signal wrReady : sl;
53 
54  signal rdData : sl;
55  signal rdValid : sl;
56  signal rdEmpty : sl;
57  signal rdReady : sl;
58 
60  signal semOb : SemObType;
61 
62 begin
63 
64  ------------------------------
65  -- Soft Error Mitigation Core
66  ------------------------------
67  U_Sem : entity work.SemWrapper
68  generic map (
69  TPD_G => TPD_G)
70  port map (
71  -- Clock and Reset
72  semClk => semClk,
73  semRst => semRst,
74  -- SEM Interface
75  semIb => semIb,
76  semOb => semOb);
77 
78  --------------
79  -- Flowcontrol
80  --------------
81  semIb.txFull <= not(wrReady);
82  semIb.rxEmpty <= not(rdValid);
83 
84  --------------------
85  -- UART Serdes Core
86  --------------------
87  U_Uart : entity work.UartWrapper
88  generic map (
89  TPD_G => TPD_G,
94  port map (
95  -- Clock and Reset
96  clk => semClk,
97  rst => semRst,
98  -- Write Interface
99  wrData => semOb.txData,
100  wrValid => semOb.txWrite,
101  wrReady => wrReady,
102  -- Read Interface
103  rdData => semIb.rxData,
104  rdValid => rdValid,
105  rdReady => semOb.rxRead,
106  -- UART Serial Interface
107  tx => uartTx,
108  rx => uartRx);
109 
110 end mapping;
in wrValidsl
Definition: UartWrapper.vhd:41
FIFO_ADDR_WIDTH_Gpositive := 5
Definition: UartSem.vhd:34
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 4
Definition: UartWrapper.vhd:35
SemIbType
Definition: SemPkg.vhd:42
std_logic sl
Definition: StdRtlPkg.vhd:28
BAUD_RATE_Gpositive := 115200
Definition: UartSem.vhd:32
_library_ ieeeieee
Definition: SsiSem.vhd:18
in wrDataslv( 7 downto 0)
Definition: UartWrapper.vhd:40
in rdReadysl
Definition: UartWrapper.vhd:46
sl rxEmpty
Definition: SemPkg.vhd:47
in fpgaReloadsl := '0'
Definition: UartSem.vhd:40
in semRstsl
Definition: UartSem.vhd:38
out rdDataslv( 7 downto 0)
Definition: UartWrapper.vhd:44
SemIbType :=(injectStrobe => '0',injectAddress =>( others => '0'),txFull => '1',rxData =>( others => '0'),rxEmpty => '0',iprogIcapGrant => '0') SEM_IB_INIT_C
Definition: SemPkg.vhd:51
sl txFull
Definition: SemPkg.vhd:45
in semIbSemIbType
Definition: SemWrapper.vhd:42
out wrReadysl
Definition: UartWrapper.vhd:42
out rdValidsl
Definition: UartWrapper.vhd:45
SemObType semOb
Definition: UartSem.vhd:60
BAUD_RATE_Ginteger := 115200
Definition: UartWrapper.vhd:33
TPD_Gtime := 1 ns
Definition: UartSem.vhd:30
CLK_FREQ_Greal := 100.0E+6
Definition: UartSem.vhd:31
TPD_Gtime := 1 ns
Definition: SemWrapper.vhd:33
SemObType
Definition: SemPkg.vhd:27
TPD_Gtime := 1 ns
Definition: UartWrapper.vhd:31
FIFO_BRAM_EN_Gboolean := false
Definition: UartWrapper.vhd:34
in uartRxsl
Definition: UartSem.vhd:44
in fpgaReloadAddrslv( 31 downto 0) :=( others => '0')
Definition: UartSem.vhd:41
in semClksl
Definition: SemWrapper.vhd:36
in semClksl
Definition: UartSem.vhd:37
in semRstsl
Definition: SemWrapper.vhd:37
FIFO_BRAM_EN_Gboolean := false
Definition: UartSem.vhd:33
CLK_FREQ_Greal := 125.0e6
Definition: UartWrapper.vhd:32
SemIbType := SEM_IB_INIT_C semIb
Definition: UartSem.vhd:59
out semObSemObType
Definition: SemWrapper.vhd:43
out uartTxsl
Definition: UartSem.vhd:43
std_logic_vector slv
Definition: StdRtlPkg.vhd:29