SURF  1.0
SrpV3Core.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : SrpV3Core.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2016-03-22
5 -- Last update: 2016-11-07
6 -------------------------------------------------------------------------------
7 -- Description: SLAC Register Protocol Version 3, AXI-Lite Interface
8 --
9 -- Documentation: https://confluence.slac.stanford.edu/x/cRmVD
10 --
11 -- Note: This module only supports 32-bit aligned addresses and 32-bit transactions.
12 -- For non 32-bit aligned addresses or non 32-bit transactions, use
13 -- the SrpV3Axi.vhd module with the AxiToAxiLite.vhd bridge
14 -------------------------------------------------------------------------------
15 -- This file is part of 'SLAC Firmware Standard Library'.
16 -- It is subject to the license terms in the LICENSE.txt file found in the
17 -- top-level directory of this distribution and at:
18 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
19 -- No part of 'SLAC Firmware Standard Library', including this file,
20 -- may be copied, modified, propagated, or distributed except according to
21 -- the terms contained in the LICENSE.txt file.
22 -------------------------------------------------------------------------------
23 
24 library ieee;
25 use ieee.std_logic_1164.all;
26 use ieee.std_logic_arith.all;
27 use ieee.std_logic_unsigned.all;
28 
29 use work.StdRtlPkg.all;
30 use work.AxiStreamPkg.all;
31 use work.SsiPkg.all;
32 use work.AxiLitePkg.all;
33 use work.SrpV3Pkg.all;
34 
35 --! @see entity
36  --! @ingroup protocols_srp
37 entity SrpV3Core is
38  generic (
39  TPD_G : time := 1 ns;
40  PIPE_STAGES_G : natural range 0 to 16 := 1;
41  FIFO_PAUSE_THRESH_G : positive range 1 to 511 := 256;
42  TX_VALID_THOLD_G : positive := 1;
43  SLAVE_READY_EN_G : boolean := false;
44  GEN_SYNC_FIFO_G : boolean := false;
45  ALTERA_SYN_G : boolean := false;
46  ALTERA_RAM_G : string := "M9K";
47  SRP_CLK_FREQ_G : real := 156.25E+6; -- units of Hz
48  AXI_STREAM_CONFIG_G : AxiStreamConfigType := ssiAxiStreamConfig(2);
49  UNALIGNED_ACCESS_G : boolean := false;
50  BYTE_ACCESS_G : boolean := false;
51  WRITE_EN_G : boolean := true; -- Write ops enabled
52  READ_EN_G : boolean := true -- Read ops enabled
53  );
54  port (
55  -- AXIS Slave Interface (sAxisClk domain)
56  sAxisClk : in sl;
57  sAxisRst : in sl;
61  -- AXIS Master Interface (mAxisClk domain)
62  mAxisClk : in sl;
63  mAxisRst : in sl;
66  -- Master AXI-Lite Interface (axilClk domain)
67  srpClk : in sl;
68  srpRst : in sl;
75 end SrpV3Core;
76 
77 architecture rtl of SrpV3Core is
78 
79  constant TIMEOUT_C : natural := (getTimeRatio(SRP_CLK_FREQ_G, 10.0) - 1); -- 100 ms timeout
80 
81  constant SRP_AXIS_CONFIG_C : AxiStreamConfigType := (
82  TSTRB_EN_C => false,
83  TDATA_BYTES_C => 4,
86  TKEEP_MODE_C => TKEEP_COMP_C,
87  TUSER_BITS_C => 2,
88  TUSER_MODE_C => TUSER_FIRST_LAST_C);
89 
90  type StateType is (
91  IDLE_S,
92  BLOWOFF_RX_S,
93  BLOWOFF_READ_DATA_S,
94  HDR_REQ_S,
95  HDR_RESP_S,
96  READ_S,
97  WRITE_S,
98  WAIT_ACK_S,
99  FOOTER_S);
100 
101  type RegType is record
102  timer : natural range 0 to TIMEOUT_C;
103  hdrCnt : slv(3 downto 0);
104  remVer : slv(7 downto 0);
105  timeoutSize : slv(7 downto 0);
106  timeoutCnt : slv(7 downto 0);
107  txnCnt : slv(29 downto 0);
108  memResp : slv(7 downto 0);
109  timeout : sl;
110  eofe : sl;
111  frameError : sl;
112  verMismatch : sl;
113  reqError : sl;
114  rxSlave : AxiStreamSlaveType;
115  txMaster : AxiStreamMasterType;
116  state : StateType;
120  end record RegType;
121  constant REG_INIT_C : RegType := (
122  timer => 0,
123  hdrCnt => (others => '0'),
124  remVer => (others => '0'),
125  timeoutSize => (others => '0'),
126  timeoutCnt => (others => '0'),
127  txnCnt => (others => '0'),
128  memResp => (others => '0'),
129  timeout => '0',
130  eofe => '0',
131  frameError => '0',
132  verMismatch => '0',
133  reqError => '0',
134  rxSlave => AXI_STREAM_SLAVE_INIT_C,
135  txMaster => axiStreamMasterInit(SRP_AXIS_CONFIG_C),
136  state => IDLE_S,
138  srpWrMaster => axiStreamMasterInit(SRP_AXIS_CONFIG_C),
140 
141  signal r : RegType := REG_INIT_C;
142  signal rin : RegType;
143 
144  signal sCtrl : AxiStreamCtrlType;
145  signal rxMaster : AxiStreamMasterType;
146  signal rxSlave : AxiStreamSlaveType;
147  signal rxCtrl : AxiStreamCtrlType;
148  signal txSlave : AxiStreamSlaveType;
149  signal srpRdMasterInt : AxiStreamMasterType;
150  signal srpRdSlaveInt : AxiStreamSlaveType;
151  signal srpWrMasterInt : AxiStreamMasterType;
152  signal srpWrSlaveInt : AxiStreamSlaveType;
153 
154  -- attribute dont_touch : string;
155  -- attribute dont_touch of r : signal is "TRUE";
156 
157 begin
158 
159  sAxisCtrl <= sCtrl;
160 
161  RX_FIFO : entity work.SsiFifo
162  generic map (
163  -- General Configurations
164  TPD_G => TPD_G,
165  EN_FRAME_FILTER_G => true,
168  VALID_THOLD_G => 0, -- = 0 = only when frame ready
169  -- FIFO configurations
170  BRAM_EN_G => true,
171  XIL_DEVICE_G => "7SERIES",
172  USE_BUILT_IN_G => false,
176  FIFO_ADDR_WIDTH_G => 9, -- 2kB/FIFO = 32-bits x 512 entries
177  CASCADE_SIZE_G => 3, -- 6kB = 3 FIFOs x 2 kB/FIFO
178  CASCADE_PAUSE_SEL_G => 2, -- Set pause select on top FIFO
179  FIFO_FIXED_THRESH_G => true,
181  -- AXI Stream Port Configurations
183  MASTER_AXI_CONFIG_G => SRP_AXIS_CONFIG_C)
184  port map (
185  -- Slave Port
186  sAxisClk => sAxisClk,
187  sAxisRst => sAxisRst,
190  sAxisCtrl => sCtrl,
191  -- Master Port
192  mAxisClk => srpClk,
193  mAxisRst => srpRst,
194  mAxisMaster => rxMaster,
195  mAxisSlave => rxSlave);
196 
197  GEN_SYNC_SLAVE : if (GEN_SYNC_FIFO_G = true) generate
198  rxCtrl <= sCtrl;
199  end generate;
200 
201  GEN_ASYNC_SLAVE : if (GEN_SYNC_FIFO_G = false) generate
202  Sync_Ctrl : entity work.SynchronizerVector
203  generic map (
204  TPD_G => TPD_G,
205  WIDTH_G => 2,
206  INIT_G => "11")
207  port map (
208  clk => srpClk,
209  rst => srpRst,
210  dataIn(0) => sCtrl.pause,
211  dataIn(1) => sCtrl.idle,
212  dataOut(0) => rxCtrl.pause,
213  dataOut(1) => rxCtrl.idle);
214  Sync_Overflow : entity work.SynchronizerOneShot
215  generic map (
216  TPD_G => TPD_G)
217  port map (
218  clk => srpClk,
219  rst => srpRst,
220  dataIn => sCtrl.overflow,
221  dataOut => rxCtrl.overflow);
222  end generate;
223 
224  comb : process (r, rxCtrl, rxMaster, srpAck, srpRdMasterInt, srpRst, srpWrSlaveInt, txSlave) is
225  variable v : RegType;
226  begin
227  -- Latch the current value
228  v := r;
229 
230  -- Set AxiStream defaults
231  v.rxSlave := AXI_STREAM_SLAVE_INIT_C;
232 
233  if txSlave.tReady = '1' then
234  v.txMaster.tValid := '0';
235  v.txMaster.tLast := '0';
236  v.txMaster.tUser := (others => '0');
237  end if;
238 
240 
241  if (srpWrSlaveInt.tReady = '1') then
242  v.srpWrMaster.tValid := '0';
243  v.txMaster.tLast := '0';
244  v.txMaster.tUser := (others => '0');
245  end if;
246 
247  -- Timer is freerunning
248  -- Reset to 0 when TIMEOUT_C reached
249  if r.timer = TIMEOUT_C then
250  v.timer := 0;
251  else
252  v.timer := r.timer + 1;
253  end if;
254 
255  -- State Machine
256  case r.state is
257  ----------------------------------------------------------------------
258  when IDLE_S =>
259  -- Reset error flags
260  v.memResp := (others => '0');
261  v.timeout := '0';
262  v.eofe := '0';
263  v.frameError := '0';
264  v.verMismatch := '0';
265  v.reqError := '0';
266 
267  -- Reset SRP request
269 
270  -- Reset other state registers
271  v.timeoutSize := (others => '0');
272  v.txnCnt := (others => '0');
273  v.hdrCnt := (others => '0');
274 
275  -- Check for overflow
276  if rxCtrl.overflow = '1' then
277  v.state := BLOWOFF_RX_S;
278 
279  -- Check for extra read data (possibly from previous interrupted txn)
280  elsif (srpRdMasterInt.tValid = '1') then
281  v.state := BLOWOFF_READ_DATA_S;
282 
283  -- Check for valid data
284  elsif rxMaster.tValid = '1' then
285  -- Check for SOF
286  if (ssiGetUserSof(SRP_AXIS_CONFIG_C, rxMaster) = '1') then
287  -- Ok to start processing the header
288  v.state := HDR_REQ_S;
289  else
290  -- Blowoff any RX data if no SOF
291  v.state := BLOWOFF_RX_S;
292  end if;
293  end if;
294 
295  ----------------------------------------------------------------------
296  when BLOWOFF_RX_S =>
297  -- Dump rx data until tLast seen
298  v.rxSlave.tReady := '1';
299  if rxMaster.tValid = '1' and rxMaster.tLast = '1' then
300  v.state := IDLE_S;
301  end if;
302 
303  ----------------------------------------------------------------------
304  when BLOWOFF_READ_DATA_S =>
305  -- Dump read data until tLast seen
306  v.srpRdSlave.tReady := '1';
307  if srpRdMasterInt.tValid = '1' and srpRdMasterInt.tLast = '1' then
308  v.state := IDLE_S;
309  end if;
310 
311  ----------------------------------------------------------------------
312  when HDR_REQ_S =>
313  -- Check for valid data
314  if rxMaster.tValid = '1' then
315  -- Accept the data
316  v.rxSlave.tReady := '1';
317 
318  -- Increment the header count
319  v.hdrCnt := r.hdrCnt + 1;
320 
321 
322  -- Check for tLast or EOFE
323  if rxMaster.tLast = '1' then
324  -- Set the flags
325  v.frameError := '1';
326  -- Next State
327  v.state := HDR_RESP_S;
328  end if;
329 
330  -- Latch the request header fields based on which header word we're on
331  case r.hdrCnt is
332  when X"0" =>
333  v.txMaster.tDest := rxMaster.tDest;
334  v.srpReq.remVer := rxMaster.tData(7 downto 0);
335  v.srpReq.opCode := rxMaster.tData(9 downto 8);
336  v.srpReq.spare := rxMaster.tData(23 downto 10);
337  v.timeoutSize := rxMaster.tData(31 downto 24);
338  when X"1" =>
339  v.srpReq.tid(31 downto 0) := rxMaster.tData(31 downto 0);
340  when X"2" =>
341  v.srpReq.addr(31 downto 0) := rxMaster.tData(31 downto 0);
342  when X"3" =>
343  v.srpReq.addr(63 downto 32) := rxMaster.tData(31 downto 0);
344  when X"4" =>
345  v.srpReq.reqSize(31 downto 0) := rxMaster.tData(31 downto 0);
346 
347  -- Reset frame error that might have been assigned above due to tLast
348  -- We expect tLast here
349  v.frameError := '0';
350  -- Check for no tLast
351  if (rxMaster.tLast = '0') then
352  -- Check for OP-codes that should have tLast
353  if (r.srpReq.opCode = SRP_NULL_C) or (r.srpReq.opCode = SRP_READ_C) then
354  -- Set the flags
355  v.frameError := '1';
356  end if;
357  else
358  -- Check for OP-codes that should NOT have tLast
360  -- Set the flags
361  v.frameError := '1';
362  end if;
363  end if;
364  -- Next State
365  v.hdrCnt := (others => '0');
366  v.state := HDR_RESP_S;
367 
368  when others => null;
369  end case;
370 
371  end if;
372 
373  ----------------------------------------------------------------------
374  when HDR_RESP_S =>
375  -- Check if ready to move data
376  if (v.txMaster.tValid = '0') then
377  -- Check for posted write
378  if r.srpReq.opCode /= SRP_POSTED_WRITE_C then
379  -- Set the flag
380  v.txMaster.tValid := '1';
381  end if;
382  -- Increment the counter
383  v.hdrCnt := r.hdrCnt + 1;
384  -- Check the counter
385  case (r.hdrCnt) is
386  when x"0" =>
387  -- Set SOF
388  ssiSetUserSof(SRP_AXIS_CONFIG_C, v.txMaster, '1');
389  -- Set data bus
390  v.txMaster.tData(7 downto 0) := SRP_VERSION_C;
391  v.txMaster.tData(9 downto 8) := r.srpReq.opCode;
392  v.txMaster.tData(23 downto 10) := r.srpReq.spare;
393  v.txMaster.tData(31 downto 24) := r.timeoutSize;
394  when x"1" =>
395  v.txMaster.tData(31 downto 0) := r.srpReq.tid(31 downto 0);
396  when x"2" =>
397  v.txMaster.tData(31 downto 0) := r.srpReq.addr(31 downto 0);
398  when x"3" =>
399  v.txMaster.tData(31 downto 0) := r.srpReq.addr(63 downto 32);
400  when others =>
401  v.txMaster.tData(31 downto 0) := r.srpReq.reqSize(31 downto 0);
402  -- Reset the counter
403  v.hdrCnt := x"0";
404  -- Check for NULL
405  if r.srpReq.opCode = SRP_NULL_C then
406  -- Next State
407  v.state := FOOTER_S;
408  end if;
409 
410  -- Check for framing error or EOFE
411  if (r.frameError = '1') or (r.eofe = '1') then
412  -- Next State
413  v.state := FOOTER_S;
414  end if;
415  -- Check for version mismatch
416  if r.srpReq.remVer /= SRP_VERSION_C then
417  -- Set the flags
418  v.verMismatch := '1';
419  -- Next State
420  v.state := FOOTER_S;
421  end if;
422  -- Check for invalid reqSize with respect to writes
423  if ((r.srpReq.opCode = SRP_WRITE_C) or (r.srpReq.opCode = SRP_POSTED_WRITE_C)) and
424  (r.srpReq.reqSize(31 downto 12) /= 0) then
425  -- Set the flags
426  v.reqError := '1';
427  -- Next State
428  v.state := FOOTER_S;
429  end if;
430 
431  -- Need to double check all the cases here
432  -- Check for non 32-bit transaction request
433  if (r.srpReq.opCode /= SRP_NULL_C) then
434  if BYTE_ACCESS_G = false and r.srpReq.reqSize(1 downto 0) /= "11" then
435  v.reqError := '1';
436  v.state := FOOTER_S;
437  end if;
438 
439  -- Check for non 32-bit address alignment
440  if BYTE_ACCESS_G = false and UNALIGNED_ACCESS_G = false and r.srpReq.addr(1 downto 0) /= 0 then
441  v.reqError := '1';
442  v.state := FOOTER_S;
443  end if;
444 
445  -- Check that request op is enabled
446  if (READ_EN_G = false and r.srpReq.opCode = SRP_READ_C) then
447  v.reqError := '1';
448  v.state := FOOTER_S;
449  end if;
450 
451  if (WRITE_EN_G = false and (r.srpReq.opCode = SRP_WRITE_C or r.srpReq.opCode = SRP_POSTED_WRITE_C)) then
452  v.reqError := '1';
453  v.state := FOOTER_S;
454  end if;
455  end if;
456 
457  -------------------------------------------------------------------------------
458 
459  -- If no error found above, procede with read or write request
460  if (v.state /= FOOTER_S) then
461  -- Issue an SRP request
462  v.srpReq.request := '1';
463 
464  -- Reset the timer
465  v.timer := 0;
466  v.timeoutCnt := (others => '0');
467 
468  -- Check for read
469  if r.srpReq.opCode = SRP_READ_C then
470  v.state := READ_S;
471 
472  -- Check for write
473  elsif (r.srpReq.opCode = SRP_WRITE_C or r.srpReq.opCode = SRP_POSTED_WRITE_C) then
474  v.state := WRITE_S;
475 
476  else
477  -- Redundant null check but more opcodes could be added later
478  v.state := FOOTER_S;
479  end if;
480  end if;
481  end case;
482  end if;
483 
484 
485  ----------------------------------------------------------------------
486  when READ_S =>
487  -- Send read data through to txMaster
488  if (srpRdMasterInt.tValid = '1' and v.txMaster.tValid = '0') then
489  v.srpRdSlave.tReady := '1';
490  v.txMaster.tValid := '1';
491 
492  -- Zero out data segments where tkeep not set
493  -- There must be a more elegant way to do this
494  for i in 3 downto 0 loop
495  if (srpRdMasterInt.tKeep(i) = '1') then
496  v.txMaster.tData((i+1)*8-1 downto i*8) := srpRdMasterInt.tData((i+1)*8-1 downto i*8);
497  else
498  v.txMaster.tData((i+1)*8-1 downto i*8) := (others => '0');
499  end if;
500  end loop;
501 
502 
503  -- Count each txn
504  -- If tLast before cntSize, eofe
505  -- if cntSize reached and no tlast, blead read data, eofe
506  v.txnCnt := r.txnCnt + 1;
507  if r.txnCnt = r.srpReq.reqSize(31 downto 2) and srpRdMasterInt.tLast = '1' then
508  -- Done when reqSize and tlast
509  v.state := WAIT_ACK_S;
510  elsif (srpRdMasterInt.tLast = '1') then
511  -- tLast too early
512  v.state := WAIT_ACK_S;
513  v.eofe := '1'; -- Should assign a memResp bit
514  elsif (r.txnCnt = r.srpReq.reqSize(31 downto 2)) then
515  -- No tLast when expected
516  v.state := FOOTER_S;
517  v.eofe := '1'; -- Should assign a memResp bit
518  end if;
519  end if;
520 
521 
522  -- Check if timer enabled
523  if r.timeoutSize /= 0 then
524  -- Check 100 ms timer
525  if r.timer = TIMEOUT_C then
526  -- Increment counter
527  v.timeoutCnt := r.timeoutCnt + 1;
528  -- Check the counter
529  if v.timeoutCnt = r.timeoutSize then
530  -- Set the flags
531  v.timeout := '1';
532  -- Next State
533  v.state := FOOTER_S;
534  end if;
535  end if;
536  end if;
537 
538  ----------------------------------------------------------------------
539  when WRITE_S =>
540  -- Check for valid data and both tx and srpWr ready
541  if (rxMaster.tValid = '1') and (v.txMaster.tValid = '0') and (v.srpWrMaster.tValid = '0')then
542  -- Accept the data
543  v.rxSlave.tReady := '1';
544 
545  -- Echo the write data back, but not if posted write
546  v.txMaster.tValid := toSl(r.srpReq.opCode /= SRP_POSTED_WRITE_C);
547  v.txMaster.tData(31 downto 0) := rxMaster.tData(31 downto 0);
548 
549  -- Set the write data bus
550  v.srpWrMaster.tValid := '1';
551  v.srpWrMaster.tData(31 downto 0) := rxMaster.tData(31 downto 0);
552  v.srpWrMaster.tLast := rxMaster.tLast;
553 
554  -- Set tkeep for last data word as it may not be a full word
555  if (rxMaster.tLast = '1') then
556  v.srpWrMaster.tKeep := genTKeep(conv_integer(r.srpReq.reqSize(1 downto 0))+1);
557  else
558  v.srpWrMaster.tKeep := genTKeep(4);
559  end if;
560 
561  -- Count each txn
562  -- If tLast before cntSize, frameError
563  -- if cntSize reached and no tlast, blead write data, frame error
564  v.txnCnt := r.txnCnt + 1;
565  if r.txnCnt = r.srpReq.reqSize(31 downto 2) and rxMaster.tLast = '1' then
566  -- Done when reqSize reached and tlast
567  v.state := WAIT_ACK_S;
568  elsif (r.txnCnt = r.srpReq.reqSize(31 downto 2) or rxMaster.tLast = '1') then
569  -- tLast too early or too late
570  -- Extra rxData will get blown off once IDLE_S state is reached
571  -- Due to missing SOF
572  v.state := WAIT_ACK_S;
573  v.frameError := '1';
574  end if;
575  end if;
576 
577 
578  -- Check if timer enabled
579  if r.timeoutSize /= 0 then
580  -- Check 100 ms timer
581  if r.timer = TIMEOUT_C then
582  -- Increment counter
583  v.timeoutCnt := r.timeoutCnt + 1;
584  -- Check the counter
585  if v.timeoutCnt = r.timeoutSize then
586  -- Set the flags
587  v.timeout := '1';
588  -- Next State
589  v.state := FOOTER_S;
590  end if;
591  end if;
592  end if;
593 
594 
595  ----------------------------------------------------------------------
596  when WAIT_ACK_S =>
597  -- Wait for final ack from downstream
598  if (srpAck.done = '1') then
599  v.srpReq.request := '0';
600  v.memResp := srpAck.respCode;
601  end if;
602 
603  -- Wait until both request and ack.done release before proceeding to footer
604  if (r.srpReq.request = '0' and srpAck.done = '0') then
605  v.state := FOOTER_S;
606  end if;
607 
608  -- Check if timer enabled
609  if r.timeoutSize /= 0 then
610  -- Check 100 ms timer
611  if r.timer = TIMEOUT_C then
612  -- Increment counter
613  v.timeoutCnt := r.timeoutCnt + 1;
614  -- Check the counter
615  if v.timeoutCnt = r.timeoutSize then
616  -- Set the flags
617  v.timeout := '1';
618  -- Next State
619  v.state := FOOTER_S;
620  end if;
621  end if;
622  end if;
623 
624  ----------------------------------------------------------------------
625  when FOOTER_S =>
626  -- Might have arrived here after timeout with request still pending
627  -- Release them now
628  v.srpReq.request := '0';
629 
630  -- Check if ready to move data
631  if (v.txMaster.tValid = '0') then
632  -- Check for posted write
633  if r.srpReq.opCode /= SRP_POSTED_WRITE_C then
634  -- Set the flags
635  v.txMaster.tValid := '1';
636  end if;
637  -- Set the footer data
638  v.txMaster.tLast := '1';
639  v.txMaster.tData(7 downto 0) := r.memResp;
640  v.txMaster.tData(8) := r.timeout;
641  v.txMaster.tData(9) := r.eofe;
642  v.txMaster.tData(10) := r.frameError;
643  v.txMaster.tData(11) := r.verMismatch;
644  v.txMaster.tData(12) := r.reqError;
645  v.txMaster.tData(31 downto 13) := (others => '0');
646  -- Next state
647  v.state := IDLE_S;
648  end if;
649 
650  end case;
651 
652  -- Update the EOFE flag
653  if (rxMaster.tLast = '1') and (v.rxSlave.tReady = '1') then
654  v.eofe := ssiGetUserEofe(SRP_AXIS_CONFIG_C, rxMaster);
655  end if;
656 
657  -- Reset
658  if (srpRst = '1') then
659  v := REG_INIT_C;
660  end if;
661 
662  -- Register the variable for next clock cycle
663  rin <= v;
664 
665  -- Outputs
666  rxSlave <= v.rxSlave;
667  srpReq <= r.srpReq;
668  srpRdSlaveInt <= v.srpRdSlave;
669  srpWrMasterInt <= r.srpWrMaster;
670 
671  end process comb;
672 
673  seq : process (srpClk) is
674  begin
675  if (rising_edge(srpClk)) then
676  r <= rin after TPD_G;
677  end if;
678  end process seq;
679 
680  TX_FIFO : entity work.AxiStreamFifoV2
681  generic map (
682  -- General Configurations
683  TPD_G => TPD_G,
685  SLAVE_READY_EN_G => true,
687  -- FIFO configurations
688  BRAM_EN_G => true,
689  XIL_DEVICE_G => "7SERIES",
690  USE_BUILT_IN_G => false,
694  CASCADE_SIZE_G => 1,
695  FIFO_ADDR_WIDTH_G => 9,
696  -- AXI Stream Port Configurations
697  SLAVE_AXI_CONFIG_G => SRP_AXIS_CONFIG_C,
699  port map (
700  -- Slave Port
701  sAxisClk => srpClk,
702  sAxisRst => srpRst,
703  sAxisMaster => r.txMaster,
704  sAxisSlave => txSlave,
705  -- Master Port
706  mAxisClk => mAxisClk,
707  mAxisRst => mAxisRst,
710 
711  -- Pipeline the rdData and wrData streams
712  U_AxiStreamPipeline_rdData : entity work.AxiStreamPipeline
713  generic map (
714  TPD_G => TPD_G,
715  PIPE_STAGES_G => 0)
716  port map (
717  axisClk => srpClk, -- [in]
718  axisRst => srpRst, -- [in]
719  sAxisMaster => srpRdMaster, -- [in]
720  sAxisSlave => srpRdSlave, -- [out]
721  mAxisMaster => srpRdMasterInt, -- [out]
722  mAxisSlave => srpRdSlaveInt); -- [in]
723 
724  U_AxiStreamPipeline_wrData : entity work.AxiStreamPipeline
725  generic map (
726  TPD_G => TPD_G,
727  PIPE_STAGES_G => 0)
728  port map (
729  axisClk => srpClk, -- [in]
730  axisRst => srpRst, -- [in]
731  sAxisMaster => srpWrMasterInt, -- [in]
732  sAxisSlave => srpWrSlaveInt, -- [out]
733  mAxisMaster => srpWrMaster, -- [out]
734  mAxisSlave => srpWrSlave); -- [in]
735 
736 end rtl;
SrpV3ReqType
Definition: SrpV3Pkg.vhd:46
TX_VALID_THOLD_Gpositive := 1
Definition: SrpV3Core.vhd:42
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
PIPE_STAGES_Gnatural range 0 to 16:= 0
natural range 0 to 8 TDEST_BITS_C
slv( 7 downto 0) remVer
Definition: SrpV3Pkg.vhd:48
ALTERA_RAM_Gstring := "M9K"
SLAVE_READY_EN_Gboolean := true
Definition: SsiFifo.vhd:36
in sAxisRstsl
Definition: SrpV3Core.vhd:57
ALTERA_RAM_Gstring := "M9K"
Definition: SrpV3Core.vhd:46
in srpClksl
Definition: SrpV3Core.vhd:67
PIPE_STAGES_Gnatural range 0 to 16:= 1
slv( 31 downto 0) reqSize
Definition: SrpV3Pkg.vhd:53
std_logic sl
Definition: StdRtlPkg.vhd:28
GEN_SYNC_FIFO_Gboolean := false
Definition: SrpV3Core.vhd:44
slv( 1 downto 0) opCode
Definition: SrpV3Pkg.vhd:49
out mAxisMasterAxiStreamMasterType
Definition: SsiFifo.vhd:69
FIFO_PAUSE_THRESH_Gpositive := 1
Definition: SsiFifo.vhd:52
BYTE_ACCESS_Gboolean := false
Definition: SrpV3Core.vhd:50
sl eofe
Definition: SsiPkg.vhd:74
SLAVE_READY_EN_Gboolean := false
Definition: SrpV3Core.vhd:43
SLAVE_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
Definition: SsiFifo.vhd:50
out sAxisSlaveAxiStreamSlaveType
in srpRdMasterAxiStreamMasterType
Definition: SrpV3Core.vhd:73
slv( 15 downto 0) tKeep
in mAxisRstsl
Definition: SrpV3Core.vhd:63
SLAVE_READY_EN_Gboolean := true
entity srp
Definition: SrpV3Core.vhd:37
slv( 1 downto 0) := "00" SRP_READ_C
Definition: SrpV3Pkg.vhd:41
natural range 1 to 16 TDATA_BYTES_C
SrpV3ReqType :=(request => '0',remVer =>( others => '0'),opCode =>( others => '0'),spare =>( others => '0'),tid =>( others => '0'),addr =>( others => '0'),reqSize =>( others => '0')) SRPV3_REQ_INIT_C
Definition: SrpV3Pkg.vhd:56
in mAxisSlaveAxiStreamSlaveType
in sAxisClksl
Definition: SsiFifo.vhd:58
GEN_SYNC_FIFO_Gboolean := false
ALTERA_SYN_Gboolean := false
Definition: SrpV3Core.vhd:45
PIPE_STAGES_Gnatural range 0 to 16:= 1
Definition: SrpV3Core.vhd:40
in mAxisSlaveAxiStreamSlaveType
Definition: SrpV3Core.vhd:65
UNALIGNED_ACCESS_Gboolean := false
Definition: SrpV3Core.vhd:49
TkeepModeType TKEEP_MODE_C
GEN_SYNC_FIFO_Gboolean := false
Definition: SsiFifo.vhd:45
XIL_DEVICE_Gstring := "7SERIES"
XIL_DEVICE_Gstring := "7SERIES"
Definition: SsiFifo.vhd:43
ALTERA_SYN_Gboolean := false
Definition: SsiFifo.vhd:46
VALID_THOLD_Gnatural := 1
Definition: SsiFifo.vhd:39
slv( 63 downto 0) addr
Definition: SrpV3Pkg.vhd:52
natural range 0 to 8 TID_BITS_C
out srpRdSlaveAxiStreamSlaveType
Definition: SrpV3Core.vhd:74
in rstsl :=not RST_POLARITY_G
slv( 127 downto 0) tData
_library_ ieeeieee
in sAxisClksl
Definition: SrpV3Core.vhd:56
FIFO_FIXED_THRESH_Gboolean := true
Definition: SsiFifo.vhd:51
in sAxisMasterAxiStreamMasterType
AxiStreamSlaveType :=(tReady => '0') AXI_STREAM_SLAVE_INIT_C
slv( 7 downto 0) respCode
Definition: SrpV3Pkg.vhd:67
slv( 7 downto 0) := x"03" SRP_VERSION_C
Definition: SrpV3Pkg.vhd:38
in mAxisClksl
Definition: SrpV3Core.vhd:62
BRAM_EN_Gboolean := true
in mAxisClksl
Definition: SsiFifo.vhd:67
BRAM_EN_Gboolean := true
Definition: SsiFifo.vhd:42
in sAxisMasterAxiStreamMasterType
Definition: SrpV3Core.vhd:58
boolean TSTRB_EN_C
USE_BUILT_IN_Gboolean := false
Definition: SsiFifo.vhd:44
in srpWrSlaveAxiStreamSlaveType
Definition: SrpV3Core.vhd:72
out sAxisCtrlAxiStreamCtrlType
Definition: SrpV3Core.vhd:60
in sAxisRstsl
Definition: SsiFifo.vhd:59
TUserModeType TUSER_MODE_C
slv( 127 downto 0) tUser
in srpRstsl
Definition: SrpV3Core.vhd:68
TPD_Gtime := 1 ns
Definition: SsiFifo.vhd:33
TPD_Gtime := 1 ns
READ_EN_Gboolean := true
Definition: SrpV3Core.vhd:53
natural range 0 to 8 TUSER_BITS_C
out mAxisMasterAxiStreamMasterType
out sAxisSlaveAxiStreamSlaveType
ALTERA_SYN_Gboolean := false
in mAxisSlaveAxiStreamSlaveType
Definition: SsiFifo.vhd:70
AXI_STREAM_CONFIG_GAxiStreamConfigType := ssiAxiStreamConfig( 2)
Definition: SrpV3Core.vhd:48
slv( 7 downto 0) tDest
FIFO_PAUSE_THRESH_Gpositive range 1 to 511:= 256
Definition: SrpV3Core.vhd:41
EN_FRAME_FILTER_Gboolean := true
Definition: SsiFifo.vhd:37
in sAxisMasterAxiStreamMasterType
out mAxisMasterAxiStreamMasterType
out srpWrMasterAxiStreamMasterType
Definition: SrpV3Core.vhd:71
SLAVE_AXI_CONFIG_GAxiStreamConfigType := SSI_CONFIG_INIT_C
Definition: SsiFifo.vhd:54
CASCADE_SIZE_Gpositive := 1
Definition: SsiFifo.vhd:48
sl done
Definition: SrpV3Pkg.vhd:66
slv( 1 downto 0) := "01" SRP_WRITE_C
Definition: SrpV3Pkg.vhd:42
out sAxisCtrlAxiStreamCtrlType
Definition: SsiFifo.vhd:62
ALTERA_RAM_Gstring := "M9K"
Definition: SsiFifo.vhd:47
out sAxisSlaveAxiStreamSlaveType
Definition: SrpV3Core.vhd:59
in mAxisSlaveAxiStreamSlaveType
CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
USE_BUILT_IN_Gboolean := false
in rstsl :=not RST_POLARITY_G
out srpReqSrpV3ReqType
Definition: SrpV3Core.vhd:69
out mAxisMasterAxiStreamMasterType
Definition: SrpV3Core.vhd:64
VALID_THOLD_Ginteger range 0 to ( 2** 24):= 1
slv( 1 downto 0) := "11" SRP_NULL_C
Definition: SrpV3Pkg.vhd:44
slv( 31 downto 0) tid
Definition: SrpV3Pkg.vhd:51
CASCADE_PAUSE_SEL_Gnatural := 0
Definition: SsiFifo.vhd:49
sl request
Definition: SrpV3Pkg.vhd:47
SrpV3AckType
Definition: SrpV3Pkg.vhd:65
PIPE_STAGES_Gnatural := 1
Definition: SsiFifo.vhd:35
MASTER_AXI_CONFIG_GAxiStreamConfigType := SSI_CONFIG_INIT_C
Definition: SsiFifo.vhd:55
in mAxisRstsl
Definition: SsiFifo.vhd:68
MASTER_AXI_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
WRITE_EN_Gboolean := true
Definition: SrpV3Core.vhd:51
in srpAckSrpV3AckType
Definition: SrpV3Core.vhd:70
TPD_Gtime := 1 ns
Definition: SrpV3Core.vhd:39
SRP_CLK_FREQ_Greal := 156.25E+6
Definition: SrpV3Core.vhd:47
slv( 1 downto 0) := "10" SRP_POSTED_WRITE_C
Definition: SrpV3Pkg.vhd:43
out sAxisSlaveAxiStreamSlaveType
Definition: SsiFifo.vhd:61
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
slv( 13 downto 0) spare
Definition: SrpV3Pkg.vhd:50
in sAxisMasterAxiStreamMasterType
Definition: SsiFifo.vhd:60