Hard Processor System Component Reference Manual: Agilex™ 5 SoCs
ID
813752
Date
4/10/2025
Public
A newer version of this document is available. Customers should click here to go to the newest version.
1. Introduction to the Agilex™ 5 Hard Processor System Component
2. Configuring the Agilex™ 5 Hard Processor System Component
3. Simulating the Agilex™ 5 HPS Component
4. Simulating the Agilex™ 5 HPS bridges (H2F, LWH2F, and F2SDRAM)
5. Design Guidelines
6. Document Revision History for the Hard Processor System Component Reference Manual Agilex™ 5 SoCs
2.1. Parameterizing the HPS Component
2.2. HPS-FPGA Interfaces
2.3. SDRAM
2.4. HPS Clocks, Reset, Power
2.5. I/O Delays
2.6. Pin Mux and Peripherals
2.7. Generating and Compiling the HPS Component
2.8. Using the Address Span Extender Component
2.9. Configuring the Agilex™ 5 Hard Processor System Component Revision History
2.2.1.1. Enable MPU Standby and Event Signals
2.2.1.2. Enable General Purpose Signals
2.2.1.3. Enable Debug APB* Interface
2.2.1.4. Enable System Trace Macrocell (STM) Hardware Events
2.2.1.5. Enable SWJ-DP JTAG Interface
2.2.1.6. Enable FPGA Cross Trigger Interface
2.2.1.7. Enable AMBA* Trace Bus (ATB)
2.3.1. Configurations for HPS IP
2.3.2. Configurations for HPS EMIF IP
2.3.3. Graphical Connections of HPS to HPS-EMIF
2.3.4. Configuration when using ECC
2.3.5. Configuration of HPS EMIF Calibration Settings
2.3.6. Supported Memory Protocols Among Device Families
2.3.7. IO96 Bank and Lane Usage for HPS EMIF
2.3.8. Quartus Report of I/O Bank Usage
2.3.9. Debugging with the External Memory Interface Debug Toolkit
4.3.4. test_f2sdram_256b.sv
- Change directory to <project directory>/simple_tb/simple_tb/sim/.
- Create a file named test_f2sdram_256b.sv and edit with contents as shown below
// test_f2sdram_256b.sv `timescale 1 ps / 1 ps import altera_axi_bfm_pkg::*; import host_memory_class_pkg::*; module test_f2sdram_256b#(); `define mgr_bfm simple_tb.simple_inst.axi4_mm_manager_intf_0.axi4_mm_manager_intf_0 `define sub_bfm simple_tb.simple_inst.intel_agilex_5_soc_0.intel_agilex_5_soc_0.sm_mpfe.sundancemesa_mpfe_inst.f2sdram_bfm_gen.f2sdram_axi4_slave_inst localparam real CLK_PERIOD = 10; localparam ADDR_WIDTH = 32; localparam DATA_WIDTH = 256; localparam ID_WIDTH = 5; localparam USER_WIDTH = 32; localparam USER_WIDTH_F2SDRAM_SUB = 8; int i,j; bit status, f_rw[8], f_incr[8][8]; reg [ADDR_WIDTH-1:0] Addr; // 32 bit addr reg [DATA_WIDTH-1:0] Data[8]; // 256 bit data //----------------------------------------------------------------------------------------------- //---------------------------- BFM Manager (f2sdram) //----------------------------------------------------------------------------------------------- initial begin AlteraAxiTransaction wr_resp_tr, rd_resp_tr; BaseAxiBfm#(ADDR_WIDTH, DATA_WIDTH, ID_WIDTH, USER_WIDTH) test_m; test_m = `mgr_bfm.AXI4MAN.bfm; Data[0] = 'h11111111_22222222_33333333_44444444_55555555_66666666_77777777_88888888; Data[1] = 'h22222222_33333333_44444444_55555555_66666666_77777777_88888888_99999999; Data[2] = 'h33333333_44444444_55555555_66666666_77777777_88888888_99999999_aaaaaaaa; Data[3] = 'h44444444_55555555_66666666_77777777_88888888_99999999_aaaaaaaa_bbbbbbbb; test_m.m_reset(); test_m.set_config(AXI_CONFIG_MAX_OUTSTANDING_WR, 2); test_m.set_config(AXI_CONFIG_MAX_OUTSTANDING_RD, 2); $display("\n\n\n\n@%0t, [TESTINFO]: Starting MANAGER BFM F2SDRAM \n\n\n\n",$time); /////////////////////////////////////////// SINGLE WRITES ////////////////////////////////////// for (i = 0; i < 4; i++) begin $display("\n@%0t*************** START OF WRITE #%d TEST ******* F2SDRAM ********\n",$time, i); Addr = (i * 1<<AXI4_BYTES_32); wr_resp_tr = test_m.manager_bfm_wr_tx(); wr_resp_tr.set_id(i); wr_resp_tr.set_awaddr(Addr); wr_resp_tr.set_burst_length(0); wr_resp_tr.set_size(AXI4_BYTES_32); wr_resp_tr.set_data_words(Data[i], 0); wr_resp_tr.set_write_strobes(32'hffffffff, 0); test_m.put_transaction(wr_resp_tr); test_m.drive_transaction(); $display("\n@%0t*************** END OF WRITE #%d TEST ******* F2SDRAM ********\n",$time, i); end /////////////////////////////////////////// SINGLE READS ////////////////////////////////////// for (i = 0; i < 4; i++) begin $display("\n@%0t*************** START OF READ #%d TEST ****** F2SDRAM *********\n",$time, i); Addr = (i * 1<<AXI4_BYTES_32); rd_resp_tr = test_m.manager_bfm_rd_tx(i, Addr ); rd_resp_tr.set_size(AXI4_BYTES_32); test_m.put_transaction(rd_resp_tr); test_m.drive_transaction(); if (rd_resp_tr.get_data_words(0) == Data[i]) begin f_rw[i]=1'b1; $display ("value of f_rw[%d] is %b", i, f_rw[i]); $display ( "@ %t Read correct data (%h) at address (%d)", $time, Data[i], Addr ); end else $display ( "@ %t Error: Expected data (%h) at address (%d), but got %d", $time, Data[i], Addr, rd_resp_tr.get_data_words(0)); $display("\n@%0t*************** END OF READ #%d TEST ****** F2SDRAM *********\n",$time, i); end /////////////////////////////////////////// INCR WRITES/READS ///////////////////////////////// for (i = 0; i < 4; i++) begin $display("\n@%0t*************** START OF INCR BURST #%d TEST ****** F2SDRAM *********\n",$time, i); Addr = 32+ (i*1<<AXI4_BYTES_32); wr_resp_tr = test_m.manager_bfm_wr_tx( (4+i), Addr ); // id, addr wr_resp_tr.set_burst_length(3); wr_resp_tr.set_size(AXI4_BYTES_32); wr_resp_tr.set_burst_type(BURST_TYPE_INCR); wr_resp_tr.set_data_words(Data[0], 0); // data, id wr_resp_tr.set_data_words(Data[1], 1); wr_resp_tr.set_data_words(Data[2], 2); wr_resp_tr.set_data_words(Data[3], 3); wr_resp_tr.set_write_strobes(32'hffffffff, 0); // strobe, id wr_resp_tr.set_write_strobes(32'hffffffff, 0); wr_resp_tr.set_write_strobes(32'hffffffff, 0); wr_resp_tr.set_write_strobes(32'hffffffff, 0); test_m.put_transaction(wr_resp_tr); test_m.drive_transaction(); rd_resp_tr = test_m.manager_bfm_rd_tx( (4+i), Addr ); rd_resp_tr.set_burst_length(3); rd_resp_tr.set_size(AXI4_BYTES_32); rd_resp_tr.set_burst_type(BURST_TYPE_INCR); fork begin test_m.put_transaction(rd_resp_tr); test_m.drive_transaction(); end begin test_m.put_transaction(wr_resp_tr); test_m.drive_transaction(); end join for (j=0; j<4; j++) begin if (rd_resp_tr.get_data_words(j) == Data[j]) begin f_incr[i][j]=1'b1; $display ( "@ %t Read correct data (%h) at address (%h)", $time, Data[j], (Addr + j) ); end else $display ( "@ %t Error: Expected data (%h) at address (%h), but got %h", $time, Data[j], (Addr + j), rd_resp_tr.get_data_words(j)); end //for j loop end //for i loop /////////////////////////////////////////// CHECK TESTS ///////////////////////////////// #2000 // optional delay - if timescale is 1ns/1ns, then 2000 = 2ns status=1'b1; //assume pass for (i = 0; i < 4; i++) if (f_rw[i]!=1'b1) status=1'b0; for (i=0; i<4; i++) for (j=0; j<2; j++) if (f_incr[i][j]!=1'b1) status=1'b0; if (status==1'b1) $display ("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> pass F2SDRAM "); else begin $display ("\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> fail F2SDRAM "); for (i=0; i<4; i++) for (j=0; j<2; j++) $display (">>> f_rw[%d] is %b >>> f_incr[%d][%d] is %b ", i, f_rw[i], i, j, f_incr[i][j] ); end $display("\n@%0t**************** END OF TEST ******** F2SDRAM ********\n",$time); end // initial begin //----------------------------------------------------------------------------------------------- //---------------------------- BFM Subordinate //----------------------------------------------------------------------------------------------- initial begin AlteraAxiTransaction wr_resp_tr, rd_resp_tr; byte_t init_buf[]; BaseAxiBfm#(ADDR_WIDTH, DATA_WIDTH, ID_WIDTH, USER_WIDTH_F2SDRAM_SUB) test_s; test_s =`sub_bfm.AXI4SUB.bfm; test_s.s_reset(); // Configure BFM as needed test_s.set_config(AXI_CONFIG_MAX_OUTSTANDING_WR, 2); test_s.set_config(AXI_CONFIG_MAX_OUTSTANDING_RD, 2); // Create response transactions wr_resp_tr = test_s.subordinate_bfm_wr_resp_tx(); rd_resp_tr = test_s.subordinate_bfm_rd_resp_tx(); fork //Initialise the memory init_buf = new[8]; init_buf = {<<byte_t{256'hffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff_ffff}}; `sub_bfm.host_memory.initialize_data(0, init_buf); `sub_bfm.host_memory.initialize_data(16, init_buf); `sub_bfm.host_memory.initialize_data(32, init_buf); `sub_bfm.host_memory.initialize_data(48, init_buf); `sub_bfm.host_memory.initialize_data(64, init_buf); join $display("\n\n\n\n@%0t, [TESTINFO]: Starting SUBORDINATE BFM \n\n\n\n",$time); fork forever begin test_s.put_transaction(wr_resp_tr); test_s.drive_transaction(); end forever begin test_s.put_transaction(rd_resp_tr); test_s.drive_transaction(); end join end // initial begin endmodule