SURF  1.0
SspDecoder12b14b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspDecoder12b14b.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2014-07-14
5 -- Last update: 2017-05-01
6 -------------------------------------------------------------------------------
7 -- Description: SimpleStreamingProtocol - A simple protocol layer for inserting
8 -- idle and framing control characters into a raw data stream. This module
9 -- ties the framing core to an RTL 12b14b encoder.
10 -------------------------------------------------------------------------------
11 -- This file is part of 'SLAC Firmware Standard Library'.
12 -- It is subject to the license terms in the LICENSE.txt file found in the
13 -- top-level directory of this distribution and at:
14 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
15 -- No part of 'SLAC Firmware Standard Library', including this file,
16 -- may be copied, modified, propagated, or distributed except according to
17 -- the terms contained in the LICENSE.txt file.
18 -------------------------------------------------------------------------------
19 
20 library ieee;
21 use ieee.std_logic_1164.all;
22 use IEEE.STD_LOGIC_UNSIGNED.all;
23 use IEEE.STD_LOGIC_ARITH.all;
24 
25 use work.StdRtlPkg.all;
26 use work.Code12b14bPkg.all;
27 
28 --! @see entity
29  --! @ingroup protocols_ssp
31 
32  generic (
33  TPD_G : time := 1 ns;
34  RST_POLARITY_G : sl := '0';
35  RST_ASYNC_G : boolean := true);
36  port (
37  clk : in sl;
39  validIn : in sl := '1';
40  dataIn : in slv(13 downto 0);
41  validOut : out sl;
42  dataOut : out slv(11 downto 0);
43  valid : out sl;
44  sof : out sl;
45  eof : out sl;
46  eofe : out sl;
47  codeError : out sl;
48  dispError : out sl);
49 
50 end entity SspDecoder12b14b;
51 
52 architecture rtl of SspDecoder12b14b is
53 
54  signal validInt : sl;
55  signal codeErrorInt : sl;
56  signal framedData : slv(11 downto 0);
57  signal framedDataK : slv(0 downto 0);
58 
59 begin
60 
61  Decoder12b14b_1 : entity work.Decoder12b14b
62  generic map (
63  TPD_G => TPD_G,
66  port map (
67  clk => clk,
68  clkEn => '1',
69  rst => rst,
70  validIn => validIn,
71  dataIn => dataIn,
72  validOut => validInt,
73  dataOut => framedData,
74  dataKOut => framedDataK(0),
76  dispError => dispError);
77 
78  SspDeframer_1 : entity work.SspDeframer
79  generic map (
80  TPD_G => TPD_G,
83  WORD_SIZE_G => 12,
84  K_SIZE_G => 1,
86  SSP_IDLE_K_G => "1",
88  SSP_SOF_K_G => "1",
90  SSP_EOF_K_G => "1")
91  port map (
92  clk => clk,
93  rst => rst,
94  validIn => validInt,
95  dataIn => framedData,
96  dataKIn => framedDataK,
97  validOut => validOut,
98  dataOut => dataOut,
99  sof => sof,
100  eof => eof,
101  eofe => eofe);
102 
103 
104 
105 end architecture rtl;
out sofsl
Definition: SspDeframer.vhd:52
out dataOutslv( WORD_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:50
in validInsl
Definition: SspDeframer.vhd:48
std_logic sl
Definition: StdRtlPkg.vhd:28
_library_ IEEEIEEE
Definition: StdRtlPkg.vhd:18
WORD_SIZE_Ginteger := 16
Definition: SspDeframer.vhd:35
out dataOutslv( 11 downto 0)
in dataInslv( 13 downto 0)
RST_POLARITY_Gsl := '0'
RST_ASYNC_Gboolean := true
Definition: SspDeframer.vhd:34
RST_ASYNC_Gboolean := false
TPD_Gtime := 1 ns
Definition: SspDeframer.vhd:32
RST_POLARITY_Gsl := '0'
Definition: SspDeframer.vhd:33
K_SIZE_Ginteger := 2
Definition: SspDeframer.vhd:36
out eofsl
Definition: SspDeframer.vhd:53
in rstsl :=not RST_POLARITY_G
in validInsl := '1'
in rstsl := RST_POLARITY_G
Definition: SspDeframer.vhd:45
_library_ ieeeieee
in clkEnsl := '1'
out eofesl
Definition: SspDeframer.vhd:54
in rstsl := RST_POLARITY_G
in dataInslv( 13 downto 0)
TPD_Gtime := 1 ns
slv( 11 downto 0) := "000011111000" K_120_1_C
slv( 11 downto 0) := "010111111000" K_120_11_C
SSP_EOF_CODE_Gslv
Definition: SspDeframer.vhd:41
in dataKInslv( K_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:46
RST_ASYNC_Gboolean := true
SSP_SOF_CODE_Gslv
Definition: SspDeframer.vhd:39
out validOutsl
Definition: SspDeframer.vhd:51
SSP_IDLE_K_Gslv
Definition: SspDeframer.vhd:38
SSP_IDLE_CODE_Gslv
Definition: SspDeframer.vhd:37
slv( 11 downto 0) := "000001111000" K_120_0_C
in dataInslv( WORD_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:47
out dataOutslv( 11 downto 0)
std_logic_vector slv
Definition: StdRtlPkg.vhd:29