Test the FrontPanel Interface

After configuring the FPGA with your desired bitfile, it’s a good idea to test that FrontPanel is enabled in your FPGA configuration using okCFrontPanel::IsFrontPanelEnabled(). Testing FrontPanel after configuration is a good way to check for a variety of issues. For example,

  • It assures that the bitfile was found and transferred to the device.
  • It assures that the bitfile has proper host interface pin mappings.

C/C++

okCFrontPanel dev; okCFrontPanel::ErrorCode error; dev.OpenBySerial(); error = dev.ConfigureFPGA("example.bit"); // It's a good idea to check for errors here!! // IsFrontPanelEnabled returns true if FrontPanel is detected. if (true == dev.IsFrontPanelEnabled()) { std::cout << "FrontPanel host interface enabled.\n"; } else{ std::cerr << "FrontPanel host interface not detected.\n"; }
Code language: PHP (php)

C#

okCFrontPanel dev = new okCFrontPanel(); okCFrontPanel::ErrorCode error = new okCFrontPanel::ErrorCode(); string bitfile = "example.bit"; dev.OpenBySerial(""); error = dev.ConfigureFPGA(bitfile); // It's a good idea to check for errors here!! // IsFrontPanelEnabled returns true if FrontPanel is detected. if (true == dev.IsFrontPanelEnabled()){ Console.Error.WriteLine("FrontPanel host interface enabled."); } else{ Console.WriteLine("FrontPanel host interface not detected."); }
Code language: PHP (php)

Python

dev = ok.okCFrontPanel() dev.OpenBySerial("") error = dev.ConfigureFPGA("example.bit") # It's a good idea to check for errors here!! # IsFrontPanelEnabled returns true if FrontPanel is detected. if true == dev.IsFrontPanelEnabled(): print "FrontPanel host interface enabled." else: sys.stderr.write("FrontPanel host interface not detected.")
Code language: PHP (php)

Java

public class example{ okCFrontPanel dev; okCFrontPanel.ErrorCode error; public void CheckFP(){ dev = new oKCFrontPanel(); dev.OpenBySerial(""); error = dev.ConfigureFPGA("example.bit"); // It’s a good idea to check for errors here! // Is FrontPanelEnabled returns true if FrontPanel is detected. if(true == dev.IsFrontPanelEnabled()){ System.out.println("FrontPanel interface is enabled."); } System.out.println("FrontPanel interface is not enabled!"); } }
Code language: PHP (php)