UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer coldwarcomms
Observer
9,417 Views
Registered: ‎01-16-2010

Linux HWICAP Driver

Hello,

 

I am trying to use the Linux HWICAP driver from git.xilinx.com for partial dynamic reconfiguration. I am using the 12.1 tools with the partial reconfiguration license. I followed UG744 and created a simple system with a PLB peripheral as outlined in the guide. I generated new netlists for the adder and multiplier circuits to target them for the Virtex-5. The icap driver is compiled into the kernel and is found at startup, /dev/icap0 exists. I enabled the debug output in the driver as well by defining DEBUG. When I do cp partial.bit /dev/icap0, the command completes. However, the circuit functionality does not change. A reset as outlined in UG744 is sent to the peripheral after reconfiguration. The debug output I get can be seen using dmesg as follows:

 

icap 86800000.xps-hwicap: initializing

icap 86800000.xps-hwicap: Reset...

icap 86800000.xps-hwicap: Desync...

icap 86800000.xps-hwicap: Reading IDCODE...

icap 86800000.xps-hwicap: IDCODE = 23300093

icap 86800000.xps-hwicap: Desync...

 

If I repeat the command, I get the following output, and the command is not successful:

 

icap 86800000.xps-hwicap: initializing

icap 86800000.xps-hwicap: Reset...

icap 86800000.xps-hwicap: Desync...

icap 86800000.xps-hwicap: Reading IDCODE...

icap 86800000.xps-hwicap: IDCODE = df1b3e50

icap 86800000.xps-hwicap: Failed to open file

 

Another thing I tried was stripping the header from the partial bitstream and feeding the driver the actual configuration data. This causes the kernel to hang. I'm just wondering if anyone knows anything about the driver so I can save some time in my debugging process. My preferred debugging method of using XMD and getting traces on a kernel hang does not seem to work. When I try that, the icap interface just will never open. I heard somewhere that using JTAG will prevent ICAP from working correctly.

 

Thanks,

-Nick

 

0 Kudos
12 Replies
Anonymous
Not applicable
9,404 Views

Re: Linux HWICAP Driver

Have you tried this out yet using the standalone BSP?

 

Terry

 

0 Kudos
Observer coldwarcomms
Observer
9,397 Views
Registered: ‎01-16-2010

Re: Linux HWICAP Driver

No, I haven't tried that, but I assume it will work fine. I did look through the code though. There were a few registers BOOTSTS and CTL_1which are defined differently between the UG744 code and the Linux driver for the Virtex-5. I guess I'l try running the standalone app just to be sure everything works. Assuming that goes smoothly, I guess I'll have to work my way through the driver unless anyone has any insights.

 

-Nick

0 Kudos
Anonymous
Not applicable
9,395 Views

Re: Linux HWICAP Driver

It's always a good idea to test out the hardware interfaces in standalone mode before moving to linux. I would never assume anything is working, especially something as complicated (potentially) as partial reconfiguration.

 

Good luck!

 

 

Terry

0 Kudos
Observer coldwarcomms
Observer
9,178 Views
Registered: ‎01-16-2010

Re: Linux HWICAP Driver

In case anyone is curious, I finally got the HWICAP Linux driver working correctly for my hardware (ML510). I made a standalone system and got that working ok after a little messing around. I tried using that same configuration with the Linux driver and it wouldn't work. I made some modifications to the packet format in the desync and get_configuration code in the driver to match the standalone driver code. That didn't seem to do anything. When I tried to use the ICAP with the driver, sometimes the operation would complete, but the hardware wasn't modified. Sometimes, it would write the partial bitstream up until the last 4 words or so and then lockup the fpga. I ended up modifying the set_configuration call in the write function to only write a single word rather than a bunch of words all at once. This solution has been working consistently, but I still need to look into it more to determine why. At this point I'm not too concerned though. I will probably post a link to my repository with the modified driver sometime next week if anyone is interested.

0 Kudos
Visitor huangbilly
Visitor
9,156 Views
Registered: ‎06-29-2010

Re: Linux HWICAP Driver

Hi coldwarcomms,

 

I'm very interested in the HWICAP driver and would like to see how you modified it, if you don't mind!

 

I've just ported linux onto the SP601 board with UBOOT and hopefully will get the code online soon (people can email me at billykhuang@gmail.com) if they can't wait.

 

I'm hoping to see if it's possible to use HWICAP for board reseting (i'm not sure if it's possible but worth a try) from linux.

 

Thanks,

 

Billy.

0 Kudos
Observer coldwarcomms
Observer
9,121 Views
Registered: ‎01-16-2010

Re: Linux HWICAP Driver

Hey Billy,

 

