SURF  1.0
SspDecoder10b12b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspDecoder10b12b.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 10b12b 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.Code10b12bPkg.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 
37  port (
38  clk : in sl;
40  dataIn : in slv(11 downto 0);
41  validIn : in sl := '1';
42  dataOut : out slv(9 downto 0);
43  validOut : 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 SspDecoder10b12b;
51 
52 architecture rtl of SspDecoder10b12b is
53 
54  signal validDec : sl;
55  signal codeErrorInt : sl;
56  signal framedData : slv(9 downto 0);
57  signal framedDataK : slv(0 downto 0);
58 
59 begin
60 
61  Decoder10b12b_1 : entity work.Decoder10b12b
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  dataOut => framedData,
73  dataKOut => framedDataK(0),
74  validOut => validDec,
75  codeError => codeErrorInt,
76  dispError => dispError);
77 
78  codeError <= codeErrorInt;
79 
80  SspDeframer_1 : entity work.SspDeframer
81  generic map (
82  TPD_G => TPD_G,
85  WORD_SIZE_G => 10,
86  K_SIZE_G => 1,
88  SSP_IDLE_K_G => "1",
90  SSP_SOF_K_G => "1",
92  SSP_EOF_K_G => "1")
93  port map (
94  clk => clk,
95  rst => rst,
96  validIn => validDec,
97  dataIn => framedData,
98  dataKIn => framedDataK,
99  dataOut => dataOut,
100  validOut => validOut,
101  sof => sof,
102  eof => eof,
103  eofe => eofe);
104 
105 
106 
107 end architecture rtl;
in dataInslv( 11 downto 0)
out sofsl
Definition: SspDeframer.vhd:52
out dataOutslv( WORD_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:50
in validInsl
Definition: SspDeframer.vhd:48
slv( 9 downto 0) := "1010111100" K_28_21_C
RST_POLARITY_Gsl := '0'
std_logic sl
Definition: StdRtlPkg.vhd:28
_library_ IEEEIEEE
Definition: StdRtlPkg.vhd:18
_library_ ieeeieee
WORD_SIZE_Ginteger := 16
Definition: SspDeframer.vhd:35
RST_ASYNC_Gboolean := true
Definition: SspDeframer.vhd:34
TPD_Gtime := 1 ns
Definition: SspDeframer.vhd:32
in rstsl :=not RST_POLARITY_G
in validInsl := '1'
slv( 9 downto 0) := "0101011100" K_28_10_C
RST_ASYNC_Gboolean := true
in clkEnsl := '1'
RST_POLARITY_Gsl := '0'
Definition: SspDeframer.vhd:33
K_SIZE_Ginteger := 2
Definition: SspDeframer.vhd:36
out eofsl
Definition: SspDeframer.vhd:53
slv( 9 downto 0) := "0001111100" K_28_3_C
in dataInslv( 11 downto 0)
in rstsl := RST_POLARITY_G
Definition: SspDeframer.vhd:45
out eofesl
Definition: SspDeframer.vhd:54
RST_ASYNC_Gboolean := true
out dataOutslv( 9 downto 0)
in rstsl := RST_POLARITY_G
SSP_EOF_CODE_Gslv
Definition: SspDeframer.vhd:41
in dataKInslv( K_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:46
SSP_SOF_CODE_Gslv
Definition: SspDeframer.vhd:39
TPD_Gtime := 1 ns
out validOutsl
Definition: SspDeframer.vhd:51
SSP_IDLE_K_Gslv
Definition: SspDeframer.vhd:38
SSP_IDLE_CODE_Gslv
Definition: SspDeframer.vhd:37
in dataInslv( WORD_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:47
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
out dataOutslv( 9 downto 0)