I can't answer the question directly, there is a C utility which will
program fpg files into roach2s, called kcpfpg - it lives on github in
ska-ska/katcp_devel - run the toplevel makefile then cd into fpg and
there should be the utility

regards

marc


On Tue, Oct 11, 2016 at 12:56 PM, Heystek Grobler
<heystekgrob...@gmail.com> wrote:
> Hi
>
> I am now trying to do this manually line by line through ipython.
>
> Do anyone perhaps know what is the equivalent for the roach2 of the
> following function?
> fpga.progdev()
>
> a_0=struct.unpack('>1024l',fpga.read('even',1024*4,0))
> a_1=struct.unpack('>1024l',fpga.read('odd',1024*4,0))
>
>
>
> On Tue, Oct 11, 2016 at 1:43 PM, James Smith <jsm...@ska.ac.za> wrote:
>>
>> Hello Heystek,
>>
>> Having looked at the tut3 which is on the website, it is using the older
>> corr library, not casperfpga. It also looks as though it's intended for
>> ROACH and not ROACH2, I'm not sure whether that's an issue. I've never used
>> a ROACH2.
>>
>> I was under the impression that it should have been updated for the recent
>> CASPER workshop. Can someone comment on this?
>>
>> It might be an interesting exercise to try and use the model files to
>> compile for ROACH2 then to write your own script, using this one as a guide.
>> You'd learn a lot about how things work in the process. Not a quick fix to
>> your problem, I'll admit, but it'll be an education.
>>
>> Regards,
>> James
>>
>>
>> On Tue, Oct 11, 2016 at 1:33 PM, Heystek Grobler
>> <heystekgrob...@gmail.com> wrote:
>>>
>>> Hi James
>>>
>>> Through ipython I can connect to the Roach and upload the .fga file. I
>>> can also ping the roach.The problem comes in using the script with the .bof
>>> file. I am very new to python but have training in C, C#, Java and Assembly.
>>>
>>> I run the script as follows:
>>> python tut3.py 192.168.33.7
>>>
>>>
>>> On Tue, Oct 11, 2016 at 1:06 PM, James Smith <jsm...@ska.ac.za> wrote:
>>>>
>>>> Hello Heystek,
>>>>
>>>> How cognisant are you with Python? Try opening an ipython session and
>>>> connecting to your ROACH manually, I think you have been able to do that in
>>>> the past.
>>>>
>>>> This error message means that your network can't reach the ROACH for
>>>> some reason.
>>>>
>>>> Regards,
>>>> James
>>>>
>>>>
>>>> On Tue, Oct 11, 2016 at 12:46 PM, Heystek Grobler
>>>> <heystekgrob...@gmail.com> wrote:
>>>>>
>>>>> Hi Everyone
>>>>>
>>>>> After trying all of your suggestions and install a few more packages is
>>>>> works. I get the following error now when I run the tut3.py script for 
>>>>> tut3.
>>>>>
>>>>>
>>>>> heystek@heystek-HP-G62-Notebook-PC:~/simulink/heystek_tutorial_3/heystek_tut3$
>>>>> ./tut3.py 192.168.33.7 tut3.bofConnecting to server 192.168.33.7 on port
>>>>> 7147...  FAILURE DETECTED. Log entries:
>>>>> None
>>>>> Traceback (most recent call last):
>>>>>   File "./tut3.py", line 141, in <module>
>>>>>     exit_fail()
>>>>>   File "./tut3.py", line 21, in exit_fail
>>>>>     fpga.stop()
>>>>> NameError: global name 'fpga' is not defined
>>>>>
>>>>>
>>>>> Any ideas on how to solve this?
>>>>>
>>>>> Thank you
>>>>>
>>>>> Heystek
>>>>>
>>>>> On Fri, Oct 7, 2016 at 9:05 PM, Ryan Monroe <ryan.m.mon...@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> I would suggest using "pip uninstall spead" instead -- I don't recall
>>>>>> ever using it myself, but it appears to be the pip-sanctioned way of
>>>>>> removing something.
>>>>>>
>>>>>>
>>>>>> On 10/07/2016 02:24 AM, James Smith wrote:
>>>>>>
>>>>>> Hello Heystek,
>>>>>>
>>>>>> Pip is seeing that you've already got a version of Spead installed,
>>>>>> which might not have worked. You can delete the directory to 'uninstall' 
>>>>>> it
>>>>>> (Request for comment: is this a safe approach? It's what I've always done
>>>>>> with no problems.)
>>>>>>
>>>>>> Before you try that though, perhaps just try importing spead in
>>>>>> ipython as Ryan did. What are the error messages?
>>>>>>
>>>>>> Regards,
>>>>>> James
>>>>>>
>>>>>>
>>>>>> On Fri, Oct 7, 2016 at 11:23 AM, Heystek Grobler
>>>>>> <heystekgrob...@gmail.com> wrote:
>>>>>>>
>>>>>>> Hi James and Ryan
>>>>>>>
>>>>>>> I tried sudo pip install spead and I get the following
>>>>>>>
>>>>>>> Requirment already satisfied (use --upgrade): spead in
>>>>>>> usr/local/lib/python2.7/dist-packages
>>>>>>> cleaning up....
>>>>>>>
>>>>>>> Any ideas?
>>>>>>>
>>>>>>> I am a bit lost to be honest.
>>>>>>>
>>>>>>> On Fri, Oct 7, 2016 at 11:09 AM, James Smith <jsm...@ska.ac.za>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Hello Heystek,
>>>>>>>>
>>>>>>>> I vaguely recall installing spead from pip as well, as Ryan has done
>>>>>>>> here. Give that a whirl.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>> James
>>>>>>>>
>>>>>>>>
>>>>>>>> On Fri, Oct 7, 2016 at 11:06 AM, Ryan Monroe
>>>>>>>> <ryan.m.mon...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> rmonroe@rmonroe-ThinkPad-P50:~$ sudo pip install spead
>>>>>>>>> [sudo] password for rmonroe:
>>>>>>>>> The directory '/home/rmonroe/.cache/pip/http' or its parent
>>>>>>>>> directory is not owned by the current user and the cache has been 
>>>>>>>>> disabled.
>>>>>>>>> Please check the permissions and owner of that directory. If 
>>>>>>>>> executing pip
>>>>>>>>> with sudo, you may want sudo's -H flag.
>>>>>>>>> The directory '/home/rmonroe/.cache/pip' or its parent directory is
>>>>>>>>> not owned by the current user and caching wheels has been disabled. 
>>>>>>>>> check
>>>>>>>>> the permissions and owner of that directory. If executing pip with 
>>>>>>>>> sudo, you
>>>>>>>>> may want sudo's -H flag.
>>>>>>>>> Collecting spead
>>>>>>>>>   Downloading spead-0.5.1.tar.gz (61kB)
>>>>>>>>>     100% |████████████████████████████████| 71kB 1.5MB/s
>>>>>>>>> Installing collected packages: spead
>>>>>>>>>   Running setup.py install for spead ... done
>>>>>>>>> Successfully installed spead-0.5.1
>>>>>>>>> rmonroe@rmonroe-ThinkPad-P50:~$ ipython
>>>>>>>>> Python 2.7.12 (default, Jul  1 2016, 15:12:24)
>>>>>>>>> Type "copyright", "credits" or "license" for more information.
>>>>>>>>>
>>>>>>>>> IPython 2.4.1 -- An enhanced Interactive Python.
>>>>>>>>> ?         -> Introduction and overview of IPython's features.
>>>>>>>>> %quickref -> Quick reference.
>>>>>>>>> help      -> Python's own help system.
>>>>>>>>> object?   -> Details about 'object', use 'object??' for extra
>>>>>>>>> details.
>>>>>>>>>
>>>>>>>>> In [1]: import spead
>>>>>>>>>
>>>>>>>>> In [2]:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 10/07/2016 02:04 AM, Heystek Grobler wrote:
>>>>>>>>>
>>>>>>>>> Hi James
>>>>>>>>>
>>>>>>>>> I installed the PySpead package but I get the following error when
>>>>>>>>> I run the tut3.py script:
>>>>>>>>>
>>>>>>>>> ImportError: No mode named spead
>>>>>>>>>
>>>>>>>>> Do you perhaps have any ideas on how to solve it?
>>>>>>>>>
>>>>>>>>> Thank you!!
>>>>>>>>>
>>>>>>>>> Heystek
>>>>>>>>>
>>>>>>>>> On Fri, Oct 7, 2016 at 11:01 AM, James Smith <jsm...@ska.ac.za>
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello Heystek,
>>>>>>>>>>
>>>>>>>>>> If you're still in the Python environment, then PySpead is the one
>>>>>>>>>> you want.
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> James
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Fri, Oct 7, 2016 at 10:59 AM, Heystek Grobler
>>>>>>>>>> <heystekgrob...@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Good Day
>>>>>>>>>>>
>>>>>>>>>>> After a while of troubleshooting I determined the connection with
>>>>>>>>>>> TCP/IP into the board was correct. I updated the file system and 
>>>>>>>>>>> kernel of
>>>>>>>>>>> the ROACH2 and now I can program it.
>>>>>>>>>>>
>>>>>>>>>>> I only need to install a package called spead in order to use the
>>>>>>>>>>> .bof file with tutorial 3 of CASPER.
>>>>>>>>>>>
>>>>>>>>>>> Where can a download the spead package from? I can only find
>>>>>>>>>>> PySpead and Spead2.
>>>>>>>>>>>
>>>>>>>>>>> Thanks for everyones help
>>>>>>>>>>>
>>>>>>>>>>> Heystek!
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Sep 30, 2016 at 5:28 PM, Adam Isaacson
>>>>>>>>>>> <aisaac...@ska.ac.za> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Heystek,
>>>>>>>>>>>>
>>>>>>>>>>>> If you want to telnet, which is another way of configuring your
>>>>>>>>>>>> board, then you need to state the port. Are you doing the 
>>>>>>>>>>>> following from the
>>>>>>>>>>>> terminal:
>>>>>>>>>>>>
>>>>>>>>>>>> 1)Telnet to port 7147: "telnet <ip> 7147".
>>>>>>>>>>>>
>>>>>>>>>>>> 2)?progremote fpgfile.fpg
>>>>>>>>>>>>
>>>>>>>>>>>> You say you can ping your board, so you should be able to
>>>>>>>>>>>> connect via casperfpga, as you mentioned above. Did you do what 
>>>>>>>>>>>> James
>>>>>>>>>>>> suggested i.e. try running fpga.is_connected()? if it reports 
>>>>>>>>>>>> "True" then
>>>>>>>>>>>> you are connected and if false then you will need to debug 
>>>>>>>>>>>> further. Are you
>>>>>>>>>>>> sure that the IP you are pinging is your roach2 - may sound like a 
>>>>>>>>>>>> silly
>>>>>>>>>>>> question, but I don't know your setup.
>>>>>>>>>>>>
>>>>>>>>>>>> Kind Regards,
>>>>>>>>>>>>
>>>>>>>>>>>> Adam
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> On Fri, Sep 30, 2016 at 3:38 PM, Heystek Grobler
>>>>>>>>>>>> <heystekgrob...@gmail.com> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi James
>>>>>>>>>>>>>
>>>>>>>>>>>>> I will try it. Through the terminal I can ping the board, but I
>>>>>>>>>>>>> cant open a Telnet connection.
>>>>>>>>>>>>>
>>>>>>>>>>>>> When I open a ttyUSB connection to the Roach en monitor it, and
>>>>>>>>>>>>> try to upload the fga file, the Roach gives the same error 
>>>>>>>>>>>>> "progremote"
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thats why I'm confused
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks for your help!
>>>>>>>>>>>>>
>>>>>>>>>>>>> I really appreciate it
>>>>>>>>>>>>>
>>>>>>>>>>>>> Heystek
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Friday, 30 September 2016, James Smith <jsm...@ska.ac.za>
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hello Heystek,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Before you program the ROACH2, I'd suggest trying
>>>>>>>>>>>>>> fpga.is_connected() and fpga.est_clk_frequency() to check 
>>>>>>>>>>>>>> whether you can
>>>>>>>>>>>>>> actually communicate with the ROACH2. It might be a network 
>>>>>>>>>>>>>> cable that's
>>>>>>>>>>>>>> been unplugged by accident - that's where I've seen those errors 
>>>>>>>>>>>>>> before. The
>>>>>>>>>>>>>> fpga=casperfpga.katcp_fpga.KatcpFpga('roachname or ip_address') 
>>>>>>>>>>>>>> doesn't
>>>>>>>>>>>>>> actually throw an error if it can't connect to the ROACH2. This 
>>>>>>>>>>>>>> information
>>>>>>>>>>>>>> would at least help you narrow down the possibilities as to 
>>>>>>>>>>>>>> what's wrong
>>>>>>>>>>>>>> (i.e. whether it's the kernel on the ROACH2).
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Disclaimer: I work only on ROACH, but I'm fairly certain the
>>>>>>>>>>>>>> procedure would be the same.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Regards,
>>>>>>>>>>>>>> James
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Fri, Sep 30, 2016 at 1:36 PM, Heystek Grobler
>>>>>>>>>>>>>> <heystekgrob...@gmail.com> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Good day everyone
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I am having difficulties programming the ROACH 2 board. I am
>>>>>>>>>>>>>>> following the instructions of CASPER tutorial one.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I Have compiled the fpg file and is using the following steps
>>>>>>>>>>>>>>> from the tutorial.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> 1. I entered ipython into the terminal
>>>>>>>>>>>>>>> 2. import casperfpga
>>>>>>>>>>>>>>> 3. fpga=casperfpga.katcp_fpga.KatcpFpga('roachname or
>>>>>>>>>>>>>>> ip_address') with the ip address of my roach
>>>>>>>>>>>>>>> 4. fpga.upload_to_ram_and_program('your_fpgfile.fpg') with
>>>>>>>>>>>>>>> the location of the .fpga file
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> but at point 4 I get the following error:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> RuntimeError                              Traceback (most
>>>>>>>>>>>>>>> recent call last)
>>>>>>>>>>>>>>> <ipython-input-6-bdb3ff92f6c0> in <module>()
>>>>>>>>>>>>>>> ----> 1
>>>>>>>>>>>>>>> fpga.upload_to_ram_and_program('/home/heystek/simulink/ai_t1/bit_files/ai_t1_2016_Sep_14_2052.fpg')
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> /usr/local/lib/python2.7/dist-packages/casperfpga/katcp_fpga.pyc
>>>>>>>>>>>>>>>  in
>>>>>>>>>>>>>>> upload_to_ram_and_program(self, filename, port, timeout, 
>>>>>>>>>>>>>>> wait_complete)
>>>>>>>>>>>>>>>     442         if request_result != '':
>>>>>>>>>>>>>>>     443             raise RuntimeError('progremote
>>>>>>>>>>>>>>> request(%s) on host %s failed' %
>>>>>>>>>>>>>>> --> 444                                (request_result,
>>>>>>>>>>>>>>> self.host))
>>>>>>>>>>>>>>>     445
>>>>>>>>>>>>>>>     446         # start the upload thread and join
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> RuntimeError: progremote request(Request to client
>>>>>>>>>>>>>>> 192.168.33.4 failed.) on host 192.168.33.4 failed
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Am I doing something wrong?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> I looked at the mail archives and it sugested that I update
>>>>>>>>>>>>>>> the kernel of the roach. Is this perhaps the problem? Or am I 
>>>>>>>>>>>>>>> doing
>>>>>>>>>>>>>>> something wrong?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Have a wonderful day.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Heystek
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> Adam Isaacson
>>>>>>>>>>>>
>>>>>>>>>>>> DBE: FPGA Engineer
>>>>>>>>>>>>
>>>>>>>>>>>> SKA-SA
>>>>>>>>>>>>
>>>>>>>>>>>> 3rd Floor
>>>>>>>>>>>>
>>>>>>>>>>>> The Park
>>>>>>>>>>>>
>>>>>>>>>>>> Park Road
>>>>>>>>>>>>
>>>>>>>>>>>> Pinelands
>>>>>>>>>>>>
>>>>>>>>>>>> 7405
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Tel: +27215067300 (W)
>>>>>>>>>>>>
>>>>>>>>>>>> Fax: +27215067375 (W)
>>>>>>>>>>>>
>>>>>>>>>>>> Cell: +27825639602
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>

Reply via email to