Search code examples
vhdlghdl

How to run a VHDL testbench with a specific architecture using GHDL?


We know that for a single entity E, we can associate several architectures A(i).

That is also true for testbenches, which are plain such Entity-architecture. However, using GHDL, I don't know how to run one such particular testbench, say with architecture A(arch).

For recall, here is a simple script to run a testbench "tb" for design named "dut" :

ghdl -a dut.vhd
ghdl -a tb.vhd
ghdl -e tb
ghdl -r tb

Here the name of the architecture for tb is not given. How can I precise that I want to run architecture say "arch42" ?


Solution

  • info ghdl:

    3.1.3 Run command

    Run (or simulate) a design.

     $ ghdl -r [OPTIONS] PRIMARY_UNIT [SECONDARY_UNIT] [SIMULATION_OPTIONS]  
    

    The options and arguments are the same as for the elaboration
    command, *note Elaboration command::

    The secondary unit would be arch42 from what you relate, the primary is tb. You'd need to elaborate the identical primary and secondary. If you're using a gcc based ghdl there will be an executable with a name comprised of both tb-arch42.

    ghdl -e tb arch42
    ghdl -r tb arch42

    The current version of ghdl is ghdl-0.31 and as far as I know all platform distributions distribute ghdl.info, which the man page references as a source of in depth information.