Have you tried doing partial reconfiguration yet on that board? You should make sure you can get the standalone system working before you move to Linux. Also, my modifications may break the HWICAP driver for other hardware configurations. Anyways, the code is up in my kernel tree. Go here http://fpga.ce.rit.edu/?p=linux-2.6-xlnx.git;a=summary and look at commit: f1f8fc35892fa5acb9a2a746c5def44deb6343f1.

 

-Nick

0 Kudos
Scholar pumaju1808
Scholar
9,006 Views
Registered: ‎08-14-2007

Re: Linux HWICAP Driver

hello,

 

i want to follow the tutorials of Partial reconfiguration 12.1 but in a ML403; do you think that i can implement these tutorials on a ML403 ???

 

What main considerations or changes do i need to do to follow these tutorials on another board??

 

thanks for your advice

 

regards

0 Kudos
Observer coldwarcomms
Observer
8,955 Views
Registered: ‎01-16-2010

Re: Linux HWICAP Driver

Hey,

 

As far as I know it should be possible to get the 12.1 partial reconfiguration working on that board. I primarily followed UG744. There are a few things to be aware of. The first is that the adder and multiplier netlists that come in the project files are for a Virtex 6 device and will not work with your board. You will need to generate new netlists for your board in ISE. The following is the vhdl code I wrote for generating the new netlists:

 

-- Adder code (adder.vhd)

 

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity rp is
port (
        ain         : in std_logic_vector(0 to 31);
        bin         : in std_logic_vector(0 to 31);
        Clk         : in std_logic;
        Reset     : in std_logic;
        result     : out std_logic_vector(0 to 31)
    );
end rp;

architecture adder of rp is

begin
    add: process(Clk, Reset)
    begin
        if Reset = '1' then
            result <= (others => '0');
        elsif Clk'event and Clk = '1' then
            result <= ain + bin;
        end if;
    end process add;

end architecture adder;

 

-- Multiplier code (mult.vhd)

 

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

entity rp is
port (
        ain         : in std_logic_vector(0 to 31);
        bin         : in std_logic_vector(0 to 31);
        Clk         : in std_logic;
        Reset     : in std_logic;
        result     : out std_logic_vector(0 to 31)
    );
end rp;

architecture mult of rp is

begin
    add: process(Clk, Reset)
    begin
        if Reset = '1' then
            result <= (others => '0');
        elsif Clk'event and Clk = '1' then
            result <= ain * bin;
        end if;
    end process add;

end architecture mult;

 

Synthesize those in ISE and keep track of the two netlists generated, both must be called rp.ngc. I just built one and moved it to a different folder, then built the other. After that, you should be able to pretty much just follow the guide. For starters I would keep the reconfigurable block small and make sure to only constrain SLICE and DSP48 elements until you are more familiar with the process. Just try to get the standalone system working for now as outlined in the guide. Once you get that working, I can help you with Linux if that's what you want to do.

 

-Nick

0 Kudos
Scholar pumaju1808
Scholar
8,841 Views
Registered: ‎08-14-2007

Re: Linux HWICAP Driver

thanks for your answer

 

you gave good advices respect to NGC files for adder and multiplier; if you have some other major aspects to consider in order to implement these tutorials on different board, please let me know.

 

I will try to do these tutorials on ML403 and will give my experience

 

regards

0 Kudos
Highlighted
Newbie x75
Newbie
4,136 Views
Registered: ‎12-15-2010

Re: Linux HWICAP Driver

Nick, thanks again for this posting. My system now finally works, the last bit missing was the use of /dev/icap0 from within Linux. It comprises of an ML-507, embedded Linux on the PPC processor, PR-based audio processing chain with network transmission via Linux. I have yet to test the original xlnx driver as currently I am using your version with kernel 2.6.33, but the crucial bit seems to have been to strip off the header of the bitfile, otherwise /dev/icap get's very upset and stops working. I have posted my preliminary notes at http://www2.informatik.hu-berlin.de/~oberthol/html/HWSV%2020101104%20-%20Partial%20Reconfiguration%20Tutorial.html and will update them soon to reflect the final parts. cheers, opt
Tags (4)
0 Kudos
Visitor gndrix
Visitor
3,857 Views
Registered: ‎04-25-2011

Re: Linux HWICAP Driver

Hello Nick!, I've got the UG744 running in standalone mode on a ML507 board. Now I'd like to make it work with Linux. Here in the lab we work with Poky Platform Builder to generate custom linux distributions. Could you help me in correcting the icap driver?. I found this link that supposedly pointed to your driver development but unfortunately it's been offline for a longtime http://fpgawiki.ce.rit.edu/index.php/Main_Page.

Thanks in advance!.

0 Kudos
Visitor luklem
Visitor
3,849 Views
Registered: ‎07-11-2011

Re: Linux HWICAP Driver

What is not functional in the Linux ICAP driver? It seems to work for me with some issues but that is related to read-back commands. 

0 Kudos