An812 683855 666979
An812 683855 666979
Design Tutorial
Contents
2
683855 | 2018.04.02
Send Feedback
The procedures in this tutorial provide you with a template to design a system that
uses various test patterns to test an external memory device. The final system
contains the following components:
• A processor subsystem which contains an Intel Nios® II/e core. The subsystem
also includes an on-chip RAM to store the software code and a JTAG UART to
communicate and display the memory test results in the host PC's console.
• A memory tester subsystem to interact with an SDRAM controller.
• The memory tester subsystem consists of a pattern generator subsystem, a
pattern checker subsystem, a memory tester, a pattern writer, and a pattern
reader.
• The pattern generator subsystem consists of a custom pattern generator, a pseudo
random binary sequence (PRBS) pattern generator, along with a multiplexer (MUX)
to select between these two.
• A data pattern checker subsystem consisting of a custom pattern checker, a
pseudo random binary sequence (PRBS) pattern checker, along with a
demultiplexer (DEMUX).
• Pattern writer and pattern reader subsystems that interacts with the SDRAM
controller.
• A SDRAM controller to control the off-chip DDR SDRAM device under test.
Intel Corporation. All rights reserved. Intel, the Intel logo, and other Intel marks are trademarks of Intel
Corporation or its subsidiaries. Intel warrants performance of its FPGA and semiconductor products to current
specifications in accordance with Intel's standard warranty, but reserves the right to make changes to any ISO
products and services at any time without notice. Intel assumes no responsibility or liability arising out of the 9001:2015
application or use of any information, product, or service described herein except as expressly agreed to in Registered
writing by Intel. Intel customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
*Other names and brands may be claimed as the property of others.
Platform Designer System Design Tutorial
683855 | 2018.04.02
Onchip
RAM Pipeline JTAG
(Code Bridge UART
and Data)
Memory Tester
Data Pattern Generator Memory Master and Controller Data Pattern Checker
Pattern Checker
Select Pattern Writer Pattern Reader Select
(MUX) (DEMUX )
Custom Custom
Pattern Pattern
Generator Checker
SDRAM
Under Test
4
Platform Designer System Design Tutorial
683855 | 2018.04.02
Related Information
• Intel Quartus Prime Pro Edition Download Page
• Intel Arria 10 GX FPGA Development Kit
• Intel Arria 10 Board Test System
/complete_design The final design. You can use this design as a reference and guidance
while you follow the tutorial. You may also use the prebuilt systems in it
if you want to skip certain steps of this tutorial.
/memory_tester_ip The folder that contains source files for all custom components.
/software This folder contains source code for building Nios II software applications
and two scripts that automate this process for you.
5
Platform Designer System Design Tutorial
683855 | 2018.04.02
A10.qsf An Intel Quartus Prime Settings file (.qsf), containing pre-defined pin
assignments.
memory_tester_search_path.ipx IP Index file (.ipx) that specifies the path to the source files of the
custom components.
memory_tester_subsystem_bb.ipxact The .ipxact file that defines the interfaces for your generic component.
Related Information
• Platform Designer System Design Example
• Platform Designer System Design Example (.zip)
The top-level RTL, pin assignments, and timing constraints have been created for you.
The file references and pin assignments are saved in A10.qsf.
6
Platform Designer System Design Tutorial
683855 | 2018.04.02
3. Click Create. The resulting system comes pre-populated with a clock bridge and a
reset bridge.
7
Platform Designer System Design Tutorial
683855 | 2018.04.02
4. Right-click the name of the clock_in component and click Rename. Type
ext_clk.
5. In the parameter editor, change the Explicit clock rate to 100MHz (100,000).
6. Right-click the name of the reset_in component and click Rename. Type
ext_reset.
2. In the Confirm New System Filename dialog box, click the sysA subsystem
and rename it by typing cpu_subsystem.qsys.
3. Click OK.
8
Platform Designer System Design Tutorial
683855 | 2018.04.02
9
Platform Designer System Design Tutorial
683855 | 2018.04.02
1. Type clock in the search box of the IP Catalog and double-click Clock Bridge to
add that component.
2. Type reset in the search box of the IP Catalog and double-click Reset Bridge to
add that component.
3. Right-click the name of the clock bridge and click Rename. Type mem_clk to
rename the clock bridge.
4. Right-click the name of the reset bridge and click Rename. Type mem_reset to
rename the reset bridge.
5. To add a second clock bridge, type clock in the search box of the IP Catalog and
double-click Clock Bridge to add that component.
6. To add a second reset bridge type reset in the search box of the and double-click
Reset Bridge to add that component.
7. Right-click and rename the new clock bridge and reset bridge to cpu_clk and
cpu_reset, respectively.
8. Connect the out_clk signal of mem_clk to the clk signal of mem_reset.
9. Connect the out_clk signal of cpu_clk to the clk signal of cpu_reset.
10. Edit the exported interface by double-clicking the name in the Export column,
from the following table:
10
Platform Designer System Design Tutorial
683855 | 2018.04.02
1. Type nios in the search box of the IP Catalog and double-click Nios II
Processor.
2. In the Select an Implementation parameter editor, select the Nios II/e
processor.
3. To add the Nios II/e processor to the design, click Finish.
4. Right-click the name of the Nios II processor component and click Rename. Type
cpu to change the name.
5. In the Export column, double-click the entry corresponding to the Reset Output
for the cpu component and rename it cpu_jtag_debug_reset.
Errors regarding reset and exception slaves can be resolved after you add
connections.
11
Platform Designer System Design Tutorial
683855 | 2018.04.02
1. Type ram in the IP Catalog search box and double-click On-Chip Memory (RAM
or ROM).
2. In the On-Chip Memory (RAM or ROM) parameter editor, in the Size box, set
the Total memory size to 8192 bytes.
3. To add the On-Chip Memory (RAM or ROM) component to your design, click
Finish.
4. Right-click the name of the On-Chip Memory (RAM or ROM) component and
click Rename. Type onchip_ram to change the name.
5. Type jtag uart in the IP Catalog search box and double-click JTAG UART.
6. To add the JTAG UART component to your design with default settings, click
Finish.
7. Right-click the name of the JTAG UART component and click Rename. Type
jtag_uart to change the name.
8. Type pipeline bridge in the IP Catalog search box and double-click Avalon-
MM Pipeline Bridge.
9. In the Avalon-MM Pipeline Bridge parameter editor, change the following
settings:
• Set the Address width to 16.
• Set the Maximum pending read transactions to 1.
10. To add the Avalon-MM Pipeline Bridge to your design, click Finish.
11. Right-click the name of the Avalon-MM Pipeline Bridge component and click
Rename. Type pipeline_bridge to change the name.
12. In the Export column, double-click the entry that corresponds to the m0 signal for
the pipeline_bridge component and type master.
12
Platform Designer System Design Tutorial
683855 | 2018.04.02
All the required components are now included in this subsystem. Compare the settings
in your design with the following figure and make sure your components and exported
interfaces are named correctly.
Figure 11. Illustrated Clock and Reset Component Connections for cpu_subsystem
13
Platform Designer System Design Tutorial
683855 | 2018.04.02
mem_clk/out_clk pipeline_bridge/clk
cpu_clk/out_clk • cpu_reset/clk
• cpu/clk
• onchip_ram/clk1
• jtag_uart/clk
mem_reset/out_reset • cpu/reset
• onchip_ram/reset1
• jtag_uart/reset
• pipleline_bridge/reset
cpu_reset/out_reset • cpu/reset
• onchip_ram/reset1
• jtag_uart/reset
• pipleline_bridge/reset
cpu/data_master • onchip_ram/s1
• jtag_uart/avalon_jtag_slave
• pipleline_bridge/s0
cpu/instruction_master onchip_ram/s1
System Connectivity Error appears in the System Messages tab. To access this
tab, click View ➤ System Messages. The System Connectivity Error occurs
because when the base address of the Avalon-MM slaves are not assigned, which can
cause address overlap.
14
Platform Designer System Design Tutorial
683855 | 2018.04.02
Follow these steps to assign the Base address to the value shown in the following
figure. Click the “lock” icon to lock the address.
1. In the Base column, click the value for Avalon Memory Mapped Slave
(Description column) of the cpu component and type 12000.
2. Find the Avalon Memory Mapped Slave entry for the onchip_ram component
and type 10000 as the value in the Base column.
3. Find the Avalon Memory Mapped Slave entry for the jtag_uart component and
type 12800 as the value in the Base column.
15
Platform Designer System Design Tutorial
683855 | 2018.04.02
6. In the Vectors tab, set Reset vector memory and Exception vector memory
both to onchip_ram.s1 to resolve the error messages.
7. Click File ➤ Save to save the project. There is no need to generate the RTL for
the Platform Designer system at this time. Click Move up one level of hierarchy
to return to top_level.qsys system.
16
Platform Designer System Design Tutorial
683855 | 2018.04.02
system interconnect in a .qsys file under <project folder>. The RTL of each .ip
or .qsys file can be generated in isolation as it contains the full information required
to reproduce the state of the RTL. There are no unresolved dependencies between
files.
Platform Designer and Platform Designer (Standard) differ also differ in how they
handle IP files:
• Platform Designer requires that you include the .qsys file along with a list of .ip
files associated with that Platform Designer project. The Intel Quartus Prime Pro
Edition software manages this for you after you save your Platform Designer
project.
• The older Platform Designer (Standard) tool saves both component instantiation
and system interconnects in a .qsys file. When integrating a Platform Designer
(Standard) system to a Intel Quartus Prime project, you only need to include a
single Intel Quartus Prime IP file (.qip).
17
Platform Designer System Design Tutorial
683855 | 2018.04.02
The Presets tab displays a list of applications consisting of different protocols and
development kits. You can choose from the list and apply a pre-defined set of
parameters to the selected IP components. The DDR4 component from the list of
Presets implements a pre-configured module. Modify the following parameters to help
meet timing for this design:
1. Type external memory in the IP Catalog search box and double-click Arria 10
External Memory Interfaces to add it to the system.
2. In the Arria 10 External Memory Interfaces parameter editor, select the Arria
10 GX FPGA Development Kit with DDR4 HILO from the Preset library and
click Apply.
3. In the Clocks section of the General tab, change Memory clock frequency to
800MHz and the PLL reference clock frequency value to 100MHz.
18
Platform Designer System Design Tutorial
683855 | 2018.04.02
19
Platform Designer System Design Tutorial
683855 | 2018.04.02
20
Platform Designer System Design Tutorial
683855 | 2018.04.02
You can instantiate the memory tester subsystem as a generic component (an empty
entity with only interfaces defined). When integrating a memory tester subsystem
with a processor subsystem and an EMIF controller only the interfaces of the memory
tester subsystem are significant.
Instantiation of a generic component does not prevent the completion of other parts of
the design. This feature provides a lot of flexibility in the design, and is especially
beneficial for large and team-based designs. You need only verify that, when adding
the entity implementation, the entity interfaces match the interfaces defined for the
generic component.
21
Platform Designer System Design Tutorial
683855 | 2018.04.02
22
Platform Designer System Design Tutorial
683855 | 2018.04.02
Note: When implementing a generic component with the Blackbox option, you don’t have
to provide the HDL implementation during component instantiation. Simply customize
the interfaces and signals and generate an empty HDL file. Then, connect the generic
component to other components in Platform Designer, generate interconnects, and
finally, compile the project with this empty entity. When you finish the implementation
of the generic component, simply replace the generic component with the actual
implementation to complete the design. In other words, the generic component
functions as a placeholder for the actual component you plan to use.
Platform Designer provides many features to help you add interfaces and signals for a
generic component. The following steps, 1-11, showcase how to add signals manually,
by using Mirror or Clone, and how to change parameters. In the final steps, you are
going to import a complete interface definition from an .ipxact file.
23
Platform Designer System Design Tutorial
683855 | 2018.04.02
Platform Designer provides many ways to help you add interfaces easily and
efficiently.
1. Click View ➤ Component Instantiation.
2. Select the memory_tester_subsystem component. The instantiation
information appears in the Component Instantiation tab.
3. Click the Signals & Interfaces tab. You can add interfaces manually, Import
from an IP-XACT file, Mirror, or Clone from existing interfaces in the system.
4. Click << add interface>> and select Clock Input from the drop down list.
5. To change the name of the interface, in the Name field, type clk.
6. Click <<add signal>> and choose clk.
7. Repeat steps 4-6 to add a Reset Input interface and signal, and rename it
reset.
8. Click Apply.
Apart from clock and reset, the design also requires an Avalon-MM slave
interface to communicate with the processor subsystem. It could be tedious to add
Avalon-MM slave interface manually since there are address bus, data bus, and
many other parameter settings to configure. An easier way is to use the Mirror
feature.
9. Click Mirror and choose the master interface of cpu_subsystem to add a slave
interface.
24
Platform Designer System Design Tutorial
683855 | 2018.04.02
10. You can resolve the errors that appear in the Instantiation Messages box by
assigning Associated Clock and Associated Reset to the clk and reset
interfaces in the parameter editor.
25
Platform Designer System Design Tutorial
683855 | 2018.04.02
11. Locate the Maximum pending read transactions box under Pipelined
Transfers and change that value to 4.
12. Click Import and choose memory_tester_subsystem_bb.ipxact to add the
interfaces.
13. To complete the import step, click Apply.
26
Platform Designer System Design Tutorial
683855 | 2018.04.02
The Export tab allows you to export the interfaces and requirements to an .ipxact
or a _hw.tcl file, however, this feature is not used in this project.
27
Platform Designer System Design Tutorial
683855 | 2018.04.02
Figure 26. Create Platform Designer System Template and HDL Template Options
Related Information
Implement the Memory Tester Subsystem on page 31
ext_clk/out_clk • ext_reset/clk
• cpu_subsystem/cpu_clk
• emif_0/pll_ref_clk
ext_reset/out_reset • cpu_subsystem/cpu_reset
• cpu_subsystem/mem_reset
• memory_test_subsystem/reset
• emif_0/global_reset_n
cpu_subsystem/master • memory_test_subsystem/slave
cpu_subsystem/cpu_jtag_reset • cpu_subsystem/cpu_reset
• cpu_subsystem/mem_reset
• memory_test_subsystem/reset
• emif_0/global_reset_n
memory_test_subsystem/read_master • emif_0/ctrl_amm_0
memory_test_subsystem/write_master • emif_0/ctrl_amm_0
emif_0/emif_usr_clk • cpu_subsystem/mem_clk
• memory_test_subsystem/clk
emif_0/emif_usr_reset_n • cpu_subsystem/mem_reset
28
Platform Designer System Design Tutorial
683855 | 2018.04.02
If there are any errors, read the error message and fix the error.
1. Click File ➤ Save to save the top-level system.
2. Click Generate ➤ Generate HDL and click Generate to generate RTL for each
component, including components in the cpu_subsystem.
3. Close Platform Designer. New files appear in the in the Project Navigator ➤
Files tab in the Intel Quartus Prime project. You must add another file
memory_tester_subsystem.v. Adding this provides an empty entity for
memory_tester_subsystem so Intel Quartus Prime Pro Edition can elaborate
the hierarchy.
4. In the Tasks window, double-click Add/Remove Files in Project to open the
Settings dialog box.
5. To add an empty memory_tester_subsystem.v file, type
memory_tester_subsystem.v in the File name box.
6. Click Add.
29
Platform Designer System Design Tutorial
683855 | 2018.04.02
This design flow allows you to verify and debug DDR4 RAM calibration, while
maintaining the system structure, before finishing the implementation of the memory
tester subsystem.
Generic components fall into one of the three implementation types: IP, HDL, or
Blackbox. Each type is selectable by the corresponding button in the Component
Instantiation tab. All the _hw.tcl based IP components found in the IP Catalog,
such as On-chip Memory and External Memory Interfaces (EMIF), belong to the IP
type. If you want to add a custom component written in RTL, you can use the HDL
type and link the source files in the Component Instantiation tab.
30
Platform Designer System Design Tutorial
683855 | 2018.04.02
You typically perform this process as a member of a remote team with a need to
implement the memory tester subsystem. The remote team member receives a .qsys
file which serves as the requirement hand off for an implementation. This .qsys file
contains the details needed for designing a block for the larger design, without access
to the top level.
To implement the memory tester subsystem you must add components from the IP
Catalog to this Platform Designer project, make connections, and export interfaces to
match what is defined for the generic component. Once those processes are complete,
replace the generic component in the top level system with this subsystem
implementation.
31
Platform Designer System Design Tutorial
683855 | 2018.04.02
32
Platform Designer System Design Tutorial
683855 | 2018.04.02
The files listed in the Design Files topic contain two pre-built systems: a pattern
checker system, and a pattern generator system. These pre-built Platform Designer
systems appear in the IP Catalog in the System folder. The IP Catalog also contains a
list of available Memory Test Microcores. The source files of these custom IP cores are
located in <project folder>/memory_tester_ip. The
memory_tester_search_path.ipx file included in the project provides this path to
Platform Designer.
33
Platform Designer System Design Tutorial
683855 | 2018.04.02
To add these pre-built Platform Designer systems, complete the following steps:
1. In the IP Catalog, expand the System folder and double-click
pattern_checker_system to add the pattern checker component.
2. To add the component, click Finish.
3. To rename the pattern checker, right-click the system in the Name column and
type pattern_checker_subsystem.
4. In the IP Catalog, double-click pattern_generator_system to add the prebuilt
pattern generator component.
5. To add the component, click Finish.
6. To rename the pre-built pattern generator, right-click the system in the Name
column and type pattern_generator_subsystem.
7. In the IP Catalog, expand the Memory Test Microcores folder, and double-click
Pattern Writer.
8. In the Pattern Writer parameter editor, turn on Burst Enable.
9. To add the component, click Finish.
10. To rename the pattern writer component, right-click the system in the Name
column and type pattern_writer.
11. In the IP Catalog, double-click Pattern Reader.
12. In the Pattern Reader parameter editor, turn on Burst Enable.
13. Click Finish to add the component.
14. In the IP Catalog, double-click to begin adding a RAM Test Controller.
15. Click Finish to add the component.
Related Information
Download and Install the Tutorial Design Files on page 5
Export Signals, Set Base Address Assignments, and Connect Memory Tester
Interface Components
To export signals, set base address assignments, and connect components, perform
the following steps:
1. To export the Avalon Memory Mapped Master interface for Pattern Writer, in
the Export column double-click the row adjacent to the Avalon Memory
Mapped Master and type write_master.
2. To export the Avalon Memory Mapped Master interface for Pattern Reader, in
the Export column, double-click the row adjacent to the Avalon Memory
Mapped Master and type read_master.
3. Make connections for the system based on the following table:
34
Platform Designer System Design Tutorial
683855 | 2018.04.02
clk/out_clk • reset/clk
• mm_bridge/clk
• pattern_generator_subsystem/clk
• pattern_checker_subsystem/clk
• pattern_writer/clock
• pattern_reader/clock
• ram_test_controller/clock
reset/out_reset • mm_bridge/reset
• pattern_generator_subsystem/reset
• pattern_checker_subsystem/reset
• pattern_writer/reset
• pattern_reader/reset
• ram_test_controller/reset
mm_bridge/m0 • pattern_generator_subsystem/slave
• pattern_checker_subsystem/slave
• ram_test_controller/csr
pattern_generator_subsystem/st_data_out • pattern_writer/st_data
pattern_reader/st_data • pattern_checker_subsystem/st_data_in
ram_test_controller/read_command • pattern_reader/command
35
Platform Designer System Design Tutorial
683855 | 2018.04.02
Figure 32. Connections and Base Address Values for the memory_tester_sybsystem
36
Platform Designer System Design Tutorial
683855 | 2018.04.02
2. View the Interface Requirements list for missing items. What appears in the
figure indicates a missing slave interface of the pipeline bridge. Fix the missing
items by exporting the appropriate signal.
3. In the System Contents tab, double-click the entry in the Export column
corresponding to the s0 for the mm_bridge component and rename it to slave.
4. Re-examine the Interface Requirements tab. The Current System list contains
the slave interface with no green highlight. Next you resolve the different item
highlighted in blue.
37
Platform Designer System Design Tutorial
683855 | 2018.04.02
5. Click the signal name highlighted in blue to display more information in the
Parameter Differences pane. Typically, you change the Current System Value
to match the Interface Requirement Value by editing the parameters of that
component.
38
Platform Designer System Design Tutorial
683855 | 2018.04.02
39
Platform Designer System Design Tutorial
683855 | 2018.04.02
40
Platform Designer System Design Tutorial
683855 | 2018.04.02
ext_clk/out_clk • ext_reset/clk
• cpu_subsystem/cpu_clk
• emif_0/pll_ref_clk
ext_reset/out_reset • cpu_subsystem/cpu_reset
• cpu_subsystem/mem_reset
• memory_tester_subsystem/reset
• emif_0/global_reset_n
41
Platform Designer System Design Tutorial
683855 | 2018.04.02
cpu_subsystem/cpu_jtag_debug_reset • cpu_subsystem/cpu_reset
• cpu_subsystem/mem_reset
• memory_tester_subsystem/reset
• emif_0/global_reset_n
cpu_subsystem/master • memory_tester_subsystem/slave
memory_tester_subsystem/read_master • emif_0/ctrl_amm_0
memory_tester_subsystem/write_master • emif_0/ctrl_amm_0
emif_0/emif_usr_clk • cpu_subsystem/mem_clk
• memory_tester_subsystem/clk
emif_0/emif_usr_reset_n • cpu_subsystem/mem_reset
The files in included with this design are Verilog (.v) files, but you can also use VHDL
(.vhdl) in your design if you prefer.
Synchronize IP Results
When you synchronize IP files, Platform Designer checks IP file references.
1. In the Intel Quartus Prime Pro Edition, click Files in the Project Navigator and
browse to memory_tester_subsystem.v.
2. Delete the empty entity RTL memory_tester_subsystem.v since we now have
the actual memory_tester_subsystem implementation.
42
Platform Designer System Design Tutorial
683855 | 2018.04.02
4. Click OK and the Intel Quartus Prime Pro Edition synchronizes the file references.
5. Examine the Project Navigator and these new files appear:
6. Click Processing ➤ Start Compilation to compile the project. The Intel Quartus
Prime Pro Edition software may return missing file errors, for example:
"Instance ‘ abc|def|ghi ’ instantiates undefined entity ‘ xyz ’ "
This type of error is caused when an expected IP file is missing. Resolve it by
adding the xyz.ip file to the project.
43
Platform Designer System Design Tutorial
683855 | 2018.04.02
Hardware setup
First, you reprogram the clock generator chip on the board.
The default clock resource in this design runs at 133.33 MHz. Program the clock to run
at 100 MHz.
1. Connect the board to the host PC with a USB cable and apply power to the board.
2. Run the ClockController.exe executable that installs with the Dev Kit
package. This executable installs to <package installation folder>/
examples/board_test_system by default.
3. Click the Si5338(U26) tab.
4. Change the frequency setting for CLK3 to 100MHz.
5. Click Set.
44
Platform Designer System Design Tutorial
683855 | 2018.04.02
Related Information
Hardware and Software Requirements on page 5
The batch_script.sh script calls commands in Nios II EDS to build a board support
package and applications. The script then configures the FPGA with the A10.sof file
that you generate during Intel Quartus Prime software compilation, runs the software
applications, and establishes a terminal connection with the board. The test software
performs test sweeps, such as Walking Ones, Walking Zeros, and PRBS, on the SDRAM
and the output values appear in the command terminal.
45
Platform Designer System Design Tutorial
683855 | 2018.04.02
The <project folder>/software folder contains a rerun.sh script. You can run
this script when you already have the Nios II board support package and applications
built, and don’t need to build them again. This script downloads only the .sof file and
runs Nios II applications.
2018.04.02 Updated for terminology change from Qsys Pro to Platform Designer.
2018.05.04 Updated
46