On 16/08/11 12:45 AM, Salvador Eduardo Tropea wrote:

While I don't have access to a Windows machine, I've generated mcode
versions for both Mac OS X and Linux.

The Windows (and recent Mac OS X version) are both direct compile.  -a
(analyze) and -e (elaborate) commands don't produce object code or
executables while you can see updates in the work-obj93.cf file.

Try the -r (run) flag on your model image name (top level architecture
selected architecture).  If you've analyzed all your dependent VHDL source
it will run.

You could note the mcode versions generate Makefiles without dependencies on
.o object files.  A Makefile for a gcc frontend version of GHDL would likely
work, but would analyze all the VHDL files involved in a model during every
invocation of running a model.  This one runs for instance with a target of
'make run; make wave':


# Makefile automatically generated by ghdl
# Version: GHDL 0.25 (20060811) [Sokcho edition] - GCC back-end code generator
# Command used to generate this makefile:
# ghdl --gen-makefile test_config des_tb
#
# hand modified for missing dependencies and readability
#

.SUFFIXES:
.SUFFIXES:.vhdl .o
GHDL=ghdl
WAVE=gtkwave
TWINWAVE=twinwave
GHDLFLAGS=
GHDLRUNFLAGS=--stop-time=587200ns --wave=test_config-des_tb.ghw --disp-tree=port
#XTERMFLAGS=--workdir $(PWD) --new-tab -e
#XTERM=xterm $(XTERMFLAGS)

# Default target
all:  test_config-des_tb

# Run target
run: test_config-des_tb
        $(GHDL) -r test_config des_tb $(GHDLRUNFLAGS) > display_tree
        touch run

#wave: run
wave:
        $(XTERM) $(WAVE) test_config-des_tb.ghw test_config-des_tb.sav &

twinwave: run
        $(XTERM) $(TWINWAVE) test_config-des_tb.ghw test_config-des_tb.sav  \
         \+ test_config-des_tb.ghw test_config-des_tb.sav   &

test_config-des_tb:  des_tb.o
        $(GHDL) -e $(GHDLFLAGS) test_config des_tb

.vhdl.o:
        $(GHDL) $(GHDLFLAGS) -a  $<

# Files dependences

dslice.o:   reg8s.o
statem.o:   reg6.o
cd_reg.o:   sr4.o sr8.o
des.o:  bidir.o cd_reg.o clkbuf.o des_pack.o inbuf.o invbuf.o  \
        outbuf.o dslice.o sbox1.o sbox2.o sbox3.o sbox4.o sbox5.o sbox6.o \
        sbox7.o sbox8.o reg8s.o statem.o
des_tb.o:   des.o key_vector.o plain_vector.o \
            cipher_vector.o encrypt_vector.o

clean:
        -rm test_config-des_tb
        -rm *.o
        -rm run

sanitary: clean
        -rm test_config-des_tb.ghw


--
The makefile will obliviously make .o object files using returned flag
status to determine success and not actual existence of object files.

I couldn't predict whether the same behavior would be exhibited in Windows.

(XTERM undefined will use stdin/stdout/stderr).

In this case a Makefile could be produced after analyzing individual
components by:

%> ghdl --gen-makefile test_config des_tb

# Makefile automatically generated by ghdl
# Version: GHDL 0.29 (20100109) [Sokcho edition] - mcode code generator
# Command used to generate this makefile:
# ghdl --gen-makefile test_config des_tb

GHDL=ghdl
GHDLFLAGS=
GHDLRUNFLAGS=

# Default target : elaborate
all : elab

# Elaborate target.  Almost useless
elab : force
        $(GHDL) -c $(GHDLFLAGS) -e test_config des_tb

# Run target
run : force
        $(GHDL) -c $(GHDLFLAGS) -r test_config des_tb $(GHDLRUNFLAGS)

# Targets to analyze libraries
init: force
        #
/Users/david_koontz/ghdl_test/ghdl/translate/lib//v93/ieee/../../../../libraries/ieee/std_logic_1164.v93
        #
/Users/david_koontz/ghdl_test/ghdl/translate/lib//v93/ieee/../../../../libraries/ieee/std_logic_1164_body.v93
        $(GHDL) -a $(GHDLFLAGS) des_pack.vhdl
        $(GHDL) -a $(GHDLFLAGS) dslice.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox1.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox2.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox3.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox4.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox5.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox6.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox7.vhdl
        $(GHDL) -a $(GHDLFLAGS) sbox8.vhdl
        $(GHDL) -a $(GHDLFLAGS) reg8s.vhdl
        $(GHDL) -a $(GHDLFLAGS) bidir.vhdl
        $(GHDL) -a $(GHDLFLAGS) clkbuf.vhdl
        $(GHDL) -a $(GHDLFLAGS) invbuf.vhdl
        $(GHDL) -a $(GHDLFLAGS) inbuf.vhdl
        $(GHDL) -a $(GHDLFLAGS) outbuf.vhdl
        $(GHDL) -a $(GHDLFLAGS) statem.vhdl
        $(GHDL) -a $(GHDLFLAGS) cd_reg.vhdl
        $(GHDL) -a $(GHDLFLAGS) des.vhdl
        $(GHDL) -a $(GHDLFLAGS) key_vector.vhdl
        $(GHDL) -a $(GHDLFLAGS) plain_vector.vhdl
        $(GHDL) -a $(GHDLFLAGS) cipher_vector.vhdl
        $(GHDL) -a $(GHDLFLAGS) encrypt_vector.vhdl
        $(GHDL) -a $(GHDLFLAGS) des_tb.vhdl
        $(GHDL) -a $(GHDLFLAGS) reg6.vhdl
        $(GHDL) -a $(GHDLFLAGS) sr8.vhdl
        $(GHDL) -a $(GHDLFLAGS) sr4.vhdl

force:

 --

With no wave invocation and no dependencies on object files.  Ghdl installed
in ~/ghdl_test in this case.  Note run is not dependent on init.


So the secret is to analyze everything in the right order, elaborate the top
level and then run the model.  No object files need apply.


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

Reply via email to