Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-02 Thread Adam Isaacson
Hi Sean et al,

I have recently submitted a pull request to casper-astro/casperfpga master
branch that fixes the casperfpga progska install error - thanks to Tyrone
van Balla who fixed this. This should be merged shortly once reviewed and
accepted. As everyone says, it is not needed for the Red Pitaya.

Kind regards,

Adam Isaacson
South African Radio Astronomy Observatory (SARAO)
Hardware Manager
Cell: (+27) 825639602
Tel:  (+27) 215067300
email: aisaac...@ska.ac.za



On Mon, Jun 1, 2020 at 8:12 PM Wesley New  wrote:

> Hi Sean.
>
> progska is a c utility that we use to speed up the programming of the
> skarab boards and is not needed for the RP.
>
>
> On Mon, 01 Jun 2020, 7:23 PM Sean Mckee,  wrote:
>
>> Hi Jack,
>>
>> I did try installing casperfpga on the red pitaya, but it appears that
>> one of the libraries (progska, if I recall correctly) requires 64-bit. It
>> was giving me ELFCLASS64 error. Not sure if there's a work around, but I'm
>> pretty comfortable writing C code to run on the red pitaya to manage the
>> registers, so that's the direction I've gone.
>>
>> Thanks!
>> Sean
>>
>> On Monday, June 1, 2020 at 3:59:13 AM UTC-6, Jack Hickish wrote:
>>>
>>> Hi Sean,
>>>
>>> Just to explicitly add to wes's advice - in addition to the telnet
>>> interface on localhost, you can "just" install full blown casperfpga to
>>> your red pitaya, and connect via localhost using the scripts you already
>>> have. Unless your performance requirements are such that python is out of
>>> the question, this is probably the easiest thing to do.
>>>
>>> Cheers
>>> Jack
>>>
>>>
>>> On Sun, 31 May 2020, 10:45 pm Sean Mckee,  wrote:
>>>
 Hi Wesley,

 Thank you, that's what I was looking for!

 On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:
>
> Hi Sean,
>
> These are all good questions and Ill try to point you in the right
> direction.
>
> So if you followed this tutorial to setup your red pitaya:
> https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
> You should have tcpborphserver installed on the PS. You can telnet
> into tcpborphserver and issue register read and writes that way. ie you
> could telnet into tcpborphserver on localhost form the RP using a python
> script and run your tasks that way. If I remember correctly tcpboprhserver
> can address a register by name so you shouldnt need to worry about memory
> maps, but if you are you can look at the fpg file that you uploaded and 
> the
> header will contain the memory map. You can also see the memory map in a
> file called coreinfo.tab in your build directory.
>
> Hope this helps.
>
> Wesley New
> South African SKA Project
> +2721 506 7300
> www.ska.ac.za
>
>
>
>
> On Sun, May 31, 2020 at 7:56 PM Sean Mckee 
> wrote:
>
>> Hi all,
>>
>> I'm trying to determine how I would go about finding/using the
>> addresses of the memory mapped registers being used by the FPGA, from the
>> PS side of the Red Pitaya. For example, in the spectrometer tutorial, 
>> there
>> are several registers used to control the design, and others to pull data
>> out from the design. If I access the Red Pitaya from my computer using 
>> the
>> casperfpga.py module, these registers are all conveniently named and the
>> python module has tools to read data from snap blocks, write to the reset
>> and trigger registers, etc.
>>
>> Is there a convenient way to have this same level of control on the
>> red pitaya itself? I would like to write code that runs on the PS to
>> monitor these registers and handle the data output. From what I can
>> currently find, I will need to open the /dev/mem file and use the mmap()
>> command. But how do I find out which physical register corresponds to 
>> which
>> simulink block? And I assume that even a minor update to the simulink
>> design could result in the registers being moved around, so what is a 
>> good
>> way to account for this?
>>
>> Currently, I am trying to trace what happens when I call casperfpga
>> commands from my computer. I understand the parsing of the commands and 
>> the
>> hand off to tcpborphserver, but I can't seem to unravel what is happening
>> when the red pitaya receives these commands. I'm assuming this code is
>> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>>
>> Hopefully someone knows of a good resource to fill in my knowledge
>> gaps.
>>
>> Thanks!
>> Sean
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "cas...@lists.berkeley.edu" group.
>> To unsubscribe from this group and stop receiving emails from it,
>> send an email to 

Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Wesley New
Hi Sean.

progska is a c utility that we use to speed up the programming of the
skarab boards and is not needed for the RP.


On Mon, 01 Jun 2020, 7:23 PM Sean Mckee,  wrote:

> Hi Jack,
>
> I did try installing casperfpga on the red pitaya, but it appears that one
> of the libraries (progska, if I recall correctly) requires 64-bit. It was
> giving me ELFCLASS64 error. Not sure if there's a work around, but I'm
> pretty comfortable writing C code to run on the red pitaya to manage the
> registers, so that's the direction I've gone.
>
> Thanks!
> Sean
>
> On Monday, June 1, 2020 at 3:59:13 AM UTC-6, Jack Hickish wrote:
>>
>> Hi Sean,
>>
>> Just to explicitly add to wes's advice - in addition to the telnet
>> interface on localhost, you can "just" install full blown casperfpga to
>> your red pitaya, and connect via localhost using the scripts you already
>> have. Unless your performance requirements are such that python is out of
>> the question, this is probably the easiest thing to do.
>>
>> Cheers
>> Jack
>>
>>
>> On Sun, 31 May 2020, 10:45 pm Sean Mckee,  wrote:
>>
>>> Hi Wesley,
>>>
>>> Thank you, that's what I was looking for!
>>>
>>> On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:

 Hi Sean,

 These are all good questions and Ill try to point you in the right
 direction.

 So if you followed this tutorial to setup your red pitaya:
 https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
 You should have tcpborphserver installed on the PS. You can telnet into
 tcpborphserver and issue register read and writes that way. ie you could
 telnet into tcpborphserver on localhost form the RP using a python script
 and run your tasks that way. If I remember correctly tcpboprhserver can
 address a register by name so you shouldnt need to worry about memory maps,
 but if you are you can look at the fpg file that you uploaded and the
 header will contain the memory map. You can also see the memory map in a
 file called coreinfo.tab in your build directory.

 Hope this helps.

 Wesley New
 South African SKA Project
 +2721 506 7300
 www.ska.ac.za




 On Sun, May 31, 2020 at 7:56 PM Sean Mckee 
 wrote:

> Hi all,
>
> I'm trying to determine how I would go about finding/using the
> addresses of the memory mapped registers being used by the FPGA, from the
> PS side of the Red Pitaya. For example, in the spectrometer tutorial, 
> there
> are several registers used to control the design, and others to pull data
> out from the design. If I access the Red Pitaya from my computer using the
> casperfpga.py module, these registers are all conveniently named and the
> python module has tools to read data from snap blocks, write to the reset
> and trigger registers, etc.
>
> Is there a convenient way to have this same level of control on the
> red pitaya itself? I would like to write code that runs on the PS to
> monitor these registers and handle the data output. From what I can
> currently find, I will need to open the /dev/mem file and use the mmap()
> command. But how do I find out which physical register corresponds to 
> which
> simulink block? And I assume that even a minor update to the simulink
> design could result in the registers being moved around, so what is a good
> way to account for this?
>
> Currently, I am trying to trace what happens when I call casperfpga
> commands from my computer. I understand the parsing of the commands and 
> the
> hand off to tcpborphserver, but I can't seem to unravel what is happening
> when the red pitaya receives these commands. I'm assuming this code is
> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>
> Hopefully someone knows of a good resource to fill in my knowledge
> gaps.
>
> Thanks!
> Sean
>
> --
> You received this message because you are subscribed to the Google
> Groups "cas...@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cas...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
> 
> .
>
 --
>>> You received this message because you are subscribed to the Google
>>> Groups "cas...@lists.berkeley.edu" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cas...@lists.berkeley.edu.
>>> To view this discussion on the web visit
>>> 

Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Jack Hickish
Hi Sean,

Sounds like you have everything under control, but FWIW that progska code
isn't needed except for the SKARAB. If it really is just that binary then
if you can coerce python to get past the install error, it won't impact
your ability to run on the pitaya.

Cheers
Jack

On Mon, 1 Jun 2020 at 18:23, Sean Mckee  wrote:

