On Tue, Oct 20, 2009 at 11:51:31PM -0400, Brian Padalino wrote:
> On Tue, Oct 20, 2009 at 11:34 PM, Tristan Gingold <[email protected]> wrote:
> > You shouldn't set flags.bootstrap.  This is required only to compile the
> > std library.  May you have set it because you forgot to add the path for
> > the std library ?
> 
> I don't have any of the libraries installed or precompiled anywhere.
> If I want to recompile the ieee and std libraries every time, am I
> doing it right?

ghdl will 'recompile' these libraries every time, but it must know where
the sources are.  In fact you simple need to import them first (using
ghdl -i --work=).  Something like:

ghdl -i --bootstrap --work=std textio.vhdl
ghdl -i --work=ieee std_logic_1164.vhdl

You'd better to stick with this way.

> >>     -- setup libraries
> >>     libraries.add_library_path( "./library/ieee/" ) ;
> >
> > Hint: also do that for std.
> 
> If I wanted to compile into a different library, how do I set what the
> current library is that I am trying to compile into?  For example,
> creating the std, ieee or other vendor libraries?

You simply need to change the work library name.  See how the --work=
switch is handled (in options.adb and procedures load_work_library and
get_library in libraries.adb).

I think you'd better to first only use 'work'.  That will be simpler.

> > For a simple example, see in ghdllocal.adb procedure finish_compilation.
> 
> I did notice that init set back_end.finish_compilation to be the local
> finish_compilation which called sem.semantic for each of the units,
> and would display information/semantic errors for each file.

Good.

> This is where I've gotten stuck.  I obviously didn't load things
> appropriately since I don't have std or ieee pre-compiled, and I am
> trying to compile them in my program.  Unfortunately I can't figure
> that out, so sem.semantic for each unit will fail by not finding
> ieee.std_logic_1164.

Once these libraries are known to ghdl, it should work.
Or you may start with a simpler example that don't use ieee.

> > Once you have done that, you will have a decorated tree in memory.
> > The procedure disp_tree.disp_tree may be useful to display the tree.
> >
> > The root of the tree is libraries.libraries_chain.  This is a linked list
> > of all libraries.  You may prefer however to use work_library as the root.
> >
> > Read the comments in iirs.ads to get an idea about all the nodes and how
> > to traverse the hierarchy to the entity declarations.
> 
> I have read that and some other methods, one of which I believe was
> location_to_coord which was helpful for telling me where in a file a
> unit is declared - very useful information!
> 
> Thanks for the information so far - you've been very helpful.  I hope
> I am not being a pain or annoying.

You're welcome.

Tristan.

_______________________________________________
Ghdl-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to