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? >> -- 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? >> libraries.load_std_library; >> libraries.load_work_library; >> >> Before doing the name_table.get_identifier( filename ) followed by the >> libraried.load_file( fid ). >> >> > Back_End.Finish_Compilation is called after parsing to finish the work: >> > that >> > is semantic analysis and code generation. >> >> If I wanted to skip code generation, and just do the analysis - does >> that use the GCC backend aspect or can I get away with just using what >> is all in Ada? > > No you don't need GCC at all. The 'ghdl' driver can analyze and semantize > but it is not linked with GCC. Beautiful. >> Is this step required if I just want to know things about the VHDL - >> for example, where entities are declared, instantiated, what scopes >> are visible, value and names of constants, etc? > > Note that Load_File only parse the file. It doesn't do semantic analysis: > ie it doesn't resolve names or types. > You can use the tree after load_file has been called but it won't give you > what you want here. > > You must at least call Sem.Semantic for each unit. And if you do that, you > must set back_end.finish_compilation. There is a good reason for that: during > semantic analysis, other units may be loaded (think about clauses such as > use ieee.std_logic_1164.all). This is done automatically but for each unit > loaded, back_end.finish_compilation is called. > > 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. 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 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. Brian _______________________________________________ Ghdl-discuss mailing list [email protected] https://mail.gna.org/listinfo/ghdl-discuss
