• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. irun passing real-time data to a running external appli...

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 67
  • Views 14424
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

irun passing real-time data to a running external application

VaclavPeroutka
VaclavPeroutka over 6 years ago

Hello,

I am thinking about to post-process and show the data from the irun simulator in external application in the real time. For example I generate the screen data sending HDMI and Java/C++/TK/Python app shows the generated screen.

Is there any means how to do that ?

  • Cancel
Parents
  • VaclavPeroutka
    VaclavPeroutka over 6 years ago

    Hello, I finally went to C with Xlib. My testbench looks like this:

    module tb ();

       import "DPI" function void init_screen();
       import "DPI" function void deinit_screen();
       import "DPI" function void show_boxes();
      
       initial begin
          #100 init_screen();
          #100 show_boxes();
          #100 show_boxes();
          #100 show_boxes();
          #1 $display( "we should see boxes");

          #10000 deinit_screen();

       end
    endmodule // tb

    and DPI function for show_boxes() :

    extern void show_boxes( void)
    {
      XFlushGC( disp, gc);
      while (1) {
        XNextEvent(disp, &e);
          /* draw or redraw the window */
           if(e.type==Expose) {
      XSetForeground(disp, gc, yellow.pixel);
      XFillRectangle(disp, w, gc, 20, 20, 30, 30);
      XSetForeground(disp, gc, red.pixel);
      XFillRectangle(disp, w, gc, 50, 20, 30, 30);
      printf("boxes on screen\n");
      break;
           }
        // Handle Windows Close Event
        if(e.type==ClientMessage)
          break;
      }
    }

    But when I call this func once no boxes are shown. If I run it twice or three times the boxes are shown but func stays in while() loop. It looks that XEvents are processed strangely. Any idea how to fix the code ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • VaclavPeroutka
    VaclavPeroutka over 6 years ago

    Hello, I finally went to C with Xlib. My testbench looks like this:

    module tb ();

       import "DPI" function void init_screen();
       import "DPI" function void deinit_screen();
       import "DPI" function void show_boxes();
      
       initial begin
          #100 init_screen();
          #100 show_boxes();
          #100 show_boxes();
          #100 show_boxes();
          #1 $display( "we should see boxes");

          #10000 deinit_screen();

       end
    endmodule // tb

    and DPI function for show_boxes() :

    extern void show_boxes( void)
    {
      XFlushGC( disp, gc);
      while (1) {
        XNextEvent(disp, &e);
          /* draw or redraw the window */
           if(e.type==Expose) {
      XSetForeground(disp, gc, yellow.pixel);
      XFillRectangle(disp, w, gc, 20, 20, 30, 30);
      XSetForeground(disp, gc, red.pixel);
      XFillRectangle(disp, w, gc, 50, 20, 30, 30);
      printf("boxes on screen\n");
      break;
           }
        // Handle Windows Close Event
        if(e.type==ClientMessage)
          break;
      }
    }

    But when I call this func once no boxes are shown. If I run it twice or three times the boxes are shown but func stays in while() loop. It looks that XEvents are processed strangely. Any idea how to fix the code ?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information