Porting to Virtex-4 and Spartan-6

159 views
Skip to first unread message

stelios....@gmail.com

unread,
Jun 10, 2015, 6:47:34 AM6/10/15
to panda-project-dis...@googlegroups.com
Greetings.

First let me say that panda looks like a great tool, cudos for all the work.
I have downloaded and installed panda, build some of the examples and modified the test-benches to check the simulation.
I had a look at the devices configuration and i found out that there are xml files for the recent xilinx device families  virtex-5, virtex-7 etc.
I want to test with some older devices virtex-4, Spartan-6 but i am unable to find any documentation on how to "port" to a completely different device family.
The example does mention eucalyptus but i am unable to find any documentation on the procedure.
Ideally i would like to port the VGA example to my Virtex-4 dev board (ML40X)

Any help/pointers would be welcome.

Fabrizio Ferrandi

unread,
Jun 10, 2015, 9:28:56 AM6/10/15
to panda-project-dis...@googlegroups.com, stelios....@gmail.com
Dear Stelios,

Thanks for being interested in our project.

To add a new Xilinx Virtex4 device follow these steps:
1) go to etc/devices/Xilinx_devices
2) cp  Virtex-5.xml Virtex-4.xml
The xml file Virtex-4.xml includes two flows, one for the characterization and one for the the standard synthesis.
Both the flows have the standard ISE steps. Each step is sequentially called following the order defined by the flow tag.
Sometimes some of the steps may be skipped during the characterization. This could useful if you would like to have something faster but less accurate.
I do not expect much modifications to Virtex4 script file since the Virtex-5 script should work even for for Virtex-4.
For Spartan6 you should copy the Virtex-6.xml file. Spartan6 are more similar to Virtex 6 devices than Virtex 5 ones in term of synthesis script.
3) cp  xc5vlx50-3ff1153-seed.xml xc4<deviceid>-seed.xml
deviceid is a tag name associated to the Virtex-4 device that you would add.
For Spartan6 devices you should start from a xc6<>seed examples.
The main difference between Virtex4-5 and Spartan6-Virtex-7 is related to BRAM templates. XST uses two different approaches to recognize BRAMs from Verilog code for S6-V6-V7 vs V4-V5.
Once xc4<deviceid>-seed.xml has been created you need to modify the first lines of the xml file.
You have to change this tag <family value="Virtex-5"/> in <family value="Virtex-4"/> the value "Virtex-4" will be used by bambu to use the information stored in Virtex-4.xml file during the backend script creation.
Then you should change these tags <model value="xc5vlx50"/> <package value="ff1153"/> <speed_grade value="-3"/> accordingly with the Virtex4 device you would add to the framework.

Once you have created the device seed and the family script you can call eucalyptus:
/opt/panda/bin/eucalyptus --estimate-library=xc4<deviceid>.xml --target-scriptfile=Virtex-4.xml --target-datafile=xc4<deviceid>-seed.xml -v2

Option --estimate-library specifies the file containing delay and area metrics for any operation/resource supported by bambu.
Option --target-scriptfile specifies the file containing the characterization script used to estimate the operation delay and area.
Option --target-datafile specifies the device used and some resource customization the device may require.

All the component description not customized is taken from a common set of xml files stored in etc/lib/technology/.

Please take care of error messages and warnings printed by eucalyptus. In case the synthesis for a given component does not correctly complete, eucalyptus move to next component skipping the creation of the associated tag in the "estimate" library file. This may happen for several reasons, such as bugs of the synthesis tool, not enough resources on the device selected or not enough disk space on the machine running eucalyptus.

In general, eucalyptus takes a very long time to complete the characterization because it has to perform around 3500 RTL synthesis. The code to be synthesized is most of the time very simple and so the single synthesis does not take too much but for some components, such as the FloPoCo ones, the synthesis time could be very long.

Obtained the xc4<deviceid>.xml you could integrate in bambu by modifying these files:
etc/devices/Makefile.am //to include the added file in the list of distributed files
src/wrapper/synthesis/xilinx/Makefile.am //to create Virtex-4.data file
src/wrapper/synthesis/xilinx/XilinxBackendFlow.cpp //to include Virtex-4.data file in the default_data object
technology/target_device/FPGA/Makefile.am //to the create the file xc4<deviceid>.data
src/technology/target_device/FPGA/FPGA_device.cpp //to include the file xc4<deviceid>.data file in the default_device_data object

Compile, install and then run bambu with the new device.

I admit that this process is not straightforward but this the current status. We'll try to simplify it for the next 0.9.4 release.

Anyway, please ask if you find something of not clear or missing.

Cheers,

Fabrizio

plopez...@gmail.com

unread,
Apr 23, 2018, 12:18:08 PM4/23/18
to PandA project discussions and questions
Dear Fabrizio,

In the context of a study we are planning to add Bambu support to NanoXplore BRAVE NG-MEDIUM FPGA. In this post you mentioned that the porting process would be simplified for Bambu 0.9.4 release. If I'm not mistaken, the current release is 0.9.5 so I was wondering whether this process has been somehow simplified in this release.

Thanks in advance for your reply.

Best regards,
Patricia

