SchaffHub / RISC-Verdi

Synopsys Verdi applet that presents a view of the source code running on a RISC-V processor with a simulation waveform.
MIT License
27 stars 3 forks source link

'AddEventCallback demo myFunc wvCursorTimeChange' doesn't work. #1

Open stone20276 opened 3 years ago

stone20276 commented 3 years ago

'AddEventCallback demo myFunc wvCursorTimeChange' doesn't work. I have got response from verdi with cmd 'wvGetCursor' and cmd 'wvGetActiveFileName' But no response from verdi with cmd 'AddEventCallback demo myFunc wvCursorTimeChange' Is there anything I can do to make it work? thank you! environment: vcs version 2018.09-SP2-1, and open verdi version 2019.06 enter cmd as followed:

nWave +ver 2019.06 -tkName abc xxx.fsdb python3 demo.py demo.py code as followed: demo

SchaffHub commented 3 years ago

Hi, I tried this exact code and I did get a response from AddEventCallback. I'm trying to think of reasons which this may not have worked for you.

My first thought is that this is indeed a callback so this requires you to create the event in your nWave window. For this callback, you can simply added a signal to your waveform. A clock signal for example will work nicely. Then click in the nWave window so that the vertical cursor that marks time appears. Then move it around to a few different time locations on the clock waveform. This should produce callbacks to demo.py that trigger the output.

If that doesn't work then I'd be inclined to blame the window manager. I'm using a pretty basic gnome/X11 setup running over FastX. In the past I've used NoMachine and Xceed instead of FastX. On those other systems I occasionally found I needed to restart them (full logout and restart) to get Tk based communication to work. That was on the order of a couple times a year - very rare. What windowing system are you using?

stone20276 commented 3 years ago

Hi, thank you so much for responding my post! I already chose a clock signal and moved the cursor around to several different time locations in the waveform as you mentioned. My environment is from the office, where I have to open nWave by using computer farm. I write a script to execute both nWave and demo.py on the same server, but the callbacks still doesn't work. My environment uses Nomachine, and open a window with xterm and then use konsole to do my work.

SchaffHub commented 3 years ago

So let me see if I understand your environment. You have a local machine. From the local machine you use NoMachine to access a server. The server displays an xterm onto NoMachine app instance running on you local machine. From that xterm you open the Konsole app which is also displayed on you NoMachine app instance. From Konsole you execute the nWave and 'python3 demo.py' commands. Does that sound correct?

I am wondering if you are using NoMachine in single window mode or floating windows mode? Floating windows mode is rare in my experience but it happens to be the mode I prefer.

I'm struggling to come up with reasons why this isn't working. Can you do a 'ps' to make sure you don't have any other defunct 'demo' instances running that may getting the callback by mistake? Another idea would be to change the 'demo' and 'abc' references to a different name to avoid any confusion with past failed attempts.

One other idea would be to launch a vnc session and execute the commands from there. This isn't a permanent solution but it might be a clean environment that proves that it could work on your server. If that worked then we'd be narrowing down the failure modes to something in the NoMachine environment.

You might also try using 'Verdi' as the launching command instead of 'nWave'. Same arguments should work.

If I can get access to Verdi version 2019.06 I'll try to carve out some time today to try that. I've seen it work with older Verdi versions and newer so that seems an unlikely cause.

stone20276 commented 3 years ago

Hi,

  1. environment on NoMachine The part of how I use the local machine to access a server with NoMachine on konsole app you described is correct. I have tried to execute the commands in two ways: (1) Execute nWave on server and then execute python on my local machine. (2) Write a script (named go123.csh) to execute nWave first, wait for few seconds (wait waveform open done), and then execute 'python3 deno.py' . I run the script on the server, to make sure that nWave and python3 have executed on the same server. These two ways came into the same results: Successful response with 'wvGetActiveFileName' and 'wvGetCursor', and no response with 'AddEventCallback'.

  2. window mode I am using NoMachine with only one session, does it means that I am using single window mode? I am not sure the meaning of floating windows mode and single windows mode.

  3. do a 'ps' the result of doing a 'ps' is in the image as followed: image The go123.csh is the script I with And I tried to change the 'demo' and 'abc' to different name, and got the same results as well.

  4. vnc session The environment provided by my office is restricted to using NoMachine only :(

  5. I tried Verdi instead of nWave, but got the same results.

Many thanks for you response! 💯

SchaffHub commented 3 years ago

Sorry for the late response. I've been away on vacation. I'm running out of ideas. Can you send me a screenshot of the commands launching from the terminal and the terminal output when 'wvGetActiveFileName' and 'wvGetCursor' both work 'AddEventCallback' does not? I'd like to see the whole process and the output (or lack thereof). Thanks!