[Ghdl-discuss] GHDL interfacing with C

2011-09-26 Thread Martin Strubel
Hello list, first, a big THANKS to the GHDL developers. I'm very pleased how well and fast GHDL works compared to commercial tools. I've needed to test some more complex simulation with C routines (instead of generating static test vectors), so I had been playing around with some extensions to my

Re: [Ghdl-discuss] GHDL interfacing with C

2011-09-29 Thread Martin Strubel
Hello, I've been playing around some more and abused our camera remote display server for YUV output from VHDL, see screenshot below. http://tech.section5.ch/news/?p=130 Updated snapshot of the source is here, it needed quite a few fixes on the FIFO code: http://section5.ch/downloads/ghdlex-0.0

[Ghdl-discuss] Illegal data in SLV in simulation

2011-10-04 Thread Martin Strubel
Hi all, I'm porting over simulations to GHDL and run into an obscure problem: I am using the floating_point_v4_0.vhd core from the XilinxCoreLib. The simulation "crashes" from the beginning: ghdl -r fp_tb --stop-time=10us --wave=fp_tb.ghw ../../../src/synopsys/std_logic_arith.vhdl:2024:16:@0ms:(a

Re: [Ghdl-discuss] Illegal data in SLV in simulation

2011-10-05 Thread Martin Strubel
Hi David, thanks for the detailed echo. I wasn't very precise about the illegal values - they're way above 9, it really is garbage, and I haven't figured out where it came from. Unfortunately my gdb can't seem to go further into the GNAT internals the verbose way, I guess this would need some exte

Re: [Ghdl-discuss] Building GHDL on top of a newer GCC

2012-01-10 Thread Martin Strubel
Hi all, > > One of the problems in the code is that there is a serious lack of design > documentation. So, the important concepts and reasoning behind implementation > choices are stored in grey matter rather than publicly accessible binary form. > > While this is understandable for a project mo

Re: [Ghdl-discuss] teaching with GHDL --> VHPI an VHDL-2008

2012-02-05 Thread Martin Strubel
Hi all, > > To implement libraries which allow some sort of system interaction beyond > reading/writing text files one must go beyond the confines of VHDL, and > VHPI is the way to go. That was my main point. I guess noone would object. I'm kind of an impatient software guy, so I've been looking

Re: [Ghdl-discuss] ghdl error: NULL access dereferenced

2012-03-05 Thread Martin Strubel
Hi Simon, I'm in no way familiar with Ada, but the best reverse engineering technique is IMO debugging your simulation with gdb. You just have to know what function you're looking for. Typically, you'd set a break in __ghdl_fatal() and look at the back trace ('bt'). Also, you might need to look at

Re: [Ghdl-discuss] ghdl error: NULL access dereferenced

2012-03-05 Thread Martin Strubel
On 03/05/2012 03:32 PM, Simon Thijs de Feber wrote: > Hello Martin, > > Thanks for your answer ! > How can I set a break ? (gdb) b __ghdl_fatal > Is the bt printed to screeen ? Yes, example: (gdb) bt #0 0x76b0d39d in nanosleep () from /lib/libc.so.6 #1 0x76b42844 in usleep ()

Re: [Ghdl-discuss] Regression testing

2012-03-14 Thread Martin Strubel
Hi Simon, good you found your bug. Sometimes things turn out so simple, nice side effect is that the wrinkles on your forehead will disappear when you hit your own forehead.. > > I need to do regression testing on my design. > For each test in the regression I make a change in the Makefile. > >

[Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-11-10 Thread Martin Strubel
Hi list, I was wondering if someone had already tried to build GHDL with a i686-mingw32 cross compiler on Linux while not using the mcode variant, such that the simulation would elaborate on Linux, but build a Windows executable of the test bench. The background motivation is the following: I've

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-11-11 Thread Martin Strubel
Hi guys, thanks for the quick replies. > > I believe either of these ought to be possible, I suspect the Cygwin or MinGW > option is probably easier (but see Brian Davis' email of this morning, about > Windows patches.) > Haven't checked that yet, but might be the next step.. > Using a cross-

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-11-11 Thread Martin Strubel
Hi Brian, I just took the alternative build approach from inside ghdl (that is mentioned in the README under "Compiling for development"). I had to add some libs to ortho/gcc/Makefile to make it link to the 4.7.2 stuff. When checking your patches, it appears, that you're linking to i386 specifics:

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-11-12 Thread Martin Strubel
Hi Brian, > > Indeed so. I really don't know what I'm doing with Makefiles, and that was a > get-me-going hack which also caused Lluis problems building for nixos. > > There is a patch in progress to correct this and other issues, but meantime > you > could use the patch I posted November 6 to

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-11-12 Thread Martin Strubel
Just a short one, I forgot to mention, that it's obviously division expressions in the vhdl code (the (exp) below) that trigger the segfault. Just to summarize what is (0: not), (1: working) here: -O0 -O2 my native b

Re: [Ghdl-discuss] bound check failed (#9)

2012-11-14 Thread Martin Strubel
Hi Roberto, I don't know if that helps, but I was running into these kind of crashes when accidentally connecting a signal to an entity or other similar cases where I'd slap my own forehead HARD. ghdl should be pretty good at boundary checks, but can go haywire when doing unexpected and "forbidden

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2012-12-03 Thread Martin Strubel
Hi Brian, > > I have reduced the Unisims package to the following, which fails to > compile at -O2 with a Segfault. If you comment out the TableType array, > the procedure compiles successfully! > If I remember right, I got stuck at exactly something like that. When I had checked with gdb in g

Re: [Ghdl-discuss] VHPI with std_logic_vector

2013-01-21 Thread Martin Strubel
Hi Rene, have a look at helpers.c:logic_to_uint(), etc. from ghdlex: http://section5.ch/downloads/ghdlex-0.03eval.tgz Greetings, - Martin > I want to control a division operation in a testbench and use in C > written function. > The important that I have signed an unsigned operators. And the r

Re: [Ghdl-discuss] mingw32 cross compiler tricks for non-mcode

2013-03-19 Thread Martin Strubel
Hi list, let me follow up on that old topic - after svn150 and applying Brians patch from http://www.mail-archive.com/ghdl-discuss@gna.org/msg01670.html I ended up with a so far sane looking x86_64 build of 0.30/gcc 4.7.2, but the interesting part was trying the cross-mingw32 build to compile t

Re: [Ghdl-discuss] Calling functions written in VHDL from a linked C-language-compiled binary

2013-04-10 Thread Martin Strubel
Hi Jon, > > I am attempting to write a multithreaded application in VHDL, using GHDL > as the compiler. I need to call from C a function written in VHDL and > compiled into object form using GHDL back into the VHDL code somehow, > since I can't get direct access to pthreads from VHDL. Did you c

Re: [Ghdl-discuss] Debian package maintainer has retired

2013-05-27 Thread Martin Strubel
Hi, > Sometimes it is better to move the troubled kid out of the community. > Having a clean-room version of the gcc version compatible with ghdl in a > location where apt-get cannot touch it seems very much a way around the > current problem. Problem for me as a GHDL user is that building gcc in

Re: [Ghdl-discuss] Debian package maintainer has retired

2013-05-27 Thread Martin Strubel
Hi Brian, > > I'm curious what you have had to patch in 4.7.2 - is this documented or > would you be willing to attach the patch or add a ticket to gna.org? > https://gna.org/bugs/?group=ghdl > I'm afraid it was a kind of blindly hacking away action to make it build, and I don't really recall t

Re: [Ghdl-discuss] Debian package maintainer has retired

2013-05-29 Thread Martin Strubel
Hi Brian, > Also my patch hasn't covered it all : there is still one patch to apply > for 64-bit builds or not for 32-bit, nobody seems to have got to the > bottom of that issue yet... > I just looked it up, for my internal DEB package (tested on 64 bit only) it seems that I actually wrote a chan

Re: [Ghdl-discuss] ghdl with qemu to emulate SoC FPGA

2013-12-07 Thread Martin Strubel
Hi Svenn, I guess you're generally referring to a Co-Simulation environment what the big guys like Cadence, Mentor, etc. offer. Now, GHDL is pretty darn powerful WRT Co-Simulation, but you have to write some code. Let me respond 'inline': > > I'm the VHDL developer in our team, and I am not real

[Ghdl-discuss] Cross building/configure for GHDL

2013-12-17 Thread Martin Strubel
Hi Brian, thanks for the excellent work! I'm quite certain you could count me in on the requests below, but I better not make any promises these days.. > We're looking for brave people to build, install, test and use this > version, to build confidence and resolve any odd issues we haven't yet >

Re: [Ghdl-discuss] Cross building/configure for GHDL

2013-12-17 Thread Martin Strubel
Hi David, > > Collectively I refer to these as 'Who Bells the Cat?' after snarky things > Robert Heinlein used to put in some of his novels about nice ideas and who > does the actually work (a pun about division of labor). > I didn't speak up before to just not create work. I just made it wor

Re: [Ghdl-discuss] Cross building/configure for GHDL

2013-12-21 Thread Martin Strubel
Hi all, I've got the mingw build sorted out with 4.8.2, as far as I can tell, it works same as the 4.7.2 (with a few quirks and patches). > > An as Brian points out trying to find recent documentation seems hard. > I guess eventually it boils down to finding the right flags, so reading other'

Re: [Ghdl-discuss] Cross building/configure for GHDL

2013-12-21 Thread Martin Strubel
Hi David, > The big question is whether or not a cross compile target can be generalized, > and it likely can be, EXE suffixes aside. For other linux-alike targets (libc) I guess it would work, but not sure about the work load and political implications on the mingw runtime side. > > And I tak

Re: [Ghdl-discuss] Cross building/configure for GHDL

2013-12-25 Thread Martin Strubel
Hi all, for those who'd want to play around over the holidays, I've put up a quick tgz containing a bunch of Make rules to create a cross mingw32 ghdl: http://section5.ch//downloads/ghdl-contrib-buildfiles-0.001.tgz It's still hacky and other platform builds might break, but native amd64 and min

Re: [Ghdl-discuss] Release 0.31

2014-01-11 Thread Martin Strubel
Hi Brian and all, >> >> See ghdlrun.adb: Foreign_Hook. This function is called for each foreign >> subprogram, and return the address of the foreign routine. That's where >> dlopen/dlsym should be added. I'd consider DLL calling from mcode rather hot. Had been thinking about this before I move

Re: [Ghdl-discuss] License of GHDL generated binaries

2014-01-12 Thread Martin Strubel
Hi There, >> pragma License (Modified_GPL); > > I need good arguments. Is there any need to distribute generated > binaries ? > > Tristan. > I'd have this scenario: - Customer 'C' (not someone in-house) orders a design and wants to run his data through the test bench - C gets a binary that i

Re: [Ghdl-discuss] License of GHDL generated binaries

2014-01-12 Thread Martin Strubel
Let me just think loud and reuse Brians UART scenario using a VHPI interface. A testbench for free download could have these modules: 1) UART design (proprietary) in VHDL 2) VHPI-Extensions to provide virtual serial port (e.g. Unix pipe) 3) Some optional DLL with VPI interface, doing something S

