I have a MicroBlaze Block Design (BD) that I want to package up, and add to a separate BD design.
Is this possible?
The Vivado tools do not yet support the Association of ELF files to packaged designs.
To work around this, follow the steps below:
Creating the Packaged IP design files.
Before packaging the MicroBlaze BD, you will need to do the following:
Create the new block design containing the newly created packaged MicroBlaze BD.
Run Synthesis and open the synthesized design.
Create the ELF files
Add the ELF and BMM files.
Modify the BMM file to make it relevant to the new project structure.
Below is an example of a BMM file.
In the section highlighted in red, the hierarchy is removed.
In the section highlighted in green, the ADDRESS_MAP is changed to make the BMM file specific to each packaged MicroBlaze BD:
The Hierarchy can be obtained from the netlist.
In the below example I have two packaged MicroBlaze BD's added to my block design:
Set the source file properties to associate the ELF.
The SCOPED_TO_CELLS, and SCOPED_TO_REF (Referred to as STC, and STR respectively in this Answer Record) for the BMM and ELF files need to be set.
The STC points to the processor cell, and the STR points to the module that contains the STC. The STC is not needed for the BMM file.
To obtain this, open the netlist.
Below is an example that highlights the STC and STR for each packaged MicroBlaze BD file in red and green respectively:
In the example above, the STR and STC for the ELF files for each packaged MicroBlaze BD files are:
The STR, and STC for the BMM files for each packaged MicroBlaze BD file are:
To set the property for each source file (ELF and BMM), highlight the file in sources, then in the source file properties search for the SCOPED_TO_CELLS, and SCOPED_TO_REF.
Enter the properties here.
Verify that the BRAM contents are updated.
Close, and re-open the synthesized design.
In the re-open synthesized design, Type CTRL+F and search for the BRAM for PRIMITIVE_TYPE.
Under the list of BRAMs, select any of the BRAMs and in the cell properties, scroll to the INIT_XX properties.
You should see the memories populated.
Note: if you see any warning related to the Memdata, or BMM_INFO when you re-open the synthesis design, then the issues is related to the STR and STC not being set correctly.