Hi Nitish, I think this is related to https://github.com/casper-astro/mlib_devel/commit/6e02a6ff98a9394c6b0acac570547d7841630dc9
Could you check if you have a lingering "platform.pyc" file in mlib_devel/jasper_library and if so, delete it. Can you also check whether this pyc file is in your python installation directory and if so delete that too. I think the problem is that pyc files are not tracked by the repo, so if you have a version of mlib_devel from before the above commit you have installed from, there will be a platform.pyc file knocking around which will get erroneously installed after an upgrade. Let me know if that doesn't fix things. Cheers Jack On Wed, 20 Nov 2019 at 08:24, Jack Hickish <[email protected]> wrote: > Thanks for the detailed report Nitish. I have a vague recollection that > this is something simple which might have to do with a previous install of > the title not being overwritten properly. > > I'll dig through my notes and get back to you asap > > Jack > > On Wed, 20 Nov 2019, 12:02 am Nitish Ragoomundun, < > [email protected]> wrote: > >> >> Thank you very much for your replies. I misunderstood the importance of >> the virtual environment. So I set it up like described in >> https://casper-toolflow.readthedocs.io/en/latest/src/Installing-the-Toolflow.html >> and >> https://casper-toolflow.readthedocs.io/en/latest/src/Configuring-the-Toolflow.html. >> Yes, I am using the latest version of mlib_devel. Found out that we >> absolutely needed the LD_PRELOAD variable set or else jasper made an error >> looking for symbols for XML... >> >> Yes, I think changing the shabang line to point to python3 might cause >> other issues. There might be other scripts down the pipeline with the same >> call to "python". >> >> Anyway, got the virtual env running and I thought we were good to go but >> got another error: >> >> XSG generation complete. >> ************************************ >> * Front End compile complete * >> ************************************ >> To complete your compile, run the following command in a terminal. >> Remember to source your startsg.local environment first! >> /home/aragorn/Documents/SNAP/casper_venv/bin/python >> /home/aragorn/Documents/CASPER/mlib_devel/jasper_library/exec_flow.py -m >> /home/aragorn/Documents/SNAP/Spectrum_Analyser/spectrum_480mhz_2048pts_3c.slx >> --middleware --backend --software >> **************************************** >> * Frontend complete! * >> * Running Backend generation * >> **************************************** >> Starting compile >> Starting Toolflow! >> Frontend is simulink >> Setting compile directory: >> /home/aragorn/Documents/SNAP/Spectrum_Analyser/spectrum_480mhz_2048pts_3c >> /home/aragorn/Documents/CASPER/mlib_devel/jasper_library/toolflow.py:236: >> YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as >> the default Loader is unsafe. Please read https://msg.pyyaml.org/load >> for full details. >> yaml_dict = yaml.load(fh) >> >> /home/aragorn/Documents/CASPER/mlib_devel/jasper_library/platforms/snap.yaml >> /home/aragorn/Documents/CASPER/mlib_devel/jasper_library/casper_platform.py:24: >> YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as >> the default Loader is unsafe. Please read https://msg.pyyaml.org/load >> for full details. >> self.conf = yaml.load(fh.read()) >> {'manufacturer': 'Xilinx', 'backend_target': 'vivado', 'sources': [], >> 'name': 'snap', 'invert_sfp_disable': True, 'pins': {'sync_out': {'iostd': >> 'LVCMOS25', 'loc': 'H9'}, 'lmx2581_muxout': {'iostd': 'LVCMOS33', 'loc': >> 'J19'}, 'mgt_tx_p': {'loc': ['P2', 'K2']}, 'usb_tx': {'iostd': 'LVCMOS25', >> 'loc': 'J8'}, 'sync_in_p': {'iostd': 'LVDS_25', 'loc': 'AD25'}, 'zdok0': >> {'iostd': 'LVCMOS25', 'loc': ['AA23', 'AB24', 'Y25', 'Y26', 'U24', 'U25', >> 'U19', 'U20', 'T24', 'T25', 'M21', 'M22', 'M24', 'L24', 'L22', 'K22', >> 'J24', 'J25', 'G25', 'G26', 'Y22', 'AA22', 'Y23', 'AA24', 'V23', 'V24', >> 'R22', 'R23', 'R21', 'P21', 'P23', 'N23', 'K25', 'K26', 'K23', 'J23', >> 'H21', 'G21', 'G22', 'F23', 'AE23', 'AF23', 'AC23', 'AC24', 'W23', 'W24', >> 'T22', 'T23', 'R18', 'P18', 'N18', 'M19', 'N19', 'M20', 'J21', 'H22', >> 'G24', 'F24', 'D23', 'D24', 'AE22', 'AF22', 'AB26', 'AC26', 'V21', 'W21', >> 'U17', 'T17', 'R16', 'R17', 'P19', 'P20', 'P16', 'N17', 'J26', 'H26', >> 'E25', 'D25', 'F22', 'E23']}, 'adc_sdata': {'iostd': 'LVCMOS18', 'loc': >> ['AF2', 'AF9', 'W14']}, 'lmx2581_be': {'iostd': 'LVCMOS33', 'loc': 'F15'}, >> 'adc_sclk': {'iostd': 'LVCMOS33', 'loc': ['M17', 'L18', 'K16']}, >> 'clk_sel_a': {'iostd': 'LVCMOS33', 'loc': ['A18']}, 'i2c': {'iostd': 'I2C', >> 'loc': ['', '', '', '', '', '', 'E18', 'B16', '', 'C16', '', '', '', '', >> '', '', '', '', 'J20', '', 'K20', '', 'E17', 'G19', '', '', '', '', 'C17', >> '', 'C18', 'C19', 'B19', '', 'A17', 'B17', 'D20', 'H18', '', 'H17']}, >> 'sync_in_n': {'iostd': 'LVDS_25', 'loc': 'AE25'}, 'adc_lclkp': {'iostd': >> 'LVDS', 'loc': ['AA3']}, 'spi_flash_csn': {'iostd': 'LVCMOS25', 'loc': >> 'C23'}, 'gpio': {'iostd': 'LVCMOS25', 'loc': ['B21', 'C21', 'B20', 'A20', >> 'H24', 'H23', 'B26', 'R25', 'L17', 'K18']}, 'zdok0_p': {'iostd': 'LVDS_25', >> 'loc': ['AA23', 'Y25', 'U24', 'U19', 'T24', 'M21', 'M24', 'L22', 'J24', >> 'G25', 'Y22', 'Y23', 'V23', 'R22', 'R21', 'P23', 'K25', 'K23', 'H21', >> 'G22', 'AE23', 'AC23', 'W23', 'T22', 'R18', 'N18', 'N19', 'J21', 'G24', >> 'D23', 'AE22', 'AB26', 'V21', 'U17', 'R16', 'P19', 'P16', 'J26', 'E25', >> 'F22']}, 'led': {'iostd': 'LVCMOS25', 'loc': ['C13', 'C14', 'D13', 'D14', >> 'E12', 'E13']}, 'adc2_out': {'iostd': 'LVDS', 'loc': ['AF14', 'AF15', >> 'AD15', 'AE15', 'AE18', 'AF18', 'AF19', 'AF20', 'AA14', 'AA15', 'AC14', >> 'AD14', 'AB19', 'AB20', 'AA19', 'AA20']}, 'lmx2581_le': {'iostd': >> 'LVCMOS33', 'loc': 'J16'}, 'zdok0_n': {'iostd': 'LVDS_25', 'loc': ['AB24', >> 'Y26', 'U25', 'U20', 'T25', 'M22', 'L24', 'K22', 'J25', 'G26', 'AA22', >> 'AA24', 'V24', 'R23', 'P21', 'N23', 'K26', 'J23', 'G21', 'F23', 'AF23', >> 'AC24', 'W24', 'T23', 'P18', 'M19', 'M20', 'H22', 'F24', 'D24', 'AF22', >> 'AC26', 'W21', 'T17', 'R17', 'P20', 'N17', 'H26', 'D25', 'E23']}, >> 'mgt_rx_n': {'loc': ['R3', 'L3']}, 'eth_clk_p': {'loc': ['K6']}, 'mosi': >> {'iostd': 'LVCMOS33', 'loc': 'J20'}, 'lmx2581_data': {'iostd': 'LVCMOS33', >> 'loc': 'J15'}, 'rpi_header': {'iostd': 'LVCMOS33', 'loc': ['', '', '', '', >> '', '', 'E18', 'B16', '', 'C16', '', '', '', '', '', '', '', '', 'J20', '', >> 'K20', '', 'E17', 'G19', '', '', '', '', 'C17', '', 'C18', 'C19', 'B19', >> '', 'A17', 'B17', 'D20', 'H18', '', 'H17']}, 'mgt_rx_p': {'loc': ['R4', >> 'L4']}, 'lmx2581_ce': {'iostd': 'LVCMOS33', 'loc': 'G15'}, 'clk_sel_b': >> {'iostd': 'LVCMOS33', 'loc': ['A19']}, 'usb_rts': {'iostd': 'LVCMOS25', >> 'loc': 'J13'}, 'sfp_disable': {'iostd': 'LVCMOS25', 'loc': ['U21', 'N16']}, >> 'xadc_n': {'loc': 'P11'}, 'cs_n': {'iostd': 'LVCMOS33', 'loc': 'G19'}, >> 'lmx2581_clk': {'iostd': 'LVCMOS33', 'loc': 'H16'}, 'adc0_out': {'iostd': >> 'LVDS', 'loc': ['V2', 'V1', 'U2', 'U1', 'W6', 'W5', 'U7', 'V6', 'V3', 'W3', >> 'Y3', 'Y2', 'AD6', 'AD5', 'AD4', 'AD3']}, 'sys_clk_p': {'iostd': 'LVDS_25', >> 'loc': 'E10'}, 'eth_clk_125_p': {'loc': 'H6'}, 'adc_pd': {'iostd': >> 'LVCMOS18', 'loc': ['AE3', 'AE8', 'W15']}, 'sclk': {'iostd': 'LVCMOS33', >> 'loc': 'E17'}, 'eth_clk_n': {'loc': ['K5']}, 'miso': {'iostd': 'LVCMOS33', >> 'loc': 'K20'}, 'usb_rx': {'iostd': 'LVCMOS25', 'loc': 'H13'}, 'adc_csn': >> {'iostd': 'LVCMOS18', 'loc': ['AF3', 'AF10', 'V14']}, 'adc1_out': {'iostd': >> 'LVDS', 'loc': ['V8', 'V7', 'W10', 'W9', 'Y8', 'Y7', 'Y11', 'Y10', 'AB12', >> 'AC12', 'AA13', 'AA12', 'AA8', 'AA7', 'AC8', 'AD8']}, 'adc_rst_n': >> {'iostd': 'LVCMOS18', 'loc': ['AE5', 'AF13', 'V19']}, 'xadc_p': {'loc': >> 'N12'}, 'mgt_tx_n': {'loc': ['P1', 'K1']}, 'sys_clk_n': {'iostd': >> 'LVDS_25', 'loc': 'D10'}, 'eth_clk_125_n': {'loc': 'H5'}, 'adc_lclkn': >> {'iostd': 'LVDS', 'loc': ['AA2']}, 'spi_flash_data': {'iostd': 'LVCMOS25', >> 'loc': ['B24', 'A25', 'B22', 'A22']}, 'usb_cts': {'iostd': 'LVCMOS25', >> 'loc': 'F10'}}, 'provides': ['sfp0', 'sfp1', 'zdok0', 'sys_clk', >> 'sys_clk90', 'sys_clk180', 'sys_clk270', 'HAD1511_0', 'HAD1511_1', >> 'HAD1511_2', 'lmx2581'], 'fpga': 'xc7k160tffg676-2', 'constraints': []} >> bram >> wb_bram >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_bram'] >> gpio >> gpio_simulink2ext >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/gpio_simulink2ext'] >> bram >> wb_bram >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_bram'] >> bram >> wb_bram >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_bram'] >> bram >> wb_bram >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_bram'] >> xsg >> sw_reg >> wb_register_ppc2simulink >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_register_ppc2simulink'] >> sw_reg >> wb_register_ppc2simulink >> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_register_ppc2simulink'] >> snap_adc >> Traceback (most recent call last): >> File >> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/exec_flow.py", >> line 197, in <module> >> tf.gen_periph_objs() >> File >> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/toolflow.py", >> line 363, in gen_periph_objs >> self.peripherals[pk], self.plat)) >> File >> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/yellow_blocks/yellow_block.py", >> line 56, in make_block >> clsfile = __import__(__package__+'.'+blk['tag'][4:]) >> File >> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/yellow_blocks/snap_adc.py", >> line 5, in <module> >> import math, numpy as np >> File >> "/home/aragorn/Documents/SNAP/casper_venv/lib/python3.5/site-packages/numpy/__init__.py", >> line 142, in <module> >> from . import core >> File >> "/home/aragorn/Documents/SNAP/casper_venv/lib/python3.5/site-packages/numpy/core/__init__.py", >> line 100, in <module> >> from . import _internal >> File >> "/home/aragorn/Documents/SNAP/casper_venv/lib/python3.5/site-packages/numpy/core/_internal.py", >> line 11, in <module> >> import platform >> ImportError: bad magic number in 'platform': b'\x03\xf3\r\n' >> Error using jasper (line 23) >> Backend build failed! Check log files for more information >> >> >> Looks like a Python error again. The complete output messages in the >> Matlab window are in the attached file Matlab.log. >> >> Best regards, >> Nitish >> >> >> On Wed, Nov 20, 2019 at 12:58 AM Jack Hickish <[email protected]> >> wrote: >> >>> Re virtual environments -- your simplest work around is probably to use >>> the `CASPER_PYTHON_VENV_ON_START` variable described at >>> https://casper-toolflow.readthedocs.io/en/latest/src/Configuring-the-Toolflow.html >>> >>> Alternatively, if "just" changing the shebang line to point to "python3" >>> works, that seems like a reasonable thing to do. (Others may disagree). >>> >>> Cheers >>> Jack >>> >>> On Tue, 19 Nov 2019 at 10:08, Wesley New <[email protected]> wrote: >>> >>>> Hi Nitish >>>> >>>> This is a python 2/3 issue. The toolflow has been upgraded to use >>>> python 3. Most people are running it in a virtual environment and install >>>> the requirements.txt in the root of mlib_devel. Assuming you are using the >>>> latest version of mlib_devel in casper-astro. >>>> >>>> Hope this helps. >>>> >>>> Regards >>>> >>>> Wesley >>>> >>>> On Tue, 19 Nov 2019, 7:03 PM Nitish Ragoomundun, < >>>> [email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> I was using Matlab R2017b and Vivado 2016.4 until recently. Most >>>>> things were working until I had issues with the complex fft block and >>>>> decided to get the latest mlib_devel to program our SNAP board. I followed >>>>> https://casper-toolflow.readthedocs.io/en/latest/src/Installing-the-Toolflow.html >>>>> and installed Matlab R2018a and Vivado 2019.1.1 on Ubuntu 16.04. I tested >>>>> using a design which I know was working before. I noticed that new Matlab >>>>> could not save the Simulink design if I opened the old one itself. So, I >>>>> manually made a replica of the .slx design with the same blocks and same >>>>> parameters. Ctrl+D was successfull. Compilation should have worked but got >>>>> the following error at some stage after running jasper: >>>>> >>>>> ..... >>>>> ('wb_register_ppc2simulink_sync', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wb_register_ppc2simulink_sync']) >>>>> snap >>>>> ('infrastructure', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/infrastructure']) >>>>> ('wbs_arbiter', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/wbs_arbiter']) >>>>> sys_block >>>>> <yellow_blocks.sys_block.sys_block object at 0x7f7b6cbe3790> doesn't >>>>> have an attribute 'fullpath' >>>>> ('sys_block', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/sys_block']) >>>>> spi_wb_bridge >>>>> <yellow_blocks.spi_wb_bridge.spi_wb_bridge object at 0x7f7b6cbe3990> >>>>> doesn't have an attribute 'fullpath' >>>>> ('spi_wb_bridge', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/spi_wb_bridge']) >>>>> xadc >>>>> <yellow_blocks.xadc.xadc object at 0x7f7b6cbe3a50> doesn't have an >>>>> attribute 'fullpath' >>>>> ('xadc/xadc.v', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/xadc/xadc.v']) >>>>> ('xadc/xadc_wiz_0.xci', >>>>> ['/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/hdl_sources/xadc/xadc_wiz_0.xci']) >>>>> instantiating user peripherals >>>>> top: >>>>> /home/aragorn/Documents/SNAP/new_Spectrum_Analyser/spectrum_480mhz_2048pts_3c/top.v >>>>> instantiating user_ip >>>>> regenerating top >>>>> Dumping pickle of top-level Verilog module >>>>> Extracting constraints from peripherals >>>>> Generating physical constraints >>>>> Traceback (most recent call last): >>>>> File >>>>> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/cit2csl.py", >>>>> line >>>>> 107, in <module> >>>>> sys.stdout.buffer.write(csl) >>>>> AttributeError: 'file' object has no attribute 'buffer' >>>>> Failed to generate binary file >>>>> /home/aragorn/Documents/SNAP/new_Spectrum_Analyser/spectrum_480mhz_2048pts_3c/core_info.jam.tab.bin, >>>>> error code 256. >>>>> Traceback (most recent call last): >>>>> File >>>>> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/exec_flow.py", >>>>> line 202, in <module> >>>>> tf.write_core_jam_info() >>>>> File >>>>> "/home/aragorn/Documents/CASPER/mlib_devel/jasper_library/toolflow.py", >>>>> line 525, in write_core_jam_info >>>>> raise Exception(errmsg) >>>>> Exception: Failed to generate binary file >>>>> /home/aragorn/Documents/SNAP/new_Spectrum_Analyser/spectrum_480mhz_2048pts_3c/core_info.jam.tab.bin, >>>>> error code 256. >>>>> Error using jasper (line 23) >>>>> Backend build failed! Check log files for more information >>>>> >>>>> >>>>> If you wish to see the beginning of the messages, please see attached >>>>> log. The messages in the Matlab window following the jasper command are in >>>>> Matlab.log. >>>>> Since the error is a "Traceback" from Python, I am guessing something. >>>>> I did download the new mlib_devel (master branch) and installed the >>>>> requirements using pip3. I saw in >>>>> https://casper-toolflow.readthedocs.io/en/latest/src/Installing-the-Toolflow.html >>>>> that for SNAP, we need Python3 and I checked dependencies. One thing I >>>>> noticed by looking into the scripts inside mlib_devel/jasper_library is >>>>> the >>>>> line "#! /usr/bin/env python". On Ubuntu 16.04 the default Python is >>>>> version 2.7 and "python" is actually a symlink at /usr/bin/python which >>>>> links to /usr/bin/python2.7. So, for example, if exec_flow.py is run, I am >>>>> pretty sure it is running with python2.7 and not python3. >>>>> >>>>> So, what do you think? >>>>> Can you please advise? >>>>> >>>>> Thanks. >>>>> Regards, >>>>> Nitish >>>>> >>>>> >>>>> >>>>> -- >>>>> 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/CAC6X4cP%3DkUfwym5YKZKxnZvjE%2BwxQNxSo_XcoAx95%2Ba1x5OF6A%40mail.gmail.com >>>>> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAC6X4cP%3DkUfwym5YKZKxnZvjE%2BwxQNxSo_XcoAx95%2Ba1x5OF6A%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> -- >>>> 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/CAE2vkmWJUjyS7PYbF0v%2BQ6zaxwyk7Pj8PjX_9-R%3Dk8fV9bypHg%40mail.gmail.com >>>> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAE2vkmWJUjyS7PYbF0v%2BQ6zaxwyk7Pj8PjX_9-R%3Dk8fV9bypHg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >>> 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/CAG1GKSm8rZ4uhLYDMQ1W4h9hyaUp0hGj-nH%2BpuB1J2YLMvUpnQ%40mail.gmail.com >>> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAG1GKSm8rZ4uhLYDMQ1W4h9hyaUp0hGj-nH%2BpuB1J2YLMvUpnQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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/CAC6X4cMyXqj3F0%3DPik6T%2BZmc10AbBiM%2BpjALe-hBr01%2BSqA78Q%40mail.gmail.com >> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAC6X4cMyXqj3F0%3DPik6T%2BZmc10AbBiM%2BpjALe-hBr01%2BSqA78Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/CAG1GKSnchtpjBg5DPAUkEcGb_mEyuhBj8u1TQtmjL2QW-TPstg%40mail.gmail.com.