Re: [Ghdl-discuss] License of GHDL generated binaries

2014-01-12 Thread Martin Strubel
Hi Adam, > > It would be amazing to put together a small test case demonstrating > this capability! Again, it's not what I have in mind for my immediate > project but I can easily imagine many situations where this would be a > really nifty thing to do! > I've got one scenario where I wanted to

Re: [Ghdl-discuss] Architecture and API/ABI documents

2014-01-13 Thread Martin Strubel
Hi, > >> - verilog interface > I'd say, you interface to software, not the language it treats. > so... Find a easily hackable Verilog simulator that you can hack > and get to work ? :-) > For a verilog simulator, see icarus. If you're referring to the VPI interface: You'd have to complete the V

Re: [Ghdl-discuss] Preferred method to submit source/patches

2014-02-02 Thread Martin Strubel
Hi there, > > Simply submit the patches to this mailing list. Please, put > the patches in the body (no attachement), so that it is easier > to comment them. > I'll take this as an invitation to post the current patch (against changeset 330) for the recently discussed cross compilation support

Re: [Ghdl-discuss] Preferred method to submit source/patches

2014-02-02 Thread Martin Strubel
Hi Tristan, > > Fine. What is the difference between mingw32 and mingw32msvc ? > I don't know, really. I guess the mingw32 prefix is somewhat older. >> Relevant changes: >> - Added --AS and --LD options to ghdl1 for explicit asm/linker >> specification > > Why not, but I think there should b

Re: [Ghdl-discuss] [slight OT] Programming a state-machine for serial port communication

2014-02-27 Thread Martin Strubel
Hi Svenn, apart from YGs approach (which I followed as well) you could have a look at MyHDL and possibly use a co-simulation approach based on VHPI. It helped me to produce synthesizable VHDL code and write extensive test benches in one go. There's a little learning curve, but it pays off soon. G

