SURF  1.0
PgpSimModel.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : Pgp2bLane.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2009-05-27
5 -- Last update: 2017-03-28
6 -------------------------------------------------------------------------------
7 -- Description: Simulation Testbed for PGP
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 LIBRARY ieee;
19 use ieee.std_logic_1164.all;
20 use ieee.std_logic_arith.all;
21 use ieee.std_logic_unsigned.all;
22 
23 use work.StdRtlPkg.all;
24 use work.Pgp2bPkg.all;
25 use work.AxiStreamPkg.all;
26 use work.SsiPkg.all;
27 
28 --! @see entity
29  --! @ingroup protocols_pgp_pgp2b_core_simlink
30 entity PgpSimModel is
31  generic (
32  TPD_G : time := 1 ns;
33  LANE_CNT_G : integer range 1 to 2 := 1 -- Number of lanes, 1-2
34  );
35  port (
36 
37  -- System clock, reset & control
38  pgpTxClk : in sl;
40 
41  -- Non-VC related IO
44 
45  -- Tx Interface, 16-bits
47  pgpTxSlaves : out AxiStreamSlaveArray(3 downto 0);
48 
49  -- System clock, reset & control
50  pgpRxClk : in sl;
52 
53  -- Non-VC related IO
56 
57  -- Rx Interface, 16-bits, muxed and de-muxed copies
60 
61  -- AXI buffer status
62  pgpRxCtrl : in AxiStreamCtrlArray(3 downto 0)
63  );
64 
65 end PgpSimModel;
66 
67 
68 -- Define architecture
69 architecture PgpSimModel of PgpSimModel is
70 
75  signal deMuxedRxMasters : AxiStreamMasterArray(3 downto 0);
76  signal deMuxedRxSlaves : AxiStreamSlaveArray(3 downto 0);
77 
78 begin
79 
80  -- Fake transmit control signals
81  pgpTxOut.linkReady <= '1';
82 
83  -- Transmit MUX
84  U_TxMux : entity work.AxiStreamMux
85  generic map (
86  TPD_G => TPD_G,
87  NUM_SLAVES_G => 4
88  ) port map (
89  axisClk => pgpTxClk,
95  );
96 
97  -- Simulation link
98  U_Sim : entity work.AxiStreamSim
99  generic map (
100  TPD_G => TPD_G,
101  AXIS_CONFIG_G => SSI_PGP2B_CONFIG_C,
102  EOFE_TUSER_EN_G => true,
103  EOFE_TUSER_BIT_G => SSI_EOFE_C,
104  SOF_TUSER_EN_G => true,
105  SOF_TUSER_BIT_G => SSI_SOF_C
106  ) port map (
107  sAxisClk => pgpTxClk,
108  sAxisRst => pgpTxClkRst,
109  sAxisMaster => muxedTxMaster,
110  sAxisSlave => muxedTxSlave,
111  mAxisClk => pgpRxClk,
112  mAxisRst => pgpRxClkRst,
113  mAxisMaster => muxedRxMaster,
114  mAxisSlave => muxedRxSlave
115  );
116 
118  begin
119 
122 
124 
125  for i in 0 to 3 loop
126  deMuxedRxSlaves(i).tReady <= not pgpRxCtrl(i).pause;
128  end loop;
129 
130  end process;
131 
132  -- Receive De-MUX
133  U_RxDeMux : entity work.AxiStreamDeMux
134  generic map (
135  TPD_G => TPD_G,
136  NUM_MASTERS_G => 4
137  ) port map (
138  axisClk => pgpRxClk,
139  axisRst => pgpRxClkRst,
144  );
145 
146  -- Fake receive control signals
147  pgpRxOut.linkReady <= '1';
148  pgpRxOut.cellError <= '0';
149  pgpRxOut.linkDown <= '0';
150  pgpRxOut.linkError <= '0';
151  pgpRxOut.opCodeEn <= '0';
152  pgpRxOut.opCode <= (others=>'0');
153  pgpRxOut.remLinkReady <= '1';
154  pgpRxOut.remLinkData <= (others=>'0');
155  pgpRxOut.remOverFlow <= (others=>'0');
156 
157 end PgpSimModel;
158 
AxiStreamConfigType := ssiAxiStreamConfig( 2, TKEEP_COMP_C) SSI_PGP2B_CONFIG_C
Definition: Pgp2bPkg.vhd:32
AxiStreamSlaveType muxedTxSlave
Definition: PgpSimModel.vhd:72
TPD_Gtime := 1 ns
out pgpRxMasterMuxedAxiStreamMasterType
Definition: PgpSimModel.vhd:59
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
in pgpRxCtrlAxiStreamCtrlArray( 3 downto 0)
Definition: PgpSimModel.vhd:63
out pgpRxOutPgp2bRxOutType
Definition: PgpSimModel.vhd:55
std_logic sl
Definition: StdRtlPkg.vhd:28
integer := 1 SSI_SOF_C
Definition: SsiPkg.vhd:31
integer := 0 SSI_EOFE_C
Definition: SsiPkg.vhd:30
out mAxisMastersAxiStreamMasterArray( NUM_MASTERS_G- 1 downto 0)
AxiStreamMasterType muxedRxMaster
Definition: PgpSimModel.vhd:73
in pgpTxClkRstsl
Definition: PgpSimModel.vhd:39
in pgpTxMastersAxiStreamMasterArray( 3 downto 0)
Definition: PgpSimModel.vhd:46
AxiStreamSlaveType muxedRxSlave
Definition: PgpSimModel.vhd:74
out sAxisSlaveAxiStreamSlaveType
in pgpTxClksl
Definition: PgpSimModel.vhd:38
Pgp2bRxInType
Definition: Pgp2bPkg.vhd:55
in pgpTxInPgp2bTxInType
Definition: PgpSimModel.vhd:42
out mAxisMasterAxiStreamMasterType
NUM_SLAVES_Ginteger range 1 to 32:= 4
TPD_Gtime := 1 ns
Definition: PgpSimModel.vhd:32
in pgpRxClksl
Definition: PgpSimModel.vhd:50
sl linkDown
Definition: Pgp2bPkg.vhd:76
TPD_Gtime := 1 ns
in sAxisMastersAxiStreamMasterArray( NUM_SLAVES_G- 1 downto 0)
in sAxisMasterAxiStreamMasterType
_library_ ieeeieee
out pgpTxSlavesAxiStreamSlaveArray( 3 downto 0)
Definition: PgpSimModel.vhd:47
LANE_CNT_Ginteger range 1 to 2:= 1
Definition: PgpSimModel.vhd:34
slv( 7 downto 0) remLinkData
Definition: Pgp2bPkg.vhd:81
sl remLinkReady
Definition: Pgp2bPkg.vhd:80
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
in pgpRxInPgp2bRxInType
Definition: PgpSimModel.vhd:54
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
out sAxisSlavesAxiStreamSlaveArray( NUM_SLAVES_G- 1 downto 0)
out pgpTxOutPgp2bTxOutType
Definition: PgpSimModel.vhd:43
in pgpRxClkRstsl
Definition: PgpSimModel.vhd:51
AxiStreamSlaveArray( 3 downto 0) deMuxedRxSlaves
Definition: PgpSimModel.vhd:76
in mAxisSlavesAxiStreamSlaveArray( NUM_MASTERS_G- 1 downto 0)
sl linkReady
Definition: Pgp2bPkg.vhd:71
Pgp2bTxOutType
Definition: Pgp2bPkg.vhd:135
AxiStreamMasterType muxedTxMaster
Definition: PgpSimModel.vhd:71
sl opCodeEn
Definition: Pgp2bPkg.vhd:78
sl cellError
Definition: Pgp2bPkg.vhd:75
slv( 7 downto 0) opCode
Definition: Pgp2bPkg.vhd:79
in mAxisSlaveAxiStreamSlaveType
NUM_MASTERS_Ginteger range 1 to 32:= 12
Pgp2bRxOutType
Definition: Pgp2bPkg.vhd:69
out pgpRxMastersAxiStreamMasterArray( 3 downto 0)
Definition: PgpSimModel.vhd:58
sl linkError
Definition: Pgp2bPkg.vhd:77
AxiStreamMasterArray( 3 downto 0) deMuxedRxMasters
Definition: PgpSimModel.vhd:75