Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

PCIe core MSI-X support

I have added MSI-X support to an implementation of the Altera PCIe core we're already testing in the lab. My understanding, is that with MSI-X enabled in the megawizard and my vector table offset set appropriately, I have created the vector table in my own register set at that offset. I then, as I understand it, trigger an MSI-X interrupt simply by issueing a single DW PCIe Memory Write to the appropriate MSI-X address with the appropriate data, as specified in the vector table. As I understand it, the specific MSI I/O to the core isn't used for MSI-X, and you just do a normal memory write.

However, my write doesn't seem to appear in shared memory in the simulation. I'm not sure what I'm doing wrong. Is my above understanding correct? I have other data moving back and forth over the link without trouble.

I notice that in the shared memory the code 0x00207811 appears, in the first interrupt address, even with no interrupt happening, image attached. Also attached is a wave view of my MSI-X single DW write.

16 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hello! It's seems that I'm made everything ok and interrupts came to CPU. But problem appear - MSI-X is working only on 1 PC (I have tried on other PC and on 2 servers). I saw on Signal TAP that MSI-X write-packet is formed exactly like on 1st PC...

    Some additional information:

    1. I'm using Arria II GX and PCIe Hard IP.

    2. MSI interrupt are ok on all computers

    3. All other write packets (not MSI-X) are also ok on all

    4. Format of the MSI-X packet

    assign Sig_Packet_Type_field = 8'h60;

    assign Sig_Packet_Length_field = 10'b00_0000_0001;

    Clk1: PCIe_data_out [63:0]<= {Requester_ID, 16'h00_0f, Sig_Packet_Type_field, 14'b0, Sig_Packet_Length_field};

    Clk2: PCIe_data_out [63:0]<= {msix_Msg_Lower_Addr[msix_Number],msix_Msg_Upper_Addr[msix_Number]}

    Clk3: PCIe_data_out [63:0]<= {Sig_Packet_Data_field, 32'b0};
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    You know that you must use a 3DW header if msix_Msg_Upper_Addr[msix_Number] is all zeroes?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Do You mean 3-DWord Header TLP and memory write request 32bit addr?

    So how should packet look like if msix_Msg_Upper_Addr[msix_Number] is all zeroes?

    Like this - only two clk:

    assign Sig_Packet_Type_field = 8'h40; // 32bit addr

    assign Sig_Packet_Length_field = 10'b00_0000_0001; // 1 DWORD

    // LastBE = 4'h0, FirstBE = 4'hF

    Clk1: PCIe_data_out [63:0]<= {Requester_ID, 16'h00_0f, Sig_Packet_Type_field, 14'b0, Sig_Packet_Length_field};

    Clk2: PCIe_data_out [63:0]<= {msix_Msg_Lower_Addr[msix_Number], Sig_Packet_Data_field [31:0]}

    Or like this – 3 clk:

    assign Sig_Packet_Type_field = 8'h40; // 32bit addr

    assign Sig_Packet_Length_field = 10'b00_0000_0001; // 1 DWORD

    // LastBE = 4'h0, FirstBE = 4'hF

    Clk1: PCIe_data_out [63:0]<= {Requester_ID, 16'h00_0f, Sig_Packet_Type_field, 14'b0, Sig_Packet_Length_field};

    Clk2: PCIe_data_out [63:0]<= {msix_Msg_Lower_Addr[msix_Number],32'b0}

    Clk3: PCIe_data_out [63:0]<= {Sig_Packet_Data_field, 32'b0};

    It seems to me that I tried already both variants but they don't work :( HELP! :)

    P.S. I checked msix_Msg_Upper_Addr is all 0!

    On 1st PC where MSI-X are working, I send 4DW header and msix_Msg_Upper_Addr still is all 0...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Do You mean 3-DWord Header TLP and memory write request 32bit addr?

    […]

    Or like this – 3 clk:

    […]

    --- Quote End ---

    Yes, either the first one (if addr mod 8 == 4) or the second one (if addr mod 8 == 0).

    --- Quote Start ---

    It seems to me that I tried already both variants but they don't work :(

    --- Quote End ---

    So it’s probably something else, additionally. Does the system properly enable MSI-X at all? There are systems that do support MSI but don’t support MSI-X.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Yes, either the first one (if addr mod 8 == 4) or the second one (if addr mod 8 == 0).

    --- Quote End ---

    I made in this way... but problem was that in 2clk packet I send

    Clk2: PCIe_data_out [63:0]<= {msix_Msg_Lower_Addr[msix_Number], Sig_Packet_Data_field [31:0]}

    but should be

    Clk2: PCIe_data_out [63:0]<= {Sig_Packet_Data_field [31:0],msix_Msg_Lower_Addr[msix_Number]}

    Thank You for help!!!! :)

    Now everything is ok.

    P.S. 1st PC understand write packet with 64 bit addr even if upper addr is all 0... but other don't understand... (they understand just 32bit addr packets)