Fabrizio Ferrandi

unread,
Apr 24, 2018, 2:57:41 AM4/24/18
to PandA project discussions and questions
Dear Patricia,

Virtex4 is now supported and the user can now pass an XML file describing the technology. See the example in examples/add_device_simple. 
This will allow generating the VHDL/Verilog file but you cannot use the --evaluation option. The --evaluation option will call the synthesis backend script and will return at the end the place&route post synthesis results. Anyhow, by copying/adapting the existing XML files you will produce synthesis results not very accurate in timing. To improve the timing you need to characterize the bambu resource library with respect to the BRAVE NG MEDIUM device and this process can be done automatically by integrating the backend tool and by running the eucalyptus tool as explained in the previous post. To add such integration you need to prepare the synthesis template scripts for the NanoXplore backend tools. 
In the past, we found that existing backend tools have different template for block ram inference. Such part is quite complex so please keep us involved to avoid waste of time.
In case of further questions just send an email.

kind regards,

Fabrizio

ZT C

unread,
Mar 29, 2020, 6:44:27 AM3/29/20
to PandA project discussions and questions
Hi,

Glad to see that Bambu supports several devices. 
However, I would still like to add my own device but encountered some difficulties.

1. what necessary modification should I do if I want to add devices that are totally different from existing Xilinx/Altera devices?
As far as I read your instruction, It seems that developers only need to copy Virtex5 XML files in order to support Virtex4 devices.
I cannot understand how it works and the solution is obviously not available for my device because errors occur when I synthesized C codes of nested loops (more than 3 layers) with BRAM options. 
It seems that Bambu generates Verilog codes that contain the usage of mem[][], while this kind of 2d-indexing is not supported by our device.
Therefore, I tried to configure XML files corresponding to our device, but I cannot figure out how to generate such files automatically or manually since there is no tutorial or documentation about the XML format and keywords for Bambu.
So I would like to learn about how these XML files work and how I can write my own XML files.

2. what is eucalyptus for and how to use it?
I noticed that the version of eucalyptus is updated and the parameter -estimate-library is discarded.
I tried to run eucalyptus with scriptfile and datafile, and eucalyptus generated two empty directories "work" and "panda-temp"(I allowed temporary files to be saved).

I was really confused about the process of adding new devices, I would be grateful if these problems could be solved.

Best,
Chengtin
 
Fabrizio Ferrandi於 2015年6月10日星期三 UTC+8下午9時28分56秒寫道:

Fabrizio Ferrandi

unread,
Mar 31, 2020, 5:33:14 AM3/31/20
to PandA project discussions and questions
Hi,

Concerning point 1.), I think that your issue is much related to the fact that different backend tools requires different BRAM Verilog/VHDL templates.
This is addressed by allowing to customize the target device memories inferred.
Check for example files: 
etc/devices/NanoXplore_devices/nx1h35S-seed.xml
etc/devices/NanoXplore_devices/nx1h35S.xml

The first one is the seed used by eucalyptus to generate the second.

In the seed file you are going to see how the description of a true dual port byte enabling ram is added to the library. The component is described in Verilog section VERILOG_PROVIDED and in VHDL VHDL_PROVIDED.

The component is described in HDL by using existing descriptions available from these xml files:

etc/lib/technology/NC_MEM_IPs.xml
etc/lib/technology/C_MEM_IPs.xml

The link to these XML files is described by means of the IP_COMPONENT tag.
In case you are not finding a suitable existing component you may directly copy the body of the Verilog or the VHDL description into the   VERILOG_PROVIDED and in VHDL VHDL_PROVIDED xml sections.
Moreover, you may replace any of the components coming from the Bambu IPs library (etc/lib/technology/.xml) with this mechanism.

Concerning the point 2), I would suggest to adapt these scripts:
etc/devices/characterize_device.sh
etc/devices/characterize_all_devices.sh

Cheers,

Fabrizio

PS For the sake of completeness, Virtex 4 support has been already added since 0.9.5.
PPS which is the FPGA you are targeting?

ZT C

unread,
Apr 1, 2020, 9:11:11 AM4/1/20
to PandA project discussions and questions
Hi,

I got an error while running characterize_device.sh with mydevice-seed.xml.
Starting execution of Technology::FixCharacterization
Call stack
[0xae4d0e]

[0xae58dd]

[0xbba279]

[0x4d6be4]

[0x4048b8]

[0x12d6c36]

[0x12d7225]

[0x40daa9]

error -> Library miss component: ASSIGN_SINGLE_UNSIGNED_FU (f_unit_as)
        const functional_unit* technology_manager::CGetSetupHoldFU() const
        ../../src/technology/technology_manager.cpp:521

It seems like the error related to eucalyptus because mydevice.xml was not generated. 
I deleted etc/devices/NanoXplore_devices/nx1h35S.xml and ran characterize_device.sh with etc/devices/NanoXplore_devices/nx1h35S-seed.xml only.
The same error occurred as I stated above. I was wondering how to generate a valid <deviceid>.xml?

Fabrizio Ferrandi於 2020年3月31日星期二 UTC+8下午5時33分14秒寫道:
Reply all
Reply to author
Forward
0 new messages