Re: [Ghdl-discuss] VHPI: best way to send a package's shared variable address to a C function ?

2014-04-11 Thread Martin Strubel
Hi there, just a follow up, I've been experimenting on this field and found no way to access a shared variable array either. So the workaround was, to emulate it all in C. Typical use case is a virtual RAM, which initializes like: type

Re: [Ghdl-discuss] VHPI: best way to send a package's shared variable address to a C function ?

2014-04-12 Thread Martin Strubel
Salut YG and list, > > you could just use a "new", all in VHDL. > No, I'm actually initializing a struct on the C side using my C _new() routine. The access variable is kinda abusive. > you should know however that GHDL's arrays are actually descriptors > (a small "record") that gives the boun

Re: [Ghdl-discuss] VHPI: best way to send a package's shared variable address to a C function ?

2014-04-13 Thread Martin Strubel
Hi, > > Yes please dig and send us the links, > I'm sure a few of us will be interested by some GHDL porn ;-) > I'd subscribe for that. Might also contribute some filthy stuff (latest updates on the ghdlex/cosimulation side): http://www.section5.ch/downloads/ghdlex-0.051.tgz It's still not a

Re: [Ghdl-discuss] Can GHDL export the top level's interface ?

2014-05-14 Thread Martin Strubel
Hi YG, you might want to check vpiwrapper.c from the ghdlex code. It walks through the top hierarchy and creates property nodes for RPC fun. But this just works for simple logic signals, if I remember right. To avoid threading issues, you might want to call your C handler somewhere in a 'VHDL main

Re: [Ghdl-discuss] An Eclipse IDE for GHDL with GTKWAVE integrated

2014-07-12 Thread Martin Strubel
Hi, > I everyone, i'm student in a electronic engineering school in France and i > would like > to know if people are interested to build an Eclipse-like interface for GHDL > which will include > a View for GTKWave. > I think it can be very useful for every students (and others) to have a good

Re: [Ghdl-discuss] ghdl_debian: parallel build issue

2014-08-15 Thread Martin Strubel
Hi all, >> > > I was compiling GHDL using > dpkg-buildpackage -uc -us -j4 > > Two different failure messages were: > > ... > make[3]: *** No rule to make target `../gcc/gtype-vhdl.h', needed by > `ortho-lang.o'. Stop. > > and > That's a classic, the only solution is, to not compile this par

Re: [Ghdl-discuss] Release 0.32 - plan

2014-11-01 Thread Martin Strubel
Hi all, > > So far my conclusion is to do the read/write of deeply included instances > with explicit VHDL code : I'd second that. I've made some experiments with mutex wrappers, but they don't pay off, eventually I ditched them. > It might however be slower and miss certain transient behaviour

Re: [Ghdl-discuss] Signal changes from a C function?

2014-11-03 Thread Martin Strubel
g without requiring you to set up your own socket dance. Cheers, - Strubi -- Simulator <-> C interfacing example via linux pipes -- (c) 2011 Martin Strubel -- -- -- Under Linux, run this command to create a virtual UART interface -- (replace '' by the user id running the simu

Re: [Ghdl-discuss] Signal changes from a C function?

2014-11-04 Thread Martin Strubel
Hi YG, > > So your overall events system must work in a "polled" way, > with your C function called everytime GHDL has done its work for the > current cycle. This is probably where the VHPI interface is often misunderstood. So if you want your simulation to serve an external client asynchronousl

Re: [Ghdl-discuss] Signal changes from a C function?

2014-11-04 Thread Martin Strubel
Hi Rene, > A virtual Uart on a PTY is also interesting. Please add more information. It's been all documented: http://section5.ch/doc/ghdlex/html/group__GHPI__Pipe.html Also check the notes about socat inside the pty.vhdl file. The pty.vhdl can be used like the pipe.vhdl code from the ghdlex di

Re: [Ghdl-discuss] How to write the C function for a procedure with two out? -VHPI-

2015-10-28 Thread Martin Strubel
Hi guys, just throwing in a snippet, I think this question has come up before. For example, a duplex FIFO wrapper on the VHDL side: subtype fifoflag_t is unsigned(0 to 5); ... procedure fifo_rxtx(df : inout duplexfifo_t; data : inout unsigned; flags : inout fifoflag_t) would map into void sim_

Re: [Ghdl-discuss] GHDL as "real" simulator

2016-06-07 Thread Martin Strubel
Hi Vit, > we would like to use GHDL as simulator as real simulator. > it means simulate FSMs with real input and set real outputs. > > We would like to create library with commands like writeline, > which would send data for example to serial port, to network > via UDP/TCP packet and, naturaly, w

Re: [Ghdl-discuss] Collaboration in the GHDL project

2016-06-16 Thread Martin Strubel
Hi there, >>> My first idea was to expose the semantic of a VHDL design in python, so >>> that users could write their own tools in python. >>> But there are many other possibilities. >> >> Do you mean creating an interface to allow a tool in python to access >> e.g. signals deep inside the design

Re: [Ghdl-discuss] Collaboration in the GHDL project

2016-06-16 Thread Martin Strubel
Hi Chris, > > It sounds like the myhdl team needs to revisit the VHPI interface, > when we last looked (many years ago) it was incomplete. It > seems probable that the latest GHDL VHPI would support the > MyHDL cosimulation requirements. > I think it should cover the most, but I don't know ho

Re: [Ghdl-discuss] Synthesis for FPGAs / XML dump

2016-10-17 Thread Martin Strubel
Hi Tristan, Comments and suggestions are welcome. 1) Cool stuff! That might come in very handy for Co-Simulation and other code analysis 2) Could you post a simple example XML output of a FF/register assignment (only if you have the nerve for it, of course), e.g. process(clk) begin i

