Skip to content

Commit

Permalink
Moving vhdl examples into examples/vhdl/
Browse files Browse the repository at this point in the history
This reverts commit 7761fe7f94287f8d9e4f8ebf6e849d7fd92c22f0.
  • Loading branch information
kraigher committed Jun 30, 2015
1 parent b4a98cf commit d714fcc
Show file tree
Hide file tree
Showing 57 changed files with 56 additions and 175 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ VUnit depends on a number of components as listed below. Full VUnit functionalit
There are a number of ways to get started.

* The [User Guide](user_guide.md) will guide users on how to use start using the basic features of VUnit but also provides information about more speficic and adanced usage.
* Have a look at the examples under [examples](examples). The examples in [logging](examples/logging) and [check](examples/check) are tutorials that should be single-stepped in your simulator.
* Have a look at the examples under [examples](examples). The examples in [logging](examples/vhdl/logging) and [check](examples/vhdl/check) are tutorials that should be single-stepped in your simulator.
* There are also various presentations of VUnit on [YouTube](https://www.youtube.com/channel/UCCPVCaeWkz6C95aRUTbIwdg). For example [an introduction to unit testing (6 min)](https://www.youtube.com/watch?v=PZuBqcxS8t4) and a [short introduction to VUnit (12 min)](https://www.youtube.com/watch?v=D8s_VLD91tw).

# Contributing
Expand All @@ -70,6 +70,6 @@ License, v. 2.0](http://mozilla.org/MPL/2.0/).
© 2014-2015 Lars Asplund, lars.anders.asplund@gmail.com.

##OSVVM
OSVVM 2015.03 is redistributed with VUnit for your convenience and is located under [vhdl/osvvm](vhdl/osvvm). Minor [modifications](https://github.com/LarsAsplund/vunit/commit/25fce1b3700e746c3fa23bd7157777dd4f20f0d6) have been made to enable GHDL support. Derivative work is also located under [examples/osvvm\_integration/src](examples/osvvm_integration/src). These files are licensed under the terms of [ARTISTIC License](http://www.perlfoundation.org/artistic_license_2_0).
OSVVM 2015.03 is redistributed with VUnit for your convenience and is located under [vhdl/osvvm](vhdl/osvvm). Minor [modifications](https://github.com/LarsAsplund/vunit/commit/25fce1b3700e746c3fa23bd7157777dd4f20f0d6) have been made to enable GHDL support. Derivative work is also located under [examples/vhdl/osvvm\_integration/src](examples/vhdl/osvvm_integration/src). These files are licensed under the terms of [ARTISTIC License](http://www.perlfoundation.org/artistic_license_2_0).

© 2010 - 2015 by SynthWorks Design Inc. All rights reserved.
8 changes: 1 addition & 7 deletions examples/array/run.py → examples/vhdl/array/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- License, v. 2.0. If a copy of the MPL was not distributed with this file,
-- You can obtain one at http://mozilla.org/MPL/2.0/.
--
-- Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com
-- Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

library ieee;
use ieee.std_logic_1164.all;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 1 addition & 7 deletions examples/check/compile.py → examples/vhdl/check/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit
from vunit import ROOT

Expand Down
8 changes: 1 addition & 7 deletions examples/com/run.py → examples/vhdl/com/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit

ui = VUnit.from_argv()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from itertools import product
from vunit import VUnit

Expand Down
10 changes: 2 additions & 8 deletions examples/logging/compile.py → examples/vhdl/logging/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

from os.path import join, dirname
from vunit import VUnit

ui = VUnit.from_argv()
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit

ui = VUnit.from_argv()
Expand Down
8 changes: 1 addition & 7 deletions examples/uart/run.py → examples/vhdl/uart/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit

ui = VUnit.from_argv()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit

ui = VUnit.from_argv()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- License, v. 2.0. If a copy of the MPL was not distributed with this file,
-- You can obtain one at http://mozilla.org/MPL/2.0/.
--
-- Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com
-- Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

library vunit_lib;
context vunit_lib.vunit_context;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 1 addition & 7 deletions examples/vivado/run.py → examples/vhdl/vivado/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from os.path import join, dirname
from vunit import VUnit
from vivado_util import add_vivado_ip

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,27 +187,27 @@ Elapsed time was 0.3 seconds
Some failed!
```

The above example code can be found in `examples/user_guide/`.
The above example code can be found in [examples/vhdl/user_guide/](examples/vhdl/user_guide/).

# More examples
There are many examples demonstrating more specific usage of VUnit listed below:
* [examples/user_guide/](examples/user_guide/)
* [examples/vhdl/user_guide/](examples/vhdl/user_guide/)
* The most minimal VUnit project covering the basics of this user guide.

* [examples/uart/](examples/uart/)
* [examples/vhdl/uart/](examples/vhdl/uart/)
* A more realistic test bench of an UART to show VUnit usage on a typical module.
In addition to the normal [run.py](examples/uart/run.py) it also contains a [run_with_preprocessing.py](examples/uart/run_with_preprocessing.py) to demonstrate the benefit of location and check preprocessing.
In addition to the normal [run.py](examples/vhdl/uart/run.py) it also contains a [run_with_preprocessing.py](examples/vhdl/uart/run_with_preprocessing.py) to demonstrate the benefit of location and check preprocessing.

* [examples/array/](examples/array/)
* [examples/vhdl/array/](examples/vhdl/array/)
* Demonstrates the `array_t` data type of [array_pkg](vhdl/array/src/array_pkg.vhd) which can be used to handle dynamically sized 1D, 2D and 3D data as well as storing and loading it from csv and raw files.

* [generate_tests](examples/generate_tests)
* [generate_tests](examples/vhdl/generate_tests)
* Demonstrates generating multiple test runs of the same test bench with different generic values.

* [vivado](examples/vivado)
* [vivado](examples/vhdl/vivado)
* Demonstrates compiling and performing behavioral simulation of Vivado IPs with VUnit.

* [com](examples/com)
* [com](examples/vhdl/com)
* Demonstrates the `com` message passing package which can be used to communicate arbitrary objects between processes. Further reading can be found in the [com user guide](vhdl/com/user_guide.md)

## Selecting simulator backend
Expand Down
6 changes: 0 additions & 6 deletions vhdl/array/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions vhdl/check/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit
from vunit.check_preprocessor import CheckPreprocessor
from glob import glob
Expand Down
6 changes: 0 additions & 6 deletions vhdl/com/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
9 changes: 1 addition & 8 deletions vhdl/compile_vunit_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname, basename
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

from vunit import VUnit

Expand Down
6 changes: 0 additions & 6 deletions vhdl/dictionary/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions vhdl/logging/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions vhdl/path/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions vhdl/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
6 changes: 0 additions & 6 deletions vhdl/string_ops/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
#
# Copyright (c) 2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@
#
# Copyright (c) 2014-2015, Lars Asplund lars.anders.asplund@gmail.com

# Make vunit python module importable
from os.path import join, dirname
import sys
path_to_vunit = join(dirname(__file__), '..', '..', '..', '..')
sys.path.append(path_to_vunit)
# -------

from vunit import VUnit

root = dirname(__file__)

ui = VUnit.from_argv()
lib = ui.add_library("lib")
lib.add_source_files(join(root, "vhdl", "*.vhd"))
lib.add_source_files(join(root, "*.vhd"))


def configure_tb_with_generic_config(ui):
Expand Down Expand Up @@ -45,6 +39,7 @@ def post_check(output_path):
config_generic="set-from-config"),
post_check=post_check)


def configure_tb_same_sim_all_pass(self):
def post_check(output_path):
with open(join(output_path, "post_check.txt"), "r") as fptr:
Expand Down
Loading

0 comments on commit d714fcc

Please sign in to comment.