Dear June, I am sorry you are encountering this problem. SKARAB has only been baselined and fully tested using Python 2.7 for casperfpga. Yes, some attempts have been made to port it to Python 3.8, but as far as I am aware there have been issues that were never fully sorted out. It looks like you may be encountering those.
I would try to run it using Python 2.7 first. NB: SKARAB baseline testing suggested versions: *Toolflow*: Ubuntu 18.04LTS, Python 3.6 (Virtual environment), Matlab R2018a, Vivado 2019.1.1. *casperfpga*: Ubuntu 18.04LTS, Python 2.7 (Virtual environment) It should be pointed out that work has been done on the toolflow to get it to work with Ubuntu 18.04LTS, Python 3.8, Matlab R2021a and Vivado 2021.1. NB: Please note that we had issues running some of the tutorials and that the base driver IP for Ethernet and most drivers remain at the Vivado 2019.1.1 version for SKARAB, so it is not fully ported at all levels. It should be pointed out that at this point our DSP team are currently using SKARABs for new development with these new versions, so they may end up sorting all these issues out in the long run, but if you want a fully baselined and tested SKARAB version now then I would stick with the recommended baseline versions. Good luck! Kind regards, Adam On Mon, May 29, 2023 at 9:56 AM June Tantiparimongkol <[email protected]> wrote: > Dear all,Due to the upgrade of 'casperfpga' library from python 2.7 to > 3.8, I have tried to upgrade my software to a newer version. But still got > stuck on problems that I still can't properly install and use it as I have > followed the information on https://casper-tool > > > > > > > > > > > > > > > > > > > > > > > > > > > > <https://za.report.cybergraph.mimecast.com/alert-details/?dep=pOHCzpcjaCkoEXaZbGE57g%3D%3DOmmvIps2hMpzn1vkIqHS2nYgfUhrNg7nhvT2BS7sMOX2CvBQInQMClZS1CplUKzEkdvCacLZXOawILyYUOiTHZhTK342OFEB6wB8inG6ro2oLdVSeJYYJuJ1xC0fvTU5fAAdJ4mv4i93sajb6%2FQbE0N3zvFeeJWiiJAxsWHo3Gy5jv5euGVoApOnv4YlfjnunxL%2Fbs0qCQJG0hVQ%2FmYkJ4h8YF%2B03FhhVQ8cG1JPFi7NVJ8cV1qBsztLhRqPOuRNChx%2B00btsrW%2BE%2BBaLzSvuB3Fz5DeO5TlcG2RR5h%2BdCHLSLi0TBc99kdsc6NbUQHc%2BEz%2FBiasHT2e%2FEUwuNWdjkXvkKyhXYJa6gLDEj0hgrD%2BbuTc2YUcLA9lkD%2FWL%2FULeoqcIUWC0%2F%2FVejAc9Pk4Jd8HOREpWgoRFm5HA%2BJv%2FHUAzQkrvHrFYUFtQUbI8WFzWP%2FePbtkFJ6MidxHKm3TmhT%2BviH5YkGAejLrN09DhjsBHaFEfe0XbW%2BTm4zP0wFR32Gel%2BulpVpBcR6Olmn99Q%3D%3D> > Dear all, > > Due to the upgrade of '*casperfpga*' library from python 2.7 to 3.8, I > have tried to upgrade my software to a newer version. But still got stuck > on problems that I still can't properly install and use it as I have > followed the information on > https://casper-toolflow.readthedocs.io/en/latest/src/How-to-install-casperfpga.html > <https://casper-toolflow.readthedocs.io/en/latest/src/How-to-install-casperfpga.html>. > I have pulled '*casperfpga*' repository from > https://github.com/casper-astro/casperfpga.git > <https://github.com/casper-astro/casperfpga.git> on > *py38* branch > > During installation, I have found error, "*katcp==0.9.1 required tornado > <5 >=4.3*". So, I have re-install it by define "*tornado<5*" in > requirements.txt and do pip install. Later, it shows another error, > "*circus==0.18.0 > required tornado>5*", which circus is defined in *setup.py * > > Later, when finish the installation procedure, I am able to import ' > *casperfpga*' library, connect with my SKARAB hardware port. But I am > unable to upload and program firmware file (.fpg) to hardware with error > occured as UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in > position 33033: invalid start byte as detailed belows > > Python 3.8.10 (default, Mar 13 2023, 10:26:41) > Type 'copyright', 'credits' or 'license' for more information > IPython 8.12.2 -- An enhanced Interactive Python. Type '?' for help. > > > > > > > *In [1]: import casperfpgaIn [2]: fpga = > casperfpga.CasperFpga('192.168.91.121')In [3]: fpga.is_connected()Out[3]: > True* > > *In [4]: > fpga.upload_to_ram_and_program('Data_streaming_2ps_40gbe_2022-10-26_2143.fpg')* > 2023-05-29 14:26:02.83 ERROR 192.168.91.121 transport_skarab.py:715 - > Failed to program. > --------------------------------------------------------------------------- > UnicodeDecodeError Traceback (most recent call last) > Cell In[4], line 1 > ----> 1 > fpga.upload_to_ram_and_program('Data_streaming_2ps_40gbe_2022-10-26_2143.fpg') > > File > ~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/casperfpga.py:348, > in CasperFpga.upload_to_ram_and_program(self, filename, wait_complete, > initialise_objects, **kwargs) > 345 else: > 346 filename = self.bitstream > --> 348 rv = self.transport.upload_to_ram_and_program( > 349 filename=filename, wait_complete=wait_complete, **kwargs) > 351 if not wait_complete: > 352 return True > > File > ~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/transport_skarab.py:712, > in SkarabTransport.upload_to_ram_and_program(self, filename, port, timeout, > wait_complete, skip_verification, **kwargs) > 709 chunk_size = 1988 > 711 try: > --> 712 upload_time = self.upload_to_ram(filename, not > skip_verification, chunk_size) > 714 except: > 715 self.logger.error('Failed to program.') > > File > ~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/transport_skarab.py:641, > in SkarabTransport.upload_to_ram(self, filename, verify, chunk_size) > 638 raise ValueError(errmsg) > 639 # else: Continue! > --> 641 upload_time = skfops.upload_to_ram_progska(filename, > [self.parent], chunk_size) > 642 self.logger.debug('Uploaded bitstream in %.1f seconds.' % > upload_time) > 643 return upload_time > > File > ~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/skarab_fileops.py:252, > in upload_to_ram_progska(filename, fpga_list, chunk_size) > 250 processor = choose_processor(filename) > 251 processor = processor(filename, binname) > --> 252 binname = processor.make_bin()[1] > 253 fpga_hosts = [fpga.host for fpga in fpga_list] > 255 # clear sdram of all fpgas before uploading > > File > ~/work/skarab/casperfpga-py3/cfpga_venv/lib/python3.8/site-packages/casperfpga/skarab_fileops.py:75, > in FpgProcessor.make_bin(self) > 71 """ > 72 :return: the name of a produced .bin file > 73 """ > 74 fpg_file = open(self.image_file, 'r') > ---> 75 fpg_contents = fpg_file.read() > 76 fpg_file.close() > 78 # scan for the end of the fpg header > > File /usr/lib/python3.8/codecs.py:322, in > BufferedIncrementalDecoder.decode(self, input, final) > 319 def decode(self, input, final=False): > 320 # decode input (taking the buffer into account) > 321 data = self.buffer + input > --> 322 (result, consumed) = self._buffer_decode(data, self.errors, > final) > 323 # keep undecoded input until the next call > 324 self.buffer = data[consumed:] > > *UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position > 33033: invalid start byte* > > From my opinion, I think the error might be occurred by the python library > installation, e.g. tornado version conflict with katcp and circus in > different direction. But I have already tried on install "tornado<5" and > "circus==0.16.0" (which the error of tornado version would not shown.) But > still got *'utf-8' codec can't decode byte 0x8b in position 33033: > invalid start byte* error with the casperfpga version shown as > "casperfpga-3.4..... .*dirty*." > > As an unexpert, I really don't know what is the root cause for this > problem. So, anyone please do suggest me about it. > > Thanks and regards, > June > > > ------------------------------------------------------------------------------------------------------------------------------ > National Astronomical Research Institute of Thailand (NARIT) > 260, Moo 4, Donkaew, Maerim, Chiang mai, 50180 > > > -- > You received this message because you are subscribed to the Google Groups " > [email protected]" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CABKTCqET74QWjnNhKMAHMC%2BLq6-h_vgUaisw0i5ngro5Pb%2BzpA%40mail.gmail.com > <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CABKTCqET74QWjnNhKMAHMC%2BLq6-h_vgUaisw0i5ngro5Pb%2BzpA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > Disclaimer The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful. This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast, a leader in email security and cyber resilience. Mimecast integrates email defenses with brand protection, security awareness training, web security, compliance and other essential capabilities. Mimecast helps protect large and small organizations from malicious activity, human error and technology failure; and to lead the movement toward building a more resilient world. To find out more, visit our website. -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CADTJ%3DnEH3SiXerVAZppTAzLX8WKiR_DHKV0qohaf-6mOrzjrWw%40mail.gmail.com.