Re: [Ghdl-discuss] Synthesis for FPGAs / XML dump

2016-10-24 Thread Martin Strubel
Hi Tristan, thanks for the snippet. Played around a bit with XSL and got some usable output just for dumping purposes. Reality will be far more complex though... 4) I was wondering, if it was actually possible to hack an .XSL to extract register assignments as the above, or if a more complex

Re: [Ghdl-discuss] Synthesis for FPGAs

2016-10-26 Thread Martin Strubel
Hi all, It occurred to me while having a walk about a few moments ago that there could be a confusion of two separate ideas in these discussions: first, is embedding an interpreter into the run-time results of the ghdl compiler (into the simulation model); the second is embedding an interprete

Re: [Ghdl-discuss] Synthesis for FPGAs

2016-10-27 Thread Martin Strubel
In these cases, I think we may be describing the same thing. To reconcile terms and elaborate: a) I've been clumsily trying to describe an interactive command shell with loadable configuration/extension scripts. With this, one could "change directories" through the design hierarchy, select signa

Re: [Ghdl-discuss] Synthesis for FPGAs

2016-10-27 Thread Martin Strubel
Hi Adam, I think that road is well traveled [2]. Considering what is available, embedding a big complicated Python interpreter might actually be easier than embedding a simple little Tcl interpreter. [2]: http://www.adacore.com/adaanswers/gems/gem-106-lady-ada-kisses-python-part-2/ I've al

Re: [Ghdl-discuss] Synthesis for FPGAs / XML dump

2016-11-04 Thread Martin Strubel
Hi all, I've played around with XSLT a bit more - here's an attempt to extract some structure from a set of GHDL files. It's in a state "works for me", so don't expected the full coverage. And: no docs, just Makefile. http://section5.ch/downloads/xhdl-0.0proto.tgz However, I had to make some

Re: [Ghdl-discuss] Synthesis for FPGAs / XML dump

2016-11-14 Thread Martin Strubel
On 11/04/2016 01:34 PM, why...@f-cpu.org wrote: Le 2016-11-04 10:59, Martin Strubel a écrit : On the other side there's a lot of possibilities for fun stuff, like creating SVG images from the XML using built-in browser XSL abilities. That's the best-looking idea of today ! I

Re: [Ghdl-discuss] Status of the VPI / VHPI interfaces implementation

2017-04-24 Thread Martin Strubel
Hi, What is the status of the VPI / VHPI / interfacing to other languages implementation on GHDL? For me, the VHPI i/f turned out to be very robust and way more powerful than what Modelsim has to offer. You will have to dig through some code though, and you might want to search this list's

Re: [Ghdl-discuss] interfacing to matlab/octave

2017-05-24 Thread Martin Strubel
Hi, Does anyone have a good idea for that? I'm solving these kind of things with virtual RAM or a virtual bus that is accessible by a network backdoor. However there is a bit of overhead involved (it requires the netpp library to communicate), it will start paying off at the point where m