SURF  1.0
SspEncoder8b10b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspEncoder8b10b.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2014-07-14
5 -- Last update: 2017-05-05
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 SspEncoder8b10b is
31 
32  generic (
33  TPD_G : time := 1 ns;
34  RST_POLARITY_G : sl := '0';
35  RST_ASYNC_G : boolean := true;
36  AUTO_FRAME_G : boolean := true;
37  FLOW_CTRL_EN_G : boolean := false);
38  port (
39  clk : in sl;
41  validIn : in sl;
42  readyIn : out sl;
43  sof : in sl := '0';
44  eof : in sl := '0';
45  dataIn : in slv(15 downto 0);
46  validOut : out sl;
47  readyOut : in sl := '1';
48  dataOut : out slv(19 downto 0));
49 
50 end entity SspEncoder8b10b;
51 
52 architecture rtl of SspEncoder8b10b is
53 
54  signal readyOutInt : sl;
55  signal framedData : slv(15 downto 0);
56  signal framedDataK : slv(1 downto 0);
57  signal validInt : sl;
58  signal readyInt : sl;
59 
60 begin
61 
62  SspFramer_1 : entity work.SspFramer
63  generic map (
64  TPD_G => TPD_G,
69  WORD_SIZE_G => 16,
70  K_SIZE_G => 2,
71  SSP_IDLE_CODE_G => D_10_2_C & K_28_5_C ,
72  SSP_IDLE_K_G => "01",
73  SSP_SOF_CODE_G => D_10_2_C & K_23_7_C ,
74  SSP_SOF_K_G => "01",
75  SSP_EOF_CODE_G => D_10_2_C & K_29_7_C ,
76  SSP_EOF_K_G => "01")
77  port map (
78  clk => clk,
79  rst => rst,
80  validIn => validIn,
81  readyIn => readyIn,
82  sof => sof,
83  eof => eof,
84  dataIn => dataIn,
85  validOut => validInt,
86  readyOut => readyInt,
87  dataOut => framedData,
88  dataKOut => framedDataK);
89 
90  Encoder8b10b_1 : entity work.Encoder8b10b
91  generic map (
92  TPD_G => TPD_G,
93  NUM_BYTES_G => 2,
97  port map (
98  clk => clk,
99  rst => rst,
100  validIn => validInt,
101  readyIn => readyInt,
102  dataIn => framedData,
103  dataKIn => framedDataK,
104  validOut => validOut,
105  readyOut => readyOutInt,
106  dataOut => dataOut);
107 
108 end architecture rtl;
NUM_BYTES_Gpositive := 2
RST_POLARITY_Gsl := '0'
SSP_SOF_K_Gslv
Definition: SspFramer.vhd:42
in validInsl
Definition: SspFramer.vhd:49
RST_POLARITY_Gsl := '0'
Definition: SspFramer.vhd:33
in readyOutsl := '1'
in rstsl := RST_POLARITY_G
Definition: SspFramer.vhd:48
SSP_EOF_CODE_Gslv
Definition: SspFramer.vhd:43
in dataInslv( NUM_BYTES_G* 8- 1 downto 0)
_library_ ieeeieee
SSP_SOF_CODE_Gslv
Definition: SspFramer.vhd:41
out readyInsl
out readyInsl
Definition: SspFramer.vhd:50
std_logic sl
Definition: StdRtlPkg.vhd:28
in dataInslv( WORD_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:51
_library_ IEEEIEEE
Definition: StdRtlPkg.vhd:18
TPD_Gtime := 1 ns
in eofsl := '0'
Definition: SspFramer.vhd:53
FLOW_CTRL_EN_Gboolean := false
SSP_EOF_K_Gslv
Definition: SspFramer.vhd:44
in readyOutsl := '1'
SSP_IDLE_K_Gslv
Definition: SspFramer.vhd:40
AUTO_FRAME_Gboolean := true
out dataKOutslv( K_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:57
out dataOutslv( WORD_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:56
out dataOutslv( 19 downto 0)
FLOW_CTRL_EN_Gboolean := false
Definition: SspFramer.vhd:36
RST_POLARITY_Gsl := '0'
in rstsl := RST_POLARITY_G
out dataOutslv( NUM_BYTES_G* 10- 1 downto 0)
RST_ASYNC_Gboolean := true
Definition: SspFramer.vhd:34
in sofsl := '0'
Definition: SspFramer.vhd:52
out validOutsl
Definition: SspFramer.vhd:54
RST_ASYNC_Gboolean := true
out validOutsl
FLOW_CTRL_EN_Gboolean := false
AUTO_FRAME_Gboolean := true
Definition: SspFramer.vhd:35
SSP_IDLE_CODE_Gslv
Definition: SspFramer.vhd:39
TPD_Gtime := 1 ns
in readyOutsl := '1'
Definition: SspFramer.vhd:55
RST_ASYNC_Gboolean := true
TPD_Gtime := 1 ns
Definition: SspFramer.vhd:32
WORD_SIZE_Ginteger := 16
Definition: SspFramer.vhd:37
in rstsl :=not RST_POLARITY_G
K_SIZE_Ginteger := 2
Definition: SspFramer.vhd:38
in clksl
Definition: SspFramer.vhd:47
in validInsl := '1'
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
in dataKInslv( NUM_BYTES_G- 1 downto 0)
in dataInslv( 15 downto 0)