SURF  1.0
SspDecoder8b10b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspDecoder8b10b.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 8b10b 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.Code8b10bPkg.all;
27 
28 --! @see entity
29  --! @ingroup protocols_ssp
30 entity SspDecoder8b10b is
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(19 downto 0);
41  validIn : in sl := '1';
42  dataOut : out slv(15 downto 0);
43  validOut : out sl;
44  sof : out sl;
45  eof : out sl;
46  eofe : out sl);
47 
48 end entity SspDecoder8b10b;
49 
50 architecture rtl of SspDecoder8b10b is
51 
52  signal validDec : sl;
53  signal codeErr : slv(1 downto 0);
54  signal decErr : sl;
55  signal framedData : slv(15 downto 0);
56  signal framedDataK : slv(1 downto 0);
57 
58 begin
59 
60  Decoder8b10b_1 : entity work.Decoder8b10b
61  generic map (
62  TPD_G => TPD_G,
63  NUM_BYTES_G => 2,
66  port map (
67  clk => clk,
68  rst => rst,
69  validIn => validIn,
70  dataIn => dataIn,
71  dataOut => framedData,
72  dataKOut => framedDataK,
73  validOut => validDec,
74  codeErr => codeErr,
75  dispErr => open);
76 
77  decErr <= uor(codeErr);
78 
79  SspDeframer_1 : entity work.SspDeframer
80  generic map (
81  TPD_G => TPD_G,
84  WORD_SIZE_G => 16,
85  K_SIZE_G => 2,
86  SSP_IDLE_CODE_G => D_10_2_C & K_28_5_C ,
87  SSP_IDLE_K_G => "01",
88  SSP_SOF_CODE_G => D_10_2_C & K_23_7_C ,
89  SSP_SOF_K_G => "01",
90  SSP_EOF_CODE_G => D_10_2_C & K_29_7_C ,
91  SSP_EOF_K_G => "01")
92  port map (
93  clk => clk,
94  rst => rst,
95  dataIn => framedData,
96  dataKIn => framedDataK,
97  validIn => validDec,
98  decErrIn => decErr,
99  dataOut => dataOut,
100  validOut => validOut,
101  sof => sof,
102  eof => eof,
103  eofe => eofe);
104 
105 
106 
107 end architecture rtl;
NUM_BYTES_Gpositive := 2
RST_POLARITY_Gsl := '1'
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
TPD_Gtime := 1 ns
_library_ IEEEIEEE
Definition: StdRtlPkg.vhd:18
_library_ ieeeieee
out dataOutslv( NUM_BYTES_G* 8- 1 downto 0)
WORD_SIZE_Ginteger := 16
Definition: SspDeframer.vhd:35
RST_ASYNC_Gboolean := true
Definition: SspDeframer.vhd:34
out codeErrslv( NUM_BYTES_G- 1 downto 0)
out dispErrslv( NUM_BYTES_G- 1 downto 0)
TPD_Gtime := 1 ns
Definition: SspDeframer.vhd:32
in decErrInsl := '0'
Definition: SspDeframer.vhd:49
RST_POLARITY_Gsl := '0'
Definition: SspDeframer.vhd:33
K_SIZE_Ginteger := 2
Definition: SspDeframer.vhd:36
out eofsl
Definition: SspDeframer.vhd:53
in rstsl := RST_POLARITY_G
in rstsl := RST_POLARITY_G
Definition: SspDeframer.vhd:45
RST_POLARITY_Gsl := '0'
in validInsl := '1'
out validOutsl
out eofesl
Definition: SspDeframer.vhd:54
TPD_Gtime := 1 ns
out dataOutslv( 15 downto 0)
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
RST_ASYNC_Gboolean := true
in dataInslv( NUM_BYTES_G* 10- 1 downto 0)
out dataKOutslv( NUM_BYTES_G- 1 downto 0)
out validOutsl
Definition: SspDeframer.vhd:51
in rstsl :=not RST_POLARITY_G
SSP_IDLE_K_Gslv
Definition: SspDeframer.vhd:38
SSP_IDLE_CODE_Gslv
Definition: SspDeframer.vhd:37
in validInsl := '1'
RST_ASYNC_Gboolean := false
in dataInslv( 19 downto 0)
in dataInslv( WORD_SIZE_G- 1 downto 0)
Definition: SspDeframer.vhd:47
std_logic_vector slv
Definition: StdRtlPkg.vhd:29