> Hi Jack,
>
> I did try installing casperfpga on the red pitaya, but it appears that one
> of the libraries (progska, if I recall correctly) requires 64-bit. It was
> giving me ELFCLASS64 error. Not sure if there's a work around, but I'm
> pretty comfortable writing C code to run on the red pitaya to manage the
> registers, so that's the direction I've gone.
>
> Thanks!
> Sean
>
> On Monday, June 1, 2020 at 3:59:13 AM UTC-6, Jack Hickish wrote:
>>
>> Hi Sean,
>>
>> Just to explicitly add to wes's advice - in addition to the telnet
>> interface on localhost, you can "just" install full blown casperfpga to
>> your red pitaya, and connect via localhost using the scripts you already
>> have. Unless your performance requirements are such that python is out of
>> the question, this is probably the easiest thing to do.
>>
>> Cheers
>> Jack
>>
>>
>> On Sun, 31 May 2020, 10:45 pm Sean Mckee,  wrote:
>>
>>> Hi Wesley,
>>>
>>> Thank you, that's what I was looking for!
>>>
>>> On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:

 Hi Sean,

 These are all good questions and Ill try to point you in the right
 direction.

 So if you followed this tutorial to setup your red pitaya:
 https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
 You should have tcpborphserver installed on the PS. You can telnet into
 tcpborphserver and issue register read and writes that way. ie you could
 telnet into tcpborphserver on localhost form the RP using a python script
 and run your tasks that way. If I remember correctly tcpboprhserver can
 address a register by name so you shouldnt need to worry about memory maps,
 but if you are you can look at the fpg file that you uploaded and the
 header will contain the memory map. You can also see the memory map in a
 file called coreinfo.tab in your build directory.

 Hope this helps.

 Wesley New
 South African SKA Project
 +2721 506 7300
 www.ska.ac.za




 On Sun, May 31, 2020 at 7:56 PM Sean Mckee 
 wrote:

> Hi all,
>
> I'm trying to determine how I would go about finding/using the
> addresses of the memory mapped registers being used by the FPGA, from the
> PS side of the Red Pitaya. For example, in the spectrometer tutorial, 
> there
> are several registers used to control the design, and others to pull data
> out from the design. If I access the Red Pitaya from my computer using the
> casperfpga.py module, these registers are all conveniently named and the
> python module has tools to read data from snap blocks, write to the reset
> and trigger registers, etc.
>
> Is there a convenient way to have this same level of control on the
> red pitaya itself? I would like to write code that runs on the PS to
> monitor these registers and handle the data output. From what I can
> currently find, I will need to open the /dev/mem file and use the mmap()
> command. But how do I find out which physical register corresponds to 
> which
> simulink block? And I assume that even a minor update to the simulink
> design could result in the registers being moved around, so what is a good
> way to account for this?
>
> Currently, I am trying to trace what happens when I call casperfpga
> commands from my computer. I understand the parsing of the commands and 
> the
> hand off to tcpborphserver, but I can't seem to unravel what is happening
> when the red pitaya receives these commands. I'm assuming this code is
> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>
> Hopefully someone knows of a good resource to fill in my knowledge
> gaps.
>
> Thanks!
> Sean
>
> --
> You received this message because you are subscribed to the Google
> Groups "cas...@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cas...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
> 
> .
>
 --
>>> You received this message because you are subscribed to the Google
>>> Groups "cas...@lists.berkeley.edu" group.
>>> To unsubscribe from this group and 

Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Sean Mckee
Hi Jack,

I did try installing casperfpga on the red pitaya, but it appears that one 
of the libraries (progska, if I recall correctly) requires 64-bit. It was 
giving me ELFCLASS64 error. Not sure if there's a work around, but I'm 
pretty comfortable writing C code to run on the red pitaya to manage the 
registers, so that's the direction I've gone.

Thanks!
Sean

