Make MPLAB® X IDE Run Faster

Last modified by Microchip on 2024/06/24 06:34

The following are some areas to look at to optimize MPLAB® X IDE for speed

Project Properties

There are numerous tasks MPLAB® X Integrated Development Environment (IDE) is performing at any given time. One of the tasks is creating a database for the device in each configuration. This becomes an issue especially when a large number of configurations are used in a particular project.

To improve performance, we advise minimizing the configuration to only one instance for each unique device in a given project. In doing so, the operations run faster and memory usage is reduced.

Project Configuration

Memory Usage

If large projects and configurations are used, the memory utilized by the IDE can fill up the maximum space allocated for the heap. To monitor memory usage, the memory toolbar can be used as shown here. Right-click on any toolbar area and Memory is shown in the extended menu. By checking it (which turns it on), the amount of memory used over the total memory available is shown as a bar. The default memory size is 512 MB. If the numbers on the left-hand side get closer to the number on the right, it indicates that the IDE is slowing down.

Showing Memory usage on the Tool bar

Back to top

RAM & Flash Usage

During debug, real-time RAM and Flash usage can be displayed in the Dashboard Window. To launch the Dashboard Window, select Window > Dashboard from the main menu.

Shows the Dashboard selection under the window menu

In the Dashboard Window, under Memory, two types of memory are shown, RAM (data and Flash (Program). The amount of memory used by the project as well as memory reserved for debugging are shown in the percentage bar.

Memory used should be a guide to the amount of memory remaining. The compiler outputs a Memory Summary that details usage for Program Space, Configuration Bits, ID location, and Electrically Erasable Programmable Read-Only Memory (EEPROM) (if available on the device). The sum of these memory spaces, allowing for word sizes, should agree with the Dashboard's indication of Flash used. The map file should be examined when memory is at a premium.

shows both the RAM and EEPROM usage in the Dashboard Window

Back to top

XC License Manager (XCLM)

If the network server is not available, the IDE shows no response when attempting to build. To resolve this problem, the XC license needs to be activated. The following steps describe how to activate the XC license through a command line.

Back to top

License Activation

  1. Install the MPLAB XC compiler in Free mode on the machine. XC License Manager (XCLM) will also be installed when the MPLAB XC compiler is installed using the GUI Installer. See Section 2.1 of Installing MPLAB XC C compilers.
  2. Open the command prompt on your machine.
  3. To activate a license for a single machine (Workstation), run the command: xclm –actkey “activation-key” where the activation-key is the key that was provided to you at the time of the compiler purchase.

Note: If XCLM is not in your path and you get an error similar to XCLM is not found or recognized as a command, navigate to the bin directory of the compiler that was just installed and retry Step 3. Example: pushd “C:\Program Files\Microchip\xc32\v1.10\bin”.

Back to top

Checking License Status

To check the status of the installed license and to ascertain if the license is correctly installed, run the command: xclm –status.

Follow these steps to activate a Network Server License:

  1. Install the compiler in Free mode on the machine (server) which hosts the license. XCLM will also be installed when the MPLAB XC compiler is installed using the GUI installer. See Section 2.1 of Installing MPLAB XC C compilers.
  2. Open command prompt on your machine.
  3. Change to the directory of your XCLM installation. Example: pushd “C:\Program Files\Microchip\xclm\bin”.
  4. Execute the command xclm –hostinfo. This gives you the Host Id and the Host Name.
  5. To activate the network license: run the command: xclm –actkey "activation-key" hostid= mac hostname= host where activation-key is the key that was provided at the time of the compiler purchase.
    • hostid is the MAC address of the machine that will host the activated license.
    • hostname is the username of the machine that will host the activated network license.
  6. To check the status of the installed license and to ascertain if the license is correctly installed, run the command: xclm –status.

Back to top

Hardware Tool Connections

Each MPLAB X IDE project can have its own tools, the connection to the hardware is made after Debug & Run is requested.

Shows the hardware tool selections in the project window

When using one or a few projects, keeping the tools always connected (not just at runtime) saves initialization time. When switching projects with this option selected (e.g., when developing bootloading applications), it ensures that the tool and device are the same, to avoid error messages. This option also saves time when you select debug run again because the tools are already connected to the project and don't need to be initialized again.

The following steps demonstrate how to maintain connections to the hardware tool.

  1. From the main menu select Tools > Options (mplab_ide > Preferences in macOS®).
  2. Click on Embedded tab (second from the right).
  3. Select Generic Settings (third small tab from the left).
  4. Select Maintain active connection to hardware tool.

Shows the hardware tool is still connected

Back to top

Project Build Speed

Using parallel processors to compile speeds up build time.

The following steps demonstrate how to select Use parallel make option.

  1. From the main menu select Tools > Options (mplab_ide > Preferences in macOS).
  2. Click on Embedded tab (second from the right).
  3. Click on Project Options (second from the left).

shows the parallel make option

By selecting Use parallel make, the "make" will execute several processes at a time where -j (or —jobs) is the option to run in parallel and 2n is the number of processes where "n" is the number of processors available on your computer. If your computer does not support parallel processing, parallel make will be disabled. If you wish, you can specify more processes by using Make Options. Example: -j 10.

Exception:

The MPASM™ assembler cannot run under parallel make, either as a toolchain or part of an MPLAB C18 project. The parallel make option is ignored in projects using MPASM toolchain or in projects using the C18 toolchain that contain at least one ASM file.

Back to top

Debug

To save system resources, only bring up windows that you need to view during debug.

Only use windows you need

By selecting Disable auto-refresh for call stack view during debug sessions in the Generic Settings, you reduce the number of updates in the stack window during debug sessions. By checking on On mouse-over structure and array expressions, evaluate integral members only, debug only evaluates single-level content during mouse-over, i.e., only the top-level item of the structure will be resolved and displayed. This option improves IDE performance because it prevents reading and displaying the full data structure, which requires numerous calls to the target device.

shows disabling the auto refresh

Back to top

Simulator Speed

When the MPLAB X IDE Simulator is simulating running in real-time, instructions are executing as quickly as the PC's CPU will allow. This is usually slower than the actual device would run at its rated clock speed. The speed at which the simulator runs depends on the speed of your computer and how many other tasks you have running in the background. The software simulator must update all of the simulated registers and RAM, monitor I/O, set and clear flags, check for break and trace points in the software, and simulate the embedded instruction with instructions being executed on your computer's CPU.

The execution speed of a discrete-event software simulator is orders of magnitude less than a hardware-oriented solution. Slower execution speed may be viewed as a handicap or as a tool. The simulator attempts to provide the fastest possible simulation cycle and depending upon the mode of operation, the simulator can operate on the order of milliseconds per instruction.

Oftentimes, loops are used in your code to generate timing delays. When using the simulator, you might wish to decrease these time delays or conditionally remove those sections of your code with “IFDEF” statements to increase simulation speed.

Turning off simulator trace will increase simulation speed by up to 50 percent. Therefore, use the tracing function only as needed.

Note: Simulator Trace allows you to record the step-by-step execution of your code and examine this recording. The default is set for 64 K records and is recorded internally in RAM to create fast access to the trace buffer. For records larger than 64 K, a RAM file buffer (essentially disk space) is used and the speed is much slower. Except when there is no alternative for capturing a large buffer of data, it is recommended that records are kept to less than 64 K to minimize the delay.

Back to top

Displaying Performance Data

You can display simulator performance information by setting its options on the simulator property pages of the Project Properties dialog.

  1. Open the Project Properties dialog by clicking on the project name in the Project window and select File > Project Properties from the main menu.
  2. Right-click on the project name in the Project window and select Properties to display the speed of simulator in the Output window in the number of instruction cycles executed per second.
  3. Under Categories, click on Simulator. Select property pages from Options categories and click Performance Options.

Back to top

Windows®, Linux®, and macOS® Operating Systems

MPLAB® X IDE runs on Windows®, macOS®, and Linux® Operating Systems (OS). Many MPLAB X IDE features and functions running in macOS and Linux OS are fully supported. Windows, macOS, and Linux MPLAB X can be found in the Downloads tab on the MPLAB® X Integrated Development Environment (IDE) page.

Note: If you plan on using MPLAB X IDE on different platforms, please be aware of the following issues:

  • Use the forward slash “/” in relative paths. The backslash “\” works only on Windows OS platforms. For example: #include headers/myheader.h.
  • Linux OS is case-sensitive, e.g., generictypedefs.h is not the same as GenericTypeDefs.h.

Back to top

XC Compilers

The MPLAB XC compilers (XC8, XC16, XC32) are available and licenses can be installed on every major platform, including Windows, macOS, and Linux 32-bit and 64-bit versions. Please refer to the users' guide, Installing and Licensing MPLAB XC C Compilers, to install and activate the compiler. Below shows the minimum configurations required for Ubuntu® 9.10 and macOS.

Ubuntu®

Processor: 800 MHz Intel® Pentium III or equivalent

  • Memory: 512 MB
  • Disk space: 400 MB of free disk space

Mac OS X 10.5 Intel®

  • Processor: Dual-Core Intel (32-bit or 64-bit)
  • Memory: 512 MB
  • Disk space: 400 MB of free disk space

Back to top

Recommended Configurations

Microsoft Windows XP Professional SP3/Windows 7 Professional/ Windows 8 Professional:

  • Processor: Dual-Core Intel (32-bit or 64-bit)
  • Memory: 2 GB
  • Disk space: 500 MB of free disk space

Ubuntu 9.10

  • Processor: Dual-Core Intel (32-bit or 64-bit)
  • Memory: 2 GB
  • Disk space: 500 MB of free disk space

Mac OS X 10.6 Intel

  • Processor: Intel Core™ 2 Duo or newer (32-bit or 64-bit)
  • Memory: 2 GB
  • Disk space: 500 MB of free disk space

Other Configurations

The compilers may also run on various Linux distributions such as Oracle Enterprise Linux 5, Ubuntu 8.x and 10.04, Red Hat Enterprise Linux and many others.

License Activations

Both the Workstation License and Network Server Licenses can be activated offline from the command line on Windows as well as on macOS and Linux machines.

Back to top