SURF  1.0
SspEncoder10b12b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspEncoder10b12b.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  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(9 downto 0);
46  validOut : out sl;
47  readyOut : in sl := '1';
48  dataOut : out slv(11 downto 0));
49 
50 end entity SspEncoder10b12b;
51 
52 architecture rtl of SspEncoder10b12b is
53 
54  signal framedData : slv(9 downto 0);
55  signal framedDataK : slv(0 downto 0);
56  signal validInt : sl;
57  signal readyInt : sl;
58 
59 begin
60 
61  SspFramer_1 : entity work.SspFramer
62  generic map (
63  TPD_G => TPD_G,
68  WORD_SIZE_G => 10,
69  K_SIZE_G => 1,
71  SSP_IDLE_K_G => "1",
73  SSP_SOF_K_G => "1",
75  SSP_EOF_K_G => "1")
76  port map (
77  clk => clk,
78  rst => rst,
79  validIn => validIn,
80  readyIn => readyIn,
81  sof => sof,
82  eof => eof,
83  dataIn => dataIn,
84  dataOut => framedData,
85  validOut => validInt,
86  readyOut => readyInt,
87  dataKOut => framedDataK);
88 
89  Encoder10b12b_1 : entity work.Encoder10b12b
90  generic map (
91  TPD_G => TPD_G,
94  USE_CLK_EN_G => false,
96  port map (
97  clk => clk,
98  rst => rst,
99  validIn => validInt,
100  readyIn => readyInt,
101  dataIn => framedData,
102  dataKIn => framedDataK(0),
103  validOut => validOut,
104  readyOut => readyOut,
105  dataOut => dataOut);
106 
107 end architecture rtl;
SSP_SOF_K_Gslv
Definition: SspFramer.vhd:42
in validInsl
Definition: SspFramer.vhd:49
RST_POLARITY_Gsl := '0'
Definition: SspFramer.vhd:33
FLOW_CTRL_EN_Gboolean := false
slv( 9 downto 0) := "1010111100" K_28_21_C
in rstsl := RST_POLARITY_G
Definition: SspFramer.vhd:48
SSP_EOF_CODE_Gslv
Definition: SspFramer.vhd:43
FLOW_CTRL_EN_Gboolean := false
SSP_SOF_CODE_Gslv
Definition: SspFramer.vhd:41
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
in eofsl := '0'
Definition: SspFramer.vhd:53
SSP_EOF_K_Gslv
Definition: SspFramer.vhd:44
USE_CLK_EN_Gboolean := false
SSP_IDLE_K_Gslv
Definition: SspFramer.vhd:40
RST_ASYNC_Gboolean := true
out dataKOutslv( K_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:57
slv( 9 downto 0) := "0101011100" K_28_10_C
RST_POLARITY_Gsl := '0'
in readyOutsl := '1'
out dataOutslv( 11 downto 0)
out dataOutslv( WORD_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:56
slv( 9 downto 0) := "0001111100" K_28_3_C
FLOW_CTRL_EN_Gboolean := false
Definition: SspFramer.vhd:36
in validInsl := '1'
out dataOutslv( 11 downto 0)
RST_ASYNC_Gboolean := true
RST_ASYNC_Gboolean := true
Definition: SspFramer.vhd:34
in sofsl := '0'
Definition: SspFramer.vhd:52
out validOutsl
Definition: SspFramer.vhd:54
in dataInslv( 9 downto 0)
in rstsl := RST_POLARITY_G
AUTO_FRAME_Gboolean := true
Definition: SspFramer.vhd:35
SSP_IDLE_CODE_Gslv
Definition: SspFramer.vhd:39
in readyOutsl := '1'
Definition: SspFramer.vhd:55
in dataInslv( 9 downto 0)
_library_ ieeeieee
Definition: SspDeframer.vhd:20
TPD_Gtime := 1 ns
Definition: SspFramer.vhd:32
WORD_SIZE_Ginteger := 16
Definition: SspFramer.vhd:37
K_SIZE_Ginteger := 2
Definition: SspFramer.vhd:38
TPD_Gtime := 1 ns
in clksl
Definition: SspFramer.vhd:47
in rstsl :=not RST_POLARITY_G
in readyOutsl := '1'
AUTO_FRAME_Gboolean := true
std_logic_vector slv
Definition: StdRtlPkg.vhd:29