cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
tb_topFlash_Shell_Mmio.vhd
Go to the documentation of this file.
1 -- *******************************************************************************
2 -- * Copyright 2016 -- 2021 IBM Corporation
3 -- *
4 -- * Licensed under the Apache License, Version 2.0 (the "License");
5 -- * you may not use this file except in compliance with the License.
6 -- * You may obtain a copy of the License at
7 -- *
8 -- * http://www.apache.org/licenses/LICENSE-2.0
9 -- *
10 -- * Unless required by applicable law or agreed to in writing, software
11 -- * distributed under the License is distributed on an "AS IS" BASIS,
12 -- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 -- * See the License for the specific language governing permissions and
14 -- * limitations under the License.
15 -- *******************************************************************************
16 
17  -- ******************************************************************************
18  -- *
19  -- * cloudFPGA
20  -- *
21  -- *-----------------------------------------------------------------------------
22  -- *
23  -- * Title : Testbench for the Memory Mapped I/Os of the topFlash/SHELL. These
24  -- * I/Os are accessed via the Extended Memory I/F between the PSoC and FPGA.
25  -- * File : tb_topFlash_Shell_Mmio.vhd
26  -- *
27  -- * Created : Sep. 2017
28  -- * Authors : Francois Abel <fab@zurich.ibm.com>
29  -- * Alex Raimondi
30  -- *
31  -- * Devices : xcku060-ffva1156-2-i
32  -- * Tools : Vivado v2016.4 (64-bit)
33  -- * Depends : None
34  -- *
35  -- * Description : This testbench emulates the write/read of data to/from a EMIF
36  -- * interface of an FPGA assembeled on a FMKU2595 module. The tested design
37  -- * (i.e., topFlash) implements the top level design for the FLASH content of
38  -- * the FMKU60 module.
39  -- *
40  -- ******************************************************************************
41 
42  library IEEE;
43  use IEEE.STD_LOGIC_1164.ALL;
44  use IEEE.NUMERIC_STD.ALL;
45  library STD;
46  use STD.TEXTIO.ALL;
47 
48  library XIL_DEFAULTLIB;
49  use XIL_DEFAULTLIB.topFlash_pkg.all;
50 
51  -- Uncomment the following library declaration if instantiating
52  -- any Xilinx leaf cells in this code.
53  --library UNISIM;
54  --use UNISIM.VComponents.all;
55 
56 
57  --*************************************************************************
58  --** ENTITY
59  --*************************************************************************
61  -- Empty
63 
64 
65  --****************************************************************************
66  --** ARCHITECTURE
67  --****************************************************************************
68  architecture Behavioral of tb_topFlash_Shell_Mmio is
69 
70  --==========================================================================
71  -- CONSTANT DEFINITIONS
72  --==========================================================================
73 
74  -- Timing Constraints ------------------------------------------------------
75  constant cTREG : time := 1.0 ns;
76 
77  -- Clock Constraints -------------------------------------------------------
78  constant cEmifClkPeriod : time := 41.67 ns; -- 24.00 MHz
79  constant cUsr0ClkPeriod : time := 6.40 ns; -- 156.25 MHz
80  constant cUsr1ClkPeriod : time := 4.00 ns; -- 250.00 MHz
81  constant c10GeClkPeriod : time := 6.40 ns; -- 156.25 MHz
82  constant cMem0ClkPeriod : time := 3.33 ns; -- 300.00 MHz
83  constant cMem1ClkPeriod : time := 3.33 ns; -- 300.00 MHz
84 
85  -- MMIO Register Base and Offsets Addresses --------------------------------
86  constant cEMIF_CFG_REG_BASE : integer := 16#00#; -- Configuration Registers
87  constant cEMIF_PHY_REG_BASE : integer := 16#10#; -- Physical Registers
88  constant cEMIF_LY2_REG_BASE : integer := 16#20#; -- Layer-2 Registers
89  constant cEMIF_LY3_REG_BASE : integer := 16#30#; -- Layer-3 Registers
90  constant cEMIF_RES_REG_BASE : integer := 16#40#; -- Spare Registers
91  constant cEMIF_DIAG_REG_BASE : integer := 16#70#; -- Diagnostic Registers
92 
93  constant cEMIF_EXT_PAGE_BASE : integer := 16#80#; -- Extended Page Memory Base
94  constant cEMIF_EXT_PAGE_SIZE : integer := 16#04#; -- Extended Page Memory Size
95 
96  --==========================================================================
97  --== SIGNAL DECLARATIONS
98  --==========================================================================
99 
100  -- Virtual Emif Bus Clock --------------------------------------------------
101  -- (virtual because it remains internal to the PSoC)
102  signal sVirtBusClk : std_logic;
103  signal sVoid_n : std_logic;
104 
105  -- PSOC / FPGA Configuration Interface (Fcfg) ------------------------------
106  signal sPSOC_Fcfg_Reset_n : std_logic;
107 
108  -- PSOC / MMIO / External Memory Interface (Emif) ---------------------------------
109  signal sPSOC_Mmio_Clk : std_ulogic;
110  signal sPSOC_Mmio_Cs_n : std_ulogic;
111  signal sPSOC_Mmio_AdS_n : std_ulogic;
112  signal sPSOC_Mmio_We_n : std_ulogic;
113  signal sPSOC_Mmio_Oe_n : std_ulogic;
114  signal sPSOC_Mmio_Data : std_ulogic_vector(cFMKU60_MMIO_DataWidth-1 downto 0);
115  signal sPSOC_Mmio_Addr : std_ulogic_vector(cFMKU60_MMIO_AddrWidth-1 downto 0);
116 
117  -- LED / Heart Beat Interface ----------------------------------------------
118  signal sTOP_Led_HeartBeat: std_ulogic;
119 
120  -- A signal to control the testbench simulation ----------------------------
121  signal sTbRunCtrl : std_ulogic;
122 
123  -- CLKT / Clock Tree Inputs ------------------------------------------------
124  signal sCLKT_Usr0Clk_n : std_ulogic;
125  signal sCLKT_Usr0Clk_p : std_ulogic;
126  signal sCLKT_Usr1Clk_n : std_ulogic;
127  signal sCLKT_Usr1Clk_p : std_ulogic;
128  signal sCLKT_Mem0Clk_n : std_ulogic;
129  signal sCLKT_Mem0Clk_p : std_ulogic;
130  signal sCLKT_Mem1Clk_n : std_ulogic;
131  signal sCLKT_Mem1Clk_p : std_ulogic;
132  signal sCLKT_10GeClk_n : std_ulogic;
133  signal sCLKT_10GeClk_p : std_ulogic;
134 
135  ------------------------------------------------------------------
136  -- Prcd: Generate Clocks
137  ------------------------------------------------------------------
138  procedure pdGenClocks (
139  constant cT : in time;
140  signal sClock_n : out std_ulogic;
141  signal sClock_p : out std_ulogic;
142  signal sDoRun : in std_ulogic) is
143  begin
144  sClock_p <= '0';
145  sClock_n <= '1';
146  wait for cT / 4;
147  while (sDoRun) = '1' loop
148  sClock_p <= '0';
149  sClock_n <= '1';
150  wait for cT / 2;
151  sClock_p <= '1';
152  sClock_n <= '0';
153  wait for cT / 2;
154  end loop;
155  end procedure pdGenClocks;
156 
157 
158  begin -- of architecture
159 
160  ----------------------------------------------------------
161  -- INST: The toplevel to be tested
162  ----------------------------------------------------------
163  TOP: entity work.topFlash
164  generic map (
165  -- Synthesis parameters ----------------------
166  gBitstreamUsage => "flash",
167  gSecurityPriviledges => "super",
168  -- External Memory Interface (EMIF) ----------
169  gEmifAddrWidth => cFMKU60_MMIO_AddrWidth,
170  gEmifDataWidth => cFMKU60_MMIO_DataWidth
171  )
172  port map (
173  ------------------------------------------------------
174  -- PSOC / FPGA Configuration Interface (Fcfg)
175  -- System reset controlled by the PSoC.
176  ------------------------------------------------------
177  piPSOC_Fcfg_Rst_n => sPSOC_Fcfg_Reset_n,
178 
179  ------------------------------------------------------
180  -- CLKT / DRAM clocks 0 and 1 (Mem. Channels 0 and 1)
181  ------------------------------------------------------
182  piCLKT_Mem0Clk_n => sCLKT_Mem0Clk_n,
183  piCLKT_Mem0Clk_p => sCLKT_Mem0Clk_p,
184  piCLKT_Mem1Clk_n => sCLKT_Mem1Clk_n,
185  piCLKT_Mem1Clk_p => sCLKT_Mem1Clk_p,
186 
187  ------------------------------------------------------
188  -- CLKT / GTH clocks (10Ge, Sata, Gtio Interfaces)
189  ------------------------------------------------------
190  piCLKT_10GeClk_n => sCLKT_10GeClk_n,
191  piCLKT_10GeClk_p => sCLKT_10GeClk_p,
192 
193  ------------------------------------------------------
194  -- CLKT / User clocks 0 and 1 (156.25MHz, 250MHz)
195  ------------------------------------------------------
196  piCLKT_Usr0Clk_n => sCLKT_Usr0Clk_n,
197  piCLKT_Usr0Clk_p => sCLKT_Usr0Clk_p,
198  piCLKT_Usr1Clk_n => sCLKT_Usr1Clk_n,
199  piCLKT_Usr1Clk_p => sCLKT_Usr1Clk_p,
200 
201  ------------------------------------------------------
202  -- PSOC / External Memory Interface (Emif)
203  ------------------------------------------------------
204  piPSOC_Emif_Clk => sPSOC_Mmio_Clk,
205  piPSOC_Emif_Cs_n => sPSOC_Mmio_Cs_n,
206  piPSOC_Emif_We_n => sPSOC_Mmio_We_n,
207  piPSOC_Emif_Oe_n => sPSOC_Mmio_Oe_n,
208  piPSOC_Emif_AdS_n => sPSOC_Mmio_AdS_n,
209  piPSOC_Emif_Addr => sPSOC_Mmio_Addr,
210  pioPSOC_Emif_Data => sPSOC_Mmio_Data,
211 
212  ------------------------------------------------------
213  -- LED / Heart Beat Interface (Yellow LED)
214  ------------------------------------------------------
215  poTOP_Led_HeartBeat_n => sTOP_Led_HeartBeat,
216 
217  ------------------------------------------------------
218  -- DDR(4) / Memory Channel 0 Interface (Mc0)
219  ------------------------------------------------------
220  pioDDR_Top_Mc0_DmDbi_n => open,
221  pioDDR_Top_Mc0_Dq => open,
222  pioDDR_Top_Mc0_Dqs_p => open,
223  pioDDR_Top_Mc0_Dqs_n => open,
224  poTOP_Ddr4_Mc0_Act_n => open,
225  poTOP_Ddr4_Mc0_Adr => open,
226  poTOP_Ddr4_Mc0_Ba => open,
227  poTOP_Ddr4_Mc0_Bg => open,
228  poTOP_Ddr4_Mc0_Cke => open,
229  poTOP_Ddr4_Mc0_Odt => open,
230  poTOP_Ddr4_Mc0_Cs_n => open,
231  poTOP_Ddr4_Mc0_Ck_p => open,
232  poTOP_Ddr4_Mc0_Ck_n => open,
233  poTOP_Ddr4_Mc0_Reset_n => open,
234 
235  ------------------------------------------------------
236  -- DDR(4) / Memory Channel 1 Interface (Mc1)
237  ------------------------------------------------------
238  pioDDR_Top_Mc1_DmDbi_n => open,
239  pioDDR_Top_Mc1_Dq => open,
240  pioDDR_Top_Mc1_Dqs_p => open,
241  pioDDR_Top_Mc1_Dqs_n => open,
242  poTOP_Ddr4_Mc1_Act_n => open,
243  poTOP_Ddr4_Mc1_Adr => open,
244  poTOP_Ddr4_Mc1_Ba => open,
245  poTOP_Ddr4_Mc1_Bg => open,
246  poTOP_Ddr4_Mc1_Cke => open,
247  poTOP_Ddr4_Mc1_Odt => open,
248  poTOP_Ddr4_Mc1_Cs_n => open,
249  poTOP_Ddr4_Mc1_Ck_p => open,
250  poTOP_Ddr4_Mc1_Ck_n => open,
251  poTOP_Ddr4_Mc1_Reset_n => open,
252 
253  ------------------------------------------------------
254  -- ECON / Edge Connector Interface (SPD08-200)
255  ------------------------------------------------------
256  piECON_Top_10Ge0_n => '0',
257  piECON_Top_10Ge0_p => '1',
258  poTOP_Econ_10Ge0_n => open,
259  poTOP_Econ_10Ge0_p => open
260 
261  );
262 
263  -- COMB: Generate the virtual Emif Clock
264  ----------------------------------------------------------
265  pGenEmifClockComb : process is
266  begin
267  pdGenClocks(cEmifClkPeriod, sVoid_n, sVirtBusClk, sTbRunCtrl);
268  end process pGenEmifClockComb;
269 
270  ----------------------------------------------------------
271  -- COMB: Generate User 0 Clock
272  ----------------------------------------------------------
273  pGenUsr0ClockComb : process is
274  begin
275  pdGenClocks(cUsr0ClkPeriod, sCLKT_Usr0Clk_n, sCLKT_Usr0Clk_p, sTbRunCtrl);
276  end process pGenUsr0ClockComb;
277 
278  ----------------------------------------------------------
279  -- COMB: Generate User 1 Clock
280  ----------------------------------------------------------
281  pGenUsr1ClockComb : process is
282  begin
283  pdGenClocks(cUsr1ClkPeriod, sCLKT_Usr1Clk_n, sCLKT_Usr1Clk_p, sTbRunCtrl);
284  end process pGenUsr1ClockComb;
285 
286  ----------------------------------------------------------
287  -- COMB: Generate 10GE Clock
288  ----------------------------------------------------------
289  pGen10GeClockComb : process is
290  begin
291  pdGenClocks(c10GeClkPeriod, sCLKT_10GeClk_n, sCLKT_10GeClk_p, sTbRunCtrl);
292  end process pGen10GeClockComb;
293 
294  ----------------------------------------------------------
295  -- COMB: Generate DDR4 Memory 0 Clock
296  ----------------------------------------------------------
297  pGenMem0ClockComb : process is
298  begin
299  pdGenClocks(cMem0ClkPeriod, sCLKT_Mem0Clk_n, sCLKT_Mem0Clk_p, sTbRunCtrl);
300  end process pGenMem0ClockComb;
301 
302  ----------------------------------------------------------
303  -- COMB: Generate DDR4 Memory 1 Clock
304  ----------------------------------------------------------
305  pGenMem1ClockComb : process is
306  begin
307  pdGenClocks(cMem1ClkPeriod, sCLKT_Mem1Clk_n, sCLKT_Mem1Clk_p, sTbRunCtrl);
308  end process pGenMem1ClockComb;
309 
310  ----------------------------------------------------------
311  -- COMB: Main Simulation Process
312  ----------------------------------------------------------
313  pMainSimComb : process is
314 
315  -- Variables
316  variable vTbErrors : integer;
317 
318  -----------------------------------------------------
319  -- Prcd: Generate Emif Write Cycle
320  -----------------------------------------------------
321 -- procedure pdEmifWrite (
322  addr : in integer range 0 to (2**cFMKU60_MMIO_AddrWidth 1);
323  data : in integer range 0 to (2**cFMKU60_MMIO_DataWidth 1)
324  ) is
325  begin
326  wait until rising_edge(sVirtBusClk);
327  wait for cTREG;
328  sPSOC_Mmio_Addr <= std_ulogic_vector(to_unsigned(addr, cFMKU60_MMIO_AddrWidth));
329  wait until rising_edge(sVirtBusClk);
330  wait for cTREG;
331  sPSOC_Mmio_Clk <= '0';
332  sPSOC_Mmio_Cs_n <= '0';
333  sPSOC_Mmio_AdS_n <= '0';
334  sPSOC_Mmio_We_n <= '0';
335  sPSOC_Mmio_Oe_n <= '1';
336  sPSOC_Mmio_Data <= std_ulogic_vector(to_unsigned(data, cFMKU60_MMIO_DataWidth));
337  wait until falling_edge(sVirtBusClk);
338  wait for cTREG;
339  sPSOC_Mmio_Clk <= '1';
340  wait until rising_edge(sVirtBusClk);
341  wait for cTREG;
342  sPSOC_Mmio_Clk <= '0';
343  sPSOC_Mmio_Cs_n <= '1';
344  sPSOC_Mmio_AdS_n <= '1';
345  sPSOC_Mmio_We_n <= '1';
346  sPSOC_Mmio_Oe_n <= '1';
347  sPSOC_Mmio_Data <= (others => 'Z');
348  end procedure pdEmifWrite;
349 
350  -----------------------------------------------------
351  -- Prcd: Generate Emif Read Cycle
352  -----------------------------------------------------
353 - procedure pdEmifRead (
354  addr : in integer range 0 to (2**cFMKU60_MMIO_AddrWidth 1)
355  ) is
356  begin
357  wait until rising_edge(sVirtBusClk);
358  wait for cTREG;
359  sPSOC_Mmio_Clk <= '0';
360  sPSOC_Mmio_Addr <= std_ulogic_vector(to_unsigned(addr, cFMKU60_MMIO_AddrWidth));
361  sPSOC_Mmio_Cs_n <= '0';
362  sPSOC_Mmio_AdS_n <= '0';
363  sPSOC_Mmio_We_n <= '1';
364  sPSOC_Mmio_Oe_n <= '0';
365  wait until falling_edge(sVirtBusClk);
366  wait for cTREG;
367  sPSOC_Mmio_Clk <= '1';
368  wait until rising_edge(sVirtBusClk);
369  wait for cTREG;
370  sPSOC_Mmio_Clk <= '0';
371  sPSOC_Mmio_Cs_n <= '1';
372  sPSOC_Mmio_AdS_n <= '1';
373  sPSOC_Mmio_We_n <= '1';
374  sPSOC_Mmio_Oe_n <= '0';
375  wait until rising_edge(sVirtBusClk);
376  wait for cTREG;
377  sPSOC_Mmio_Oe_n <= '1' after cTREG;
378  end procedure pdEmifRead;
379 
380  -------------------------------------------------------------
381  -- Prdc: Compare the data bus signals with an expected value
382  -------------------------------------------------------------
383 - procedure pdAssessEmifData (
384  expectedVal: in integer range 0 to (2**cFMKU60_MMIO_DataWidth 1)
385  ) is
386  begin
387  if (expectedVal /= to_integer(unsigned(sPSOC_Mmio_Data))) then
388  report "[TbSimError] Data-Bus-Read = " & integer'image(to_integer(unsigned(sPSOC_Mmio_Data))) & " (0x" & to_hex_string(sPSOC_Mmio_Data) & ")" & " - Expected-Value = " & integer'image(expectedVal) & " (0x" & to_hex_string(to_signed(expectedVal,8)) & ")" severity ERROR;
389  vTbErrors := vTbErrors + 1;
390  end if;
391  end pdAssessEmifData;
392 
393 
394  -------------------------------------------------------------
395  -- Prdc: Report the number of errors
396  -------------------------------------------------------------
397  procedure pdReportErrors (
398  nbErrors : in integer
399  ) is
400  variable myLine : line;
401  begin
402  write(myLine, string'("*****************************************************************************"));
403  writeline(output, myLine);
404  if (nbErrors > 0) then
405  write(myLine, string'("** END of TESTBENCH - SIMULATION FAILED (KO): Total # error(s) = " ));
406  write(myLine, nbErrors);
407  elsif (nbErrors < 0) then
408  write(myLine, string'("** ABORTING TESTBENCH - FATAL ERROR (Please Check the Console)" ));
409  else
410  write(myLine, string'("** END of TESTBENCH - SIMULATION SUCCEEDED (OK): No Error."));
411  end if;
412  writeline(output, myLine);
413  write(myLine, string'("*****************************************************************************"));
414  writeline(output, myLine);
415 
416  if (nbErrors < 0) then
417  assert FALSE Report "Aborting simulation" severity FAILURE;
418  else
419  assert FALSE Report "Successful end of simulation" severity FAILURE;
420  end if;
421  end pdReportErrors;
422 
423  begin
424 
425  --========================================================================
426  --== STEP-1: INITIALISATION PHASE
427  --========================================================================
428 
429  -- Initialise the error counter
430  vTbErrors := 0;
431 
432  -- Start with sReset_n asserted and sTbRunCtrl disabled
433  sPSOC_Fcfg_Reset_n <= '0';
434  sTbRunCtrl <= '0';
435 
436  -- Set default signal levels
437  sPSOC_Mmio_Clk <= '0';
438  sPSOC_Mmio_Cs_n <= '1';
439  sPSOC_Mmio_AdS_n <= '1';
440  sPSOC_Mmio_We_n <= '1';
441  sPSOC_Mmio_Oe_n <= '1';
442  sPSOC_Mmio_Data <= (others => 'Z');
443  sPSOC_Mmio_Addr <= (others => '0');
444  wait for 50 ns;
445 
446  -- Release the reset
447  sPSOC_Fcfg_Reset_n <= '1';
448  wait for 25 ns;
449  sTbRunCtrl <= '1';
450  wait for 25 ns;
451 
452  -- Wait for 5us for the Shell clock to start running
453  wait for 5us;
454 
455 
456  --========================================================================
457  --== STEP-2: RETRIEVE THE EMIF / VITAL PRODUCT DATA
458  --========================================================================
459 
460  -- Read EMIF_CFG_VPD[0] Register (EmifId) --------------------------------
461  pdEmifRead(cEMIF_CFG_REG_BASE+0);
462  pdAssessEmifData(16#3D#);
463  wait for 5 ns;
464  -- Read EMIFI_CFG_VPD[1] Register (VersionId) ----------------------------
465  pdEmifRead(cEMIF_CFG_REG_BASE+1);
466  pdAssessEmifData(16#01#);
467  wait for 50 ns;
468  -- Read EMIFI_CFG_VPD[2] Register (ReversionId) --------------------------
469  pdEmifRead(cEMIF_CFG_REG_BASE+2);
470  pdAssessEmifData(16#00#);
471  wait for 50 ns;
472  -- Read EMIFI_CFG_VPD[3] Register (Reserved) -----------------------------
473  pdEmifRead(cEMIF_CFG_REG_BASE+3);
474  pdAssessEmifData(16#00#);
475  wait for 50 ns;
476 
477  --========================================================================
478  --== STEP-3: TEST READING and WRITING the DIAGNOSTIC SCRATCH REGISTERS
479  --========================================================================
480 
481  -- Write cycles ----------------------------------------------------------
482  for i in 0 to 3 loop
483  pdEmifWrite(cEMIF_DIAG_REG_BASE+i, i);
484  wait for 5 ns;
485  end loop;
486 
487  -- Read cycles -----------------------------------------------------------
488  for i in 0 to 3 loop
489  pdEmifRead(cEMIF_DIAG_REG_BASE+i);
490  pdAssessEmifData(i);
491  wait for 5 ns;
492  end loop;
493 
494  -- Write cycles ----------------------------------------------------------
495  for i in 0 to 3 loop
496  pdEmifWrite(cEMIF_DIAG_REG_BASE+i, i+4);
497  wait for 5 ns;
498  end loop;
499 
500  -- Read cycles -----------------------------------------------------------
501  for i in 0 to 3 loop
502  pdEmifRead(cEMIF_DIAG_REG_BASE+i);
503  pdAssessEmifData(i+4);
504  wait for 5 ns;
505  end loop;
506 
507  -- Write cycles ----------------------------------------------------------
508  for i in 0 to 3 loop
509  pdEmifWrite(cEMIF_DIAG_REG_BASE+i, 255-i);
510  wait for 5 ns;
511  end loop;
512 
513  -- Read cycles -----------------------------------------------------------
514  for i in 0 to 3 loop
515  pdEmifRead(cEMIF_DIAG_REG_BASE+i);
516  pdAssessEmifData(255-i);
517  wait for 5 ns;
518  end loop;
519 
520  --========================================================================
521  --== STEP-4: TEST READING and WRITING the EXTENDED PAGE MEMORY
522  --========================================================================
523 
524  -- Write cycles ----------------------------------------------------------
525  for i in 0 to cEMIF_EXT_PAGE_SIZE-1 loop
526  pdEmifWrite(cEMIF_EXT_PAGE_BASE+i, i);
527  wait for 5 ns;
528  end loop;
529 
530  -- Read cycles -----------------------------------------------------------
531  for i in 0 to cEMIF_EXT_PAGE_SIZE-1 loop
532  pdEmifRead(cEMIF_EXT_PAGE_BASE+i);
533  pdAssessEmifData(i);
534  wait for 5 ns;
535  end loop;
536 
537  -- Write cycles ----------------------------------------------------------
538  for i in 0 to cEMIF_EXT_PAGE_SIZE-1 loop
539  pdEmifWrite(cEMIF_EXT_PAGE_BASE+i, cEMIF_EXT_PAGE_SIZE-1-i);
540  wait for 5 ns;
541  end loop;
542 
543  -- Read cycles -----------------------------------------------------------
544  for i in 0 to cEMIF_EXT_PAGE_SIZE-1 loop
545  pdEmifRead(cEMIF_EXT_PAGE_BASE+i);
546  pdAssessEmifData(cEMIF_EXT_PAGE_SIZE-1-i);
547  wait for 5 ns;
548  end loop;
549 
550  --========================================================================
551  --== STEP-5: TRY READING VITAL PRODUCT DATA A SECOND TIME
552  --========================================================================
553  -- Read EMIF_CFG_VPD[0] Register (EmifId) --------------------------------
554  pdEmifRead(cEMIF_CFG_REG_BASE+0);
555  pdAssessEmifData(16#3D#);
556  wait for 5 ns;
557  -- Read EMIFI_CFG_VPD[1] Register (VersionId) ----------------------------
558  pdEmifRead(cEMIF_CFG_REG_BASE+1);
559  pdAssessEmifData(16#01#);
560  wait for 50 ns;
561  -- Read EMIFI_CFG_VPD[2] Register (ReversionId) --------------------------
562  pdEmifRead(cEMIF_CFG_REG_BASE+2);
563  pdAssessEmifData(16#00#);
564  wait for 50 ns;
565  -- Read EMIFI_CFG_VPD[3] Register (Reserved) -----------------------------
566  pdEmifRead(cEMIF_CFG_REG_BASE+3);
567  pdAssessEmifData(16#00#);
568  wait for 50 ns;
569 
570  --========================================================================
571  --== STEP-6: DONE
572  --========================================================================
573  wait for 50 ns;
574  sTbRunCtrl <= '0';
575  wait for 50 ns;
576 
577  -- End of tb --> Report errors
578  pdReportErrors(vTbErrors);
579 
580  end process pMainSimComb;
581 
582  end Behavioral;