This is an old revision of the document!
Add a Microblaze Processor to a Block Design
The Microblaze soft-core processor IP can be used to instantiate a processor within your FPGA design. This processor can be very useful for controlling and configuring hardware components. This section discusses how you can add a Microblaze processor and several useful components, including UART for standard output and DDR memory support, to your block design.
Note: This section is intended for use with boards without a Zynq chip. For Zynq boards, the Zynq7 Processing System should be used instead.
First, an external clock should be added to the block design, so that it can be used to generate any other clocks required by the design. Open the Board tab, and find the system clock. Right click on it and select Connect Board Component.
In the Connect Board Component dialog, select the CLK_IN1 of a new Clocking Wizard IP. This will add a clocking wizard to the design, which can be used to easily configure the board's MMCMs and PLLs to generate any required clocks. Click OK to continue.
Next, an external reset port should be added to the design that can be used to reset the entire system. Click the Run Connection Automation button in the green Designer Assistance toolbar.
In the Run Connection Automation dialog, in the list on the left side of the dialog, make sure that the Clocking Wizard's reset box is checked. The Select Board Part Interface dropdown lists any options for resets that are specified in your board's board files. For most boards, only one option will be available. Click OK to continue.
Note: Depending on the polarity of the reset button (active high or active low), a Utility Vector Logic IP may be inserted between the reset port and the Clocking Wizard. This is used to ensure that the active high reset pin of the IP is provided with the correct polarity of reset signal, and that the design will not be held in reset while the reset button is not pressed.
Two flows are available, depending on whether your board has DDR memory. If the board has DDR, a DDR interface will appear in Vivado's Board tab. Choose the appropriate dropdown, below:
- Adding a DDR Interface
-
This section is undergoing significant rework, in order to better match Xilinx design guidelines, and should not be considered a comprehensive guide to connecting a MIG IP to a Microblaze processor. This rework is anticipated to be complete by August 21, 2020.
Returning to the Board tab, your board may provide a DDR interface, which can be used with Xilinx's Memory Interface Generator (MIG) IP to provide the processor access to DDR memory. As when adding the system clock, right click on the DDR entry in the list and select Connect Board Component. In the pop up dialog, select the MIG's mig_ddr_interface, and click OK to continue.
Once the MIG has been added to the design, it will have been connected to one or more additional external ports, typically a reference clock (clk_ref_i) and system clock (sys_clk_i). As Digilent boards typically do not provide clocks dedicated for use with the MIG (to reduce the costs of additional oscillators, and to save FPGA pins for other interfaces), these external ports should be deleted. Select each these pins (but NOT the DDR port!), right click on one of them, and select Delete from the menu (or press the delete key on your keyboard).
The next few steps will discuss how to manually connect the MIG's clock pins to clocks generated by the Clocking Wizard.
Digilent's board files provide default settings for the MIG IP. Of note for this design are the clock frequencies that must be provided to the MIG's clock pins.
First, these clocks must be generated by the Clocking Wizard. Double click on the Clocking Wizard IP core to edit its settings. Navigate to the Output Clocks tab, and create clocks of the frequencies specified in the table below:
Board MIG System Clock (sys_clk_i) Frequency MIG Reference Clock (ref_clk_i) Frequency Arty A7 166.66667 MHz 200 MHz Arty S7 100 MHz 200 MHz Nexys A7 200 MHz N/A USB104 A7 200 MHz N/A Nexys Video 200 MHz N/A Genesys 2 200 MHz N/A Sword 200 MHz N/A Important: For the Arty S7, the MIG configuration provided by the board files is intended to have the MIG sys_clk pin driven by the DDR Clock board file interface, and have the ref_clk input driven by the MIG's ui_addn_clk_0 port. Refer to the Arty S7 Reference Manual for more information.
Output clocks are added to the Clocking Wizard by checking a box in the Output Clock column, and specifying a Requested Output Frequency. Additionally, if desired, the ports can be named according to their intended purpose.
If your design requires additional clocks (such as for an ext_spi_clock pin), they should be added to the Clocking Wizard as well.
Note: This section can always be returned to later, as the addition of an additional clock can be performed any time before the hardware is built.
Click OK to confirm your changes to the Clocking Wizard's settings.
Next, the Clocking Wizard's new output clocks should be connected to the MIG, based on the specified frequencies seen in the table in the last step. If needed, the frequency of a clock can be checked by selecting the Clocking Wizard's output pin, and looking at the Block Pin Properties pane to the left of the block diagram.
Connect the clocks by clicking and dragging from one pin to the other, as seen in the image to the right.
Next, manually connect the MIG's sys_rst pin to the external reset port by clicking and dragging. Make sure that the polarity is correct. If necessary, a Utility Vector Logic IP can be added to the design to convert from an active high external reset to an active low MIG reset.
Note: The image to the right shows an active low MIG reset (indicated by the “bubble” on the pin), being connected to an active low external reset.
- Adding Additional Clocks (For Boards Without DDR)
-
Your design will require at least one clock from the clocking wizard. If your design requires more clocks, then they must be added through the Clocking Wizard.
Double click on the Clocking Wizard IP core to edit its settings. Navigate to the Output Clocks tab. Additional clocks are added to the Clocking Wizard by checking a box in the Output Clock column, and specifying a Requested Output Frequency. Additionally, if desired, the ports can be named according to their intended purpose.
If your design requires additional clocks (such as for an ext_spi_clock pin), they should be added now.
Click OK to confirm your changes to the Clocking Wizard's settings.
Note: This section can always be returned to later, as the addition of an additional clock can be performed any time before the hardware is built.
Next, use the Add IP button (
) to add the MicroBlaze IP to the design. The block that is added represents the core of the Microblaze processor.
Next, block automation will be run so that additional supporting infrastructure can be added to the design. Click Run Block Automation in the green Designer Assistance bar.
Note: The screenshot to the right is not representative for a design not using DDR, as these designs will not contain a MIG IP core.
In the Run Block Automation dialog, several settings can be specified for how the Microblaze IP will be connected to the rest of the design:
- Local Memory specifies how much block RAM memory will be dedicated to the processor. DDR-less designs require more memory, and the amount of memory necessary depends heavily on the size of the software application being run. 32KB is enough for many small applications.
- Cache Configuration can help the speed of designs using DDR memory. It should be enabled when using DDR, and disabled otherwise.
- Debug Module allows you to specify the capabilities of the debugger. The default Debug Only option is recommended.
- Peripheral AXI Port enables or disables the AXI master interface of the processor. It must be enabled to allow the processor to be connected to hardware peripherals.
- Interrupt Controller specifies whether the processor can be interrupted by its peripherals. Whether or not it needs to be enabled depends on your design requirements. If any IP that you intend to connect to the processor must have interrupts to function correctly, the box must be checked.
- Clock Connection specifies the processor's clock. Designs using DDR should use the MIG's ui_clk pin, while designs without DDR should use the Clocking Wizards clk_out1 pin.
Note: Settings not present in this list are out of the scope of this guide, and can safely be left as their default.
Confirm that the settings meet your design requirements. To rerun Block Automation, each IP created by it must first be deleted from the design. Click OK to continue.
- Connect the MIG to the Processor (DDR Designs Only)
-
In the dialog that pops up, select ONLY the S_AXI interface from the list of interfaces to connect. Click OK, and Vivado will automatically connect the MIG to the Microblaze processor via the processor's IC and DC (instruction and data cache) interfaces.
Note: Selecting all three interfaces may result in incorrect connections. The IC and DC interfaces are specified to be connected to the S_AXI interface from within the automation options for S_AXI.
Side note, the View dropdown in the top right corner of Vivado's Diagram pane can be used to reduce the amount of visual clutter in the diagram, and help to quickly spot problems. For example, the Interfaces View presents only the complex interfaces in the design, and helps in verifying that AXI peripherals are connected to the processor through the DP port, and that the MIG is connected through the IC and DC ports.
Importantly, this view does not show you any clock, reset, or interrupt connections. If you take a look at this view, make sure to switch back to the Default View before continuing this guide.
Next, in order for the software design to be able to print to a serial console on a host computer, a UART peripheral must be connected. Find the USB UART interface in the Board tab, right click on it, and select Connect Board Component.
In the dialog that pops up, select a new AXI Uartlite IP's UART interface, and click OK to add the block to the diagram.
To connect all remaining AXI cores that have not yet been connected to the processor, click the Run Connection Automation button in the green Designer Assistance bar. Check the All Automation box in the list on the left side of the window to select all of the remaining AXI cores. The dropdown settings available for each core can safely be left as their default values. Click OK to automatically connect them to the processor.





