On Monday, June 1, 2020 at 3:59:13 AM UTC-6, Jack Hickish wrote:
>
> Hi Sean,
>
> Just to explicitly add to wes's advice - in addition to the telnet 
> interface on localhost, you can "just" install full blown casperfpga to 
> your red pitaya, and connect via localhost using the scripts you already 
> have. Unless your performance requirements are such that python is out of 
> the question, this is probably the easiest thing to do.
>
> Cheers
> Jack
>
>
> On Sun, 31 May 2020, 10:45 pm Sean Mckee,  > wrote:
>
>> Hi Wesley,
>>
>> Thank you, that's what I was looking for!
>>
>> On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:
>>>
>>> Hi Sean,
>>>
>>> These are all good questions and Ill try to point you in the right 
>>> direction.
>>>
>>> So if you followed this tutorial to setup your red pitaya: 
>>> https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
>>> You should have tcpborphserver installed on the PS. You can telnet into 
>>> tcpborphserver and issue register read and writes that way. ie you could 
>>> telnet into tcpborphserver on localhost form the RP using a python script 
>>> and run your tasks that way. If I remember correctly tcpboprhserver can 
>>> address a register by name so you shouldnt need to worry about memory maps, 
>>> but if you are you can look at the fpg file that you uploaded and the 
>>> header will contain the memory map. You can also see the memory map in a 
>>> file called coreinfo.tab in your build directory.
>>>
>>> Hope this helps.
>>>
>>> Wesley New
>>> South African SKA Project
>>> +2721 506 7300
>>> www.ska.ac.za
>>>
>>>
>>>
>>>
>>> On Sun, May 31, 2020 at 7:56 PM Sean Mckee  wrote:
>>>
 Hi all,

 I'm trying to determine how I would go about finding/using the 
 addresses of the memory mapped registers being used by the FPGA, from the 
 PS side of the Red Pitaya. For example, in the spectrometer tutorial, 
 there 
 are several registers used to control the design, and others to pull data 
 out from the design. If I access the Red Pitaya from my computer using the 
 casperfpga.py module, these registers are all conveniently named and the 
 python module has tools to read data from snap blocks, write to the reset 
 and trigger registers, etc.

 Is there a convenient way to have this same level of control on the red 
 pitaya itself? I would like to write code that runs on the PS to monitor 
 these registers and handle the data output. From what I can currently 
 find, 
 I will need to open the /dev/mem file and use the mmap() command. But how 
 do I find out which physical register corresponds to which simulink block? 
 And I assume that even a minor update to the simulink design could result 
 in the registers being moved around, so what is a good way to account for 
 this?

 Currently, I am trying to trace what happens when I call casperfpga 
 commands from my computer. I understand the parsing of the commands and 
 the 
 hand off to tcpborphserver, but I can't seem to unravel what is happening 
 when the red pitaya receives these commands. I'm assuming this code is 
 somewhere in the katcp library (https://github.com/ska-sa/katcp)?

 Hopefully someone knows of a good resource to fill in my knowledge gaps.

 Thanks!
 Sean

 -- 
 You received this message because you are subscribed to the Google 
 Groups "cas...@lists.berkeley.edu" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to cas...@lists.berkeley.edu.
 To view this discussion on the web visit 
 https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
  
 
 .

>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "cas...@lists.berkeley.edu " group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cas...@lists.berkeley.edu .
>> To view this discussion on the web visit 
>> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/c4f0d757-d3ca-431f-b1de-f27392f68b3f%40lists.berkeley.edu
>>  
>> 

Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Vereese Van Tonder
On Mon, Jun 1, 2020 at 12:05 PM Marc  wrote:

> On Sun, May 31, 2020 at 6:54 PM Wesley New  wrote:
>
>
> > You should have tcpborphserver installed on the PS. You can telnet into
> tcpborphserver and issue register read and writes that way. ie you could
> telnet into tcpborphserver on localhost form the RP using a python script
> and run your tasks that way. If I remember correctly tcpboprhserver can
> address a register by name so you shouldnt need to worry about memory maps,
>
> There should be a ?listsdev command to give you the register mapping.
> Not sure if the red pitaya has kcpcmd installed, if it does type
>
Yes, I think kcpcmd should be installed along with tcpborphserver.

>
>   kcpcmd listdev
>
> or
>
>   kcpcmd help
>
> regards
>
> marc
>
> --
> You received this message because you are subscribed to the Google Groups "
> casper@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to casper+unsubscr...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGrhWaQLihD1PQFv91A6J79JiLprcAVG_fqF6QFj%2BbNzK4_Zdg%40mail.gmail.com
> .
>


-- 
Kind Regards,
Vereesé

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAJZFCF_GP_OsQQynQJPhTixNZROuf_DM8uhdcawyfqYyj4p0bg%40mail.gmail.com.


Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Marc
On Sun, May 31, 2020 at 6:54 PM Wesley New  wrote:


> You should have tcpborphserver installed on the PS. You can telnet into 
> tcpborphserver and issue register read and writes that way. ie you could 
> telnet into tcpborphserver on localhost form the RP using a python script and 
> run your tasks that way. If I remember correctly tcpboprhserver can address a 
> register by name so you shouldnt need to worry about memory maps,

There should be a ?listsdev command to give you the register mapping.
Not sure if the red pitaya has kcpcmd installed, if it does type

  kcpcmd listdev

or

  kcpcmd help

regards

marc

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGrhWaQLihD1PQFv91A6J79JiLprcAVG_fqF6QFj%2BbNzK4_Zdg%40mail.gmail.com.


Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-06-01 Thread Jack Hickish
Hi Sean,

Just to explicitly add to wes's advice - in addition to the telnet
interface on localhost, you can "just" install full blown casperfpga to
your red pitaya, and connect via localhost using the scripts you already
have. Unless your performance requirements are such that python is out of
the question, this is probably the easiest thing to do.

Cheers
Jack


On Sun, 31 May 2020, 10:45 pm Sean Mckee,  wrote:

> Hi Wesley,
>
> Thank you, that's what I was looking for!
>
> On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:
>>
>> Hi Sean,
>>
>> These are all good questions and Ill try to point you in the right
>> direction.
>>
>> So if you followed this tutorial to setup your red pitaya:
>> https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
>> You should have tcpborphserver installed on the PS. You can telnet into
>> tcpborphserver and issue register read and writes that way. ie you could
>> telnet into tcpborphserver on localhost form the RP using a python script
>> and run your tasks that way. If I remember correctly tcpboprhserver can
>> address a register by name so you shouldnt need to worry about memory maps,
>> but if you are you can look at the fpg file that you uploaded and the
>> header will contain the memory map. You can also see the memory map in a
>> file called coreinfo.tab in your build directory.
>>
>> Hope this helps.
>>
>> Wesley New
>> South African SKA Project
>> +2721 506 7300
>> www.ska.ac.za
>>
>>
>>
>>
>> On Sun, May 31, 2020 at 7:56 PM Sean Mckee  wrote:
>>
>>> Hi all,
>>>
>>> I'm trying to determine how I would go about finding/using the addresses
>>> of the memory mapped registers being used by the FPGA, from the PS side of
>>> the Red Pitaya. For example, in the spectrometer tutorial, there are
>>> several registers used to control the design, and others to pull data out
>>> from the design. If I access the Red Pitaya from my computer using the
>>> casperfpga.py module, these registers are all conveniently named and the
>>> python module has tools to read data from snap blocks, write to the reset
>>> and trigger registers, etc.
>>>
>>> Is there a convenient way to have this same level of control on the red
>>> pitaya itself? I would like to write code that runs on the PS to monitor
>>> these registers and handle the data output. From what I can currently find,
>>> I will need to open the /dev/mem file and use the mmap() command. But how
>>> do I find out which physical register corresponds to which simulink block?
>>> And I assume that even a minor update to the simulink design could result
>>> in the registers being moved around, so what is a good way to account for
>>> this?
>>>
>>> Currently, I am trying to trace what happens when I call casperfpga
>>> commands from my computer. I understand the parsing of the commands and the
>>> hand off to tcpborphserver, but I can't seem to unravel what is happening
>>> when the red pitaya receives these commands. I'm assuming this code is
>>> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>>>
>>> Hopefully someone knows of a good resource to fill in my knowledge gaps.
>>>
>>> Thanks!
>>> Sean
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "cas...@lists.berkeley.edu" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to cas...@lists.berkeley.edu.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups "
> casper@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to casper+unsubscr...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/c4f0d757-d3ca-431f-b1de-f27392f68b3f%40lists.berkeley.edu
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAG1GKSncaPBKOjbg_rx%2Bd5ZqP2EB5DfHGCEYE%3DSinu_%3DoqEJ%2Bw%40mail.gmail.com.


Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-05-31 Thread Sean Mckee
Hi Wesley,

Thank you, that's what I was looking for!

On Sunday, May 31, 2020 at 12:54:31 PM UTC-6, wesley wrote:
>
> Hi Sean,
>
> These are all good questions and Ill try to point you in the right 
> direction.
>
> So if you followed this tutorial to setup your red pitaya: 
> https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
> You should have tcpborphserver installed on the PS. You can telnet into 
> tcpborphserver and issue register read and writes that way. ie you could 
> telnet into tcpborphserver on localhost form the RP using a python script 
> and run your tasks that way. If I remember correctly tcpboprhserver can 
> address a register by name so you shouldnt need to worry about memory maps, 
> but if you are you can look at the fpg file that you uploaded and the 
> header will contain the memory map. You can also see the memory map in a 
> file called coreinfo.tab in your build directory.
>
> Hope this helps.
>
> Wesley New
> South African SKA Project
> +2721 506 7300
> www.ska.ac.za
>
>
>
>
> On Sun, May 31, 2020 at 7:56 PM Sean Mckee  > wrote:
>
>> Hi all,
>>
>> I'm trying to determine how I would go about finding/using the addresses 
>> of the memory mapped registers being used by the FPGA, from the PS side of 
>> the Red Pitaya. For example, in the spectrometer tutorial, there are 
>> several registers used to control the design, and others to pull data out 
>> from the design. If I access the Red Pitaya from my computer using the 
>> casperfpga.py module, these registers are all conveniently named and the 
>> python module has tools to read data from snap blocks, write to the reset 
>> and trigger registers, etc.
>>
>> Is there a convenient way to have this same level of control on the red 
>> pitaya itself? I would like to write code that runs on the PS to monitor 
>> these registers and handle the data output. From what I can currently find, 
>> I will need to open the /dev/mem file and use the mmap() command. But how 
>> do I find out which physical register corresponds to which simulink block? 
>> And I assume that even a minor update to the simulink design could result 
>> in the registers being moved around, so what is a good way to account for 
>> this?
>>
>> Currently, I am trying to trace what happens when I call casperfpga 
>> commands from my computer. I understand the parsing of the commands and the 
>> hand off to tcpborphserver, but I can't seem to unravel what is happening 
>> when the red pitaya receives these commands. I'm assuming this code is 
>> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>>
>> Hopefully someone knows of a good resource to fill in my knowledge gaps.
>>
>> Thanks!
>> Sean
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "cas...@lists.berkeley.edu " group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cas...@lists.berkeley.edu .
>> To view this discussion on the web visit 
>> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/c4f0d757-d3ca-431f-b1de-f27392f68b3f%40lists.berkeley.edu.


Re: [casper] Red Pitaya access registers of snap blocks from PS

2020-05-31 Thread Wesley New
Hi Sean,

These are all good questions and Ill try to point you in the right
direction.

So if you followed this tutorial to setup your red pitaya:
https://casper-toolflow.readthedocs.io/projects/tutorials/en/latest/tutorials/redpitaya/red_pitaya_setup.html#running-the-script-on-a-preloaded-rp-sd-card
You should have tcpborphserver installed on the PS. You can telnet into
tcpborphserver and issue register read and writes that way. ie you could
telnet into tcpborphserver on localhost form the RP using a python script
and run your tasks that way. If I remember correctly tcpboprhserver can
address a register by name so you shouldnt need to worry about memory maps,
but if you are you can look at the fpg file that you uploaded and the
header will contain the memory map. You can also see the memory map in a
file called coreinfo.tab in your build directory.

Hope this helps.

Wesley New
South African SKA Project
+2721 506 7300
www.ska.ac.za




On Sun, May 31, 2020 at 7:56 PM Sean Mckee  wrote:

> Hi all,
>
> I'm trying to determine how I would go about finding/using the addresses
> of the memory mapped registers being used by the FPGA, from the PS side of
> the Red Pitaya. For example, in the spectrometer tutorial, there are
> several registers used to control the design, and others to pull data out
> from the design. If I access the Red Pitaya from my computer using the
> casperfpga.py module, these registers are all conveniently named and the
> python module has tools to read data from snap blocks, write to the reset
> and trigger registers, etc.
>
> Is there a convenient way to have this same level of control on the red
> pitaya itself? I would like to write code that runs on the PS to monitor
> these registers and handle the data output. From what I can currently find,
> I will need to open the /dev/mem file and use the mmap() command. But how
> do I find out which physical register corresponds to which simulink block?
> And I assume that even a minor update to the simulink design could result
> in the registers being moved around, so what is a good way to account for
> this?
>
> Currently, I am trying to trace what happens when I call casperfpga
> commands from my computer. I understand the parsing of the commands and the
> hand off to tcpborphserver, but I can't seem to unravel what is happening
> when the red pitaya receives these commands. I'm assuming this code is
> somewhere in the katcp library (https://github.com/ska-sa/katcp)?
>
> Hopefully someone knows of a good resource to fill in my knowledge gaps.
>
> Thanks!
> Sean
>
> --
> You received this message because you are subscribed to the Google Groups "
> casper@lists.berkeley.edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to casper+unsubscr...@lists.berkeley.edu.
> To view this discussion on the web visit
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7fcb1398-42a3-45a0-8da5-1801f2274d71%40lists.berkeley.edu
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"casper@lists.berkeley.edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to casper+unsubscr...@lists.berkeley.edu.
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAE2vkmVR1ky10b0D2TER-rgD3K-PRnA3mmzgPDi%3D3ASjai%3D_-A%40mail.gmail.com.