Make MPLAB® X IDE Run Faster
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.
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.
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.
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.
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.
License Activation
- 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.
- Open the command prompt on your machine.
- 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.
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:
- 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.
- Open command prompt on your machine.
- Change to the directory of your XCLM installation. Example: pushd “C:\Program Files\Microchip\xclm\bin”.
- Execute the command xclm –hostinfo. This gives you the Host Id and the Host Name.
- 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.
- To check the status of the installed license and to ascertain if the license is correctly installed, run the command: xclm –status.
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.
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.
- From the main menu select Tools > Options (mplab_ide > Preferences in macOS®).
- Click on Embedded tab (second from the right).
- Select Generic Settings (third small tab from the left).
- Select Maintain active connection to hardware tool.
Project Build Speed
Using parallel processors to compile speeds up build time.
The following steps demonstrate how to select Use parallel make option.
- From the main menu select Tools > Options (mplab_ide > Preferences in macOS).
- Click on Embedded tab (second from the right).
- Click on Project Options (second from the left).
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.
Debug
To save system resources, only bring up windows that you need to view during debug.
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.
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.
Displaying Performance Data
You can display simulator performance information by setting its options on the simulator property pages of the Project Properties dialog.
- Open the Project Properties dialog by clicking on the project name in the Project window and select File > Project Properties from the main menu.
- 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.
- Under Categories, click on Simulator. Select property pages from Options categories and click Performance Options.
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.
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
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.