opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

Issue with vivado in batch mode while connecting to hw_server

Open rpenugo opened this issue 7 years ago • 9 comments

Creating a tracker for the issue @tjshep is running into with using Vivado command line version for Prgramming bitfile.

Following doesn't work reliably fusesoc --cores-root . pgm lowrisc:systems:top_earlgrey_nexysvideo:0.1

rpenugo avatar Oct 04 '19 23:10 rpenugo

Following changes make it work

  1. add open_project to *pgm.tcl
  2. disconnect_hw_server and connect_hw_server again.

Changes(in BOLD letters) below Change#1 : ~/.local/lib/python3.6/site-packages/edalize/vivado.py self.render_template('vivado-program.tcl.j2', self.name+"_pgm.tcl", {'part' : self.tool_options.get('part', ""), 'project_name' : self.name+'.xpr', 'bitstream_name' : self.name+'.bit'})

Change#2: ~/.local/lib/python3.6/site-packages/edalize/templates/vivado/vivado-program.tcl.j2 set bit {{ bitstream_name }} set part {{ part }} set prj {{ project_name }}

open_project ${prj} open_hw connect_hw_server disconnect_hw_server connect_hw_server

rpenugo avatar Oct 04 '19 23:10 rpenugo

  • @moidx

rpenugo avatar Oct 05 '19 00:10 rpenugo

Two comments here:

  • Please make sure you're using the latest version of edalize by running pip3 install -U --user python-requirements.txt (run this from our repository toplevel). @towoe recently included code to make this process more robust.
  • If you have found a way to make the flashing more reliable, please propose it as a pull request upstream. The upstream file is at https://github.com/olofk/edalize/blob/master/edalize/templates/vivado/vivado-program.tcl.j2

imphil avatar Oct 06 '19 11:10 imphil

The problem I tried to solve was that the programming failed because the Nexys board has two targets and if the first was not the correct one, it instantly exited. This resulted in a behavior in which the programming was mostly successful. Could you post the error message of a failed attempt?

towoe avatar Oct 07 '19 06:10 towoe

The latest edalize version fixes the issue.

  • pip3 install -U --user -r python-requirements.txt

Hi Tobias , the prior error was as well related to two targets and first one being not the one JTAG is connected, so it errored out.

On Sun, Oct 6, 2019 at 11:01 PM Tobias Woelfel [email protected] wrote:

The problem I tried to solve was that the programming failed because the Nexys board has two targets and if the first was not the correct one, it instantly exited. This resulted in a behavior in which the programming was mostly successful. Could you post the error message of a failed attempt?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/lowRISC/opentitan/issues/354?email_source=notifications&email_token=ALULWCIELVTISQWUUMEJXK3QNLGDNA5CNFSM4I5VLT5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPDQ4I#issuecomment-538851441, or mute the thread https://github.com/notifications/unsubscribe-auth/ALULWCP5L3EYX774XK3YV6DQNLGDNANCNFSM4I5VLT5A .

rpenugo avatar Oct 09 '19 23:10 rpenugo

I think we are ok with this setup and can close this issue if there are no more concerns

rpenugo avatar Oct 09 '19 23:10 rpenugo

I ran into this issue again when preparing CI, and we need a solid solution there. Seems like Vivado 2018.3 needs two tries to actually connect to a target if it's freshly connected to a PC. I'm working on a more robust flashing script right now which retries this process.

imphil avatar Oct 25 '19 14:10 imphil

(Note: I get the same behavior in the GUI and in a batch script, so it's not really related to our scripting, but more a workaround for a Vivado bug.)

imphil avatar Oct 25 '19 14:10 imphil

A PR with an updated script is submitted at https://github.com/olofk/edalize/pull/61; I also updated the ot branch which we use in our python-requirements.txt. All people (and CI) running pip3 install -U -r python-requirements.txt will now a version of edalize containing this change.

imphil avatar Oct 27 '19 18:10 imphil