FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-03-2006, 02:01 PM
Wojciech Zabolotny
Guest
 
Posts: n/a
Default Buggy behaviour in Modelsim, when reading from pipe?

Hi All,

I had to integrate a VHDL testbench of complex system with the Python
software (which is used to control the real hardware).
Additionally it had to be done in portable way.
Therefore I've decided to use pipes to establish communication between the
Python software and VHDL simulator.

Everything works perfectly with GHDL (I can share my solution if anyone
is interested in it) but when I tried to use it with Modelsim in our lab,
I faced serious problem.
It seems, that there is something wrong with reading from the pipe in the
Modelsim. The Modelsim reads only a few messages form the pipe, and then
it claims, that the end of file has been reached, even though the sending
end of the pipe is still active.
Maybe Modelsim opens the pipe in non-blocking mode? Or maybe there is
something wrong with the endfile function?

Unfortunately Modelsim is not opensource, so probably it will be difficult
to fix the problem, but maybe someone has found any workaround?
Maybe the problem may be fixed by wrapping any libc routines with dynamic
library preloaded with LD_PRELOAD?
Maybe the problem maybe fixed somehow in the textio package?
--
TIA & Regards,
Wojtek Zabolotny

Reply With Quote
  #2 (permalink)  
Old 12-03-2006, 02:50 PM
Jon Beniston
Guest
 
Posts: n/a
Default Re: Buggy behaviour in Modelsim, when reading from pipe?


> Unfortunately Modelsim is not opensource, so probably it will be difficult
> to fix the problem, but maybe someone has found any workaround?
> Maybe the problem may be fixed by wrapping any libc routines with dynamic
> library preloaded with LD_PRELOAD?
> Maybe the problem maybe fixed somehow in the textio package?


Send them a bug report and test case.

Cheers,
Jon

Reply With Quote
  #3 (permalink)  
Old 12-04-2006, 12:33 AM
Wojciech Zabolotny
Guest
 
Posts: n/a
Default Re: Buggy behaviour in Modelsim, when reading from pipe?

I've finally managed to solve the problem by opening the pipe
in the foreign subprogram, and by setting the mode to blocking
with the fcntl function.

[...]
rdpipe=open("./rdpipe",O_WRONLY);
flags = fcntl( wrpipe, F_GETFL );
flags &= ~O_NONBLOCK;
fcntl( wrpipe, F_SETFL, flags );
[...]

However it required to use the FLI interface, which impaired portability
of the design.
--
BR, Wojtek

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Physical interface for PCI express(PIPE) electrical information [email protected] FPGA 3 10-29-2005 06:46 PM
ngdbuild, edif2ngd Pipe ended error Ken FPGA 0 12-02-2003 11:49 AM
NIOS simulation with modelsim -> strange behaviour Mancini Stephane FPGA 0 10-22-2003 12:56 PM


All times are GMT +1. The time now is 03:17 AM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved