Visible to Intel only — GUID: hco1416492341793
Ixiasoft
1. Functional Description—UniPHY
2. Functional Description— Intel® MAX® 10 EMIF IP
3. Functional Description—Hard Memory Interface
4. Functional Description—HPS Memory Controller
5. Functional Description—HPC II Controller
6. Functional Description—QDR II Controller
7. Functional Description—RLDRAM II Controller
8. Functional Description—RLDRAM 3 PHY-Only IP
9. Functional Description—Example Designs
10. Introduction to UniPHY IP
11. Latency for UniPHY IP
12. Timing Diagrams for UniPHY IP
13. External Memory Interface Debug Toolkit
14. Upgrading to UniPHY-based Controllers from ALTMEMPHY-based Controllers
1.1. I/O Pads
1.2. Reset and Clock Generation
1.3. Dedicated Clock Networks
1.4. Address and Command Datapath
1.5. Write Datapath
1.6. Read Datapath
1.7. Sequencer
1.8. Shadow Registers
1.9. UniPHY Interfaces
1.10. UniPHY Signals
1.11. PHY-to-Controller Interfaces
1.12. Using a Custom Controller
1.13. AFI 3.0 Specification
1.14. Register Maps
1.15. Ping Pong PHY
1.16. Efficiency Monitor and Protocol Checker
1.17. UniPHY Calibration Stages
1.18. Document Revision History
1.7.1.1. Nios® II-based Sequencer Function
1.7.1.2. Nios® II-based Sequencer Architecture
1.7.1.3. Nios® II-based Sequencer SCC Manager
1.7.1.4. Nios® II-based Sequencer RW Manager
1.7.1.5. Nios® II-based Sequencer PHY Manager
1.7.1.6. Nios® II-based Sequencer Data Manager
1.7.1.7. Nios® II-based Sequencer Tracking Manager
1.7.1.8. Nios® II-based Sequencer Processor
1.7.1.9. Nios® II-based Sequencer Calibration and Diagnostics
1.17.1. Calibration Overview
1.17.2. Calibration Stages
1.17.3. Memory Initialization
1.17.4. Stage 1: Read Calibration Part One—DQS Enable Calibration and DQ/DQS Centering
1.17.5. Stage 2: Write Calibration Part One
1.17.6. Stage 3: Write Calibration Part Two—DQ/DQS Centering
1.17.7. Stage 4: Read Calibration Part Two—Read Latency Minimization
1.17.8. Calibration Signals
1.17.9. Calibration Time
4.1. Features of the SDRAM Controller Subsystem
4.2. SDRAM Controller Subsystem Block Diagram
4.3. SDRAM Controller Memory Options
4.4. SDRAM Controller Subsystem Interfaces
4.5. Memory Controller Architecture
4.6. Functional Description of the SDRAM Controller Subsystem
4.7. SDRAM Power Management
4.8. DDR PHY
4.9. Clocks
4.10. Resets
4.11. Port Mappings
4.12. Initialization
4.13. SDRAM Controller Subsystem Programming Model
4.14. Debugging HPS SDRAM in the Preloader
4.15. SDRAM Controller Address Map and Register Definitions
4.16. Document Revision History
10.7.1. DDR2, DDR3, and LPDDR2 Resource Utilization in Arria V Devices
10.7.2. DDR2 and DDR3 Resource Utilization in Arria II GZ Devices
10.7.3. DDR2 and DDR3 Resource Utilization in Stratix III Devices
10.7.4. DDR2 and DDR3 Resource Utilization in Stratix IV Devices
10.7.5. DDR2 and DDR3 Resource Utilization in Arria V GZ and Stratix V Devices
10.7.6. QDR II and QDR II+ Resource Utilization in Arria V Devices
10.7.7. QDR II and QDR II+ Resource Utilization in Arria II GX Devices
10.7.8. QDR II and QDR II+ Resource Utilization in Arria II GZ, Arria V GZ, Stratix III, Stratix IV, and Stratix V Devices
10.7.9. RLDRAM II Resource Utilization in Arria® V Devices
10.7.10. RLDRAM II Resource Utilization in Arria® II GZ, Arria® V GZ, Stratix® III, Stratix® IV, and Stratix® V Devices
13.1. User Interface
13.2. Setup and Use
13.3. Operational Considerations
13.4. Troubleshooting
13.5. Debug Report for Arria V and Cyclone V SoC Devices
13.6. On-Chip Debug Port for UniPHY-based EMIF IP
13.7. Example Tcl Script for Running the Legacy EMIF Debug Toolkit
13.8. Document Revision History
Visible to Intel only — GUID: hco1416492341793
Ixiasoft
13.6.5. Example C Code for Accessing Debug Data
A typical use of the EMIF On-Chip Debug Port might be to recalibrate the external memory interface, and then access the reports directly using the summary_report_ptr, cal_report_ptr, and margin_report_ptr pointers, which are part of the debug data structure.
The following code sample illustrates:
/* * DDR3 UniPHY sequencer core access example */ #include <stdio.h> #include <unistd.h> #include <io.h> #include "core_debug_defines.h" int send_command(volatile debug_data_t* debug_data_ptr, int command, int args[], int num_args) { volatile int i, response; // Wait until command_status is ready do { response = IORD_32DIRECT(&(debug_data_ptr->command_status), 0); } while(response != TCLDBG_TX_STATUS_CMD_READY); // Load arguments if(num_args > COMMAND_PARAM_WORDS) { // Too many arguments return 0; } for(i = 0; i < num_args; i++) { IOWR_32DIRECT(&(debug_data_ptr->command_parameters[i]), 0, args[i]); } // Send command code IOWR_32DIRECT(&(debug_data_ptr->requested_command), 0, command); // Wait for acknowledgment do { response = IORD_32DIRECT(&(debug_data_ptr->command_status), 0); } while(response != TCLDBG_TX_STATUS_RESPOSE_READY && response != TCLDBG_TX_STATUS_ILLEGAL_CMD); // Acknowledge response IOWR_32DIRECT(&(debug_data_ptr->requested_command), 0, TCLDBG_CMD_RESPONSE_ACK); // Return 1 on success, 0 on illegal command return (response != TCLDBG_TX_STATUS_ILLEGAL_CMD); } int main() { volatile debug_data_t* my_debug_data_ptr; volatile debug_summary_report_t* my_summary_report_ptr; volatile debug_cal_report_t* my_cal_report_ptr; volatile debug_margin_report_t* my_margin_report_ptr; volatile debug_cal_observed_dq_margins_t* cal_observed_dq_margins_ptr; int i, j, size; int args[COMMAND_PARAM_WORDS]; // Initialize pointers to the debug reports my_debug_data_ptr = (debug_data_t*)SEQ_CORE_DEBUG_BASE; my_summary_report_ptr = (debug_summary_report_t*)(IORD_32DIRECT(&(my_debug_data_ptr->summary_report_ptr), 0)); my_cal_report_ptr = (debug_cal_report_t*)(IORD_32DIRECT(&(my_debug_data_ptr->cal_report_ptr), 0)); my_margin_report_ptr = (debug_margin_report_t*)(IORD_32DIRECT(&(my_debug_data_ptr->margin_report_ptr), 0)); // Activate all groups and ranks send_command(my_debug_data_ptr, TCLDBG_MARK_ALL_DQS_GROUPS_AS_VALID, 0, 0); send_command(my_debug_data_ptr, TCLDBG_MARK_ALL_RANKS_AS_VALID, 0, 0); send_command(my_debug_data_ptr, TCLDBG_ENABLE_MARGIN_REPORT, 0, 0); // Mask group 4 args[0] = 4; send_command(my_debug_data_ptr, TCLDBG_MARK_GROUP_AS_SKIP, args, 1); send_command(my_debug_data_ptr, TCLDBG_RUN_MEM_CALIBRATE, 0, 0); // SUMMARY printf("SUMMARY REPORT\n"); printf("mem_address_width: %u\n", IORD_32DIRECT(&(my_summary_report_ptr->mem_address_width), 0)); printf("mem_bank_width: %u\n", IORD_32DIRECT(&(my_summary_report_ptr->mem_bank_width), 0)); // etc... // CAL REPORT printf("CALIBRATION REPORT\n"); // DQ read margins for(i = 0; i < RW_MGR_MEM_DATA_WIDTH; i++) { cal_observed_dq_margins_ptr = &(my_cal_report_ptr->cal_dq_in_margins[i]); printf("0x%x DQ %d Read Margin (taps): -%d : %d\n", (unsigned int)cal_observed_dq_margins_ptr, i, IORD_32DIRECT(&(cal_observed_dq_margins_ptr->left_edge), 0), IORD_32DIRECT(&(cal_observed_dq_margins_ptr->right_edge), 0)); } // etc... return 0; }