SURF  1.0
SspEncoder12b14b.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SspEncoder12b14b.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  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(11 downto 0);
46  validOut : out sl;
47  readyOut : in sl := '1';
48  dataOut : out slv(13 downto 0));
49 
50 end entity SspEncoder12b14b;
51 
52 architecture rtl of SspEncoder12b14b is
53 
54  signal readyOutInt : sl;
55  signal framedData : slv(11 downto 0) := (others => '0');
56  signal framedDataK : slv(0 downto 0) := (others => '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 => 12,
70  K_SIZE_G => 1,
72  SSP_IDLE_K_G => "1",
74  SSP_SOF_K_G => "1",
76  SSP_EOF_K_G => "1")
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  Encoder12b14b_1 : entity work.Encoder12b14b
91  generic map (
92  TPD_G => TPD_G,
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 => readyOutInt,
105  dataOut => dataOut);
106 
107 end architecture rtl;
out dataOutslv( 13 downto 0)
SSP_SOF_K_Gslv
Definition: SspFramer.vhd:42
in validInsl
Definition: SspFramer.vhd:49
FLOW_CTRL_EN_Gboolean := false
in readyOutsl := '1'
out dataOutslv( 13 downto 0)
RST_POLARITY_Gsl := '0'
Definition: SspFramer.vhd:33
in rstsl := RST_POLARITY_G
Definition: SspFramer.vhd:48
SSP_EOF_CODE_Gslv
Definition: SspFramer.vhd:43
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
AUTO_FRAME_Gboolean := true
SSP_IDLE_K_Gslv
Definition: SspFramer.vhd:40
out dataKOutslv( K_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:57
FLOW_CTRL_EN_Gboolean := false
out dataOutslv( WORD_SIZE_G- 1 downto 0)
Definition: SspFramer.vhd:56
_library_ ieeeieee
FLOW_CTRL_EN_Gboolean := false
Definition: SspFramer.vhd:36
in rstsl := RST_POLARITY_G
in readyOutsl := '1'
RST_ASYNC_Gboolean := true
Definition: SspFramer.vhd:34
in sofsl := '0'
Definition: SspFramer.vhd:52
RST_POLARITY_Gsl := '0'
out validOutsl
Definition: SspFramer.vhd:54
in validInsl := '1'
AUTO_FRAME_Gboolean := true
Definition: SspFramer.vhd:35
SSP_IDLE_CODE_Gslv
Definition: SspFramer.vhd:39
in readyOutsl := '1'
Definition: SspFramer.vhd:55
RST_ASYNC_Gboolean := true
slv( 11 downto 0) := "000011111000" K_120_1_C
slv( 11 downto 0) := "010111111000" K_120_11_C
TPD_Gtime := 1 ns
Definition: SspFramer.vhd:32
TPD_Gtime := 1 ns
WORD_SIZE_Ginteger := 16
Definition: SspFramer.vhd:37
in dataInslv( 11 downto 0)
RST_ASYNC_Gboolean := false
K_SIZE_Ginteger := 2
Definition: SspFramer.vhd:38
in dataInslv( 11 downto 0)
in clksl
Definition: SspFramer.vhd:47
slv( 11 downto 0) := "000001111000" K_120_0_C
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
in rstsl :=not RST_POLARITY_G