Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Breaking Change] Deprecation of 'compile_builtins' and removal in v5 #777

Open
umarcor opened this issue Nov 13, 2021 · 2 comments
Open

Comments

@umarcor
Copy link
Member

umarcor commented Nov 13, 2021

Option compile_builtins of methods from_args and from_argv is to be removed in an upcoming release of VUnit. Until v4.7.0 (included), compile_builtins is enabled by default. Therefore, removing the option (thus, having it disabled by default), is a breaking change that will affect most users, particularly newcomers copying and pasting examples/tutorials. This issue contains guidelines to adapt the scripts.

References:

VHDL only

Traditional procedure (until v4.6.0):

from vunit import VUnit
VU = VUnit.from_argv()

Recommended procedure with v4.7.0 (current master):

from vunit import VUnit
VU = VUnit.from_argv(compile_builtins=False)  # Stop using the builtins ahead of time.
VU.add_vhdl_builtins()  # Add the VHDL builtins explicitly!

Upcoming procedure with v5:

from vunit import VUnit
VU = VUnit.from_argv()  # Do not use compile_builtins.
VU.add_vhdl_builtins()  # Add the VHDL builtins explicitly!

Verilog only

Traditional procedure (until v4.6.0):

from vunit.verilog import VUnit
VU = VUnit.from_argv()

Recommended procedure with v4.7.0 (current master):

from vunit import VUnit  # Change this to use the default class instead of vunit.verilog!
VU = VUnit.from_argv(compile_builtins=False)  # Ensure that VHDL builtins are not added.
VU.add_verilog_builtins()  # Add the verilog builtins explicitly!

Upcoming procedure with v5:

from vunit import VUnit  # Use the default class instead of vunit.verilog!
VU = VUnit.from_argv()  # Do not use compile_builtins.
VU.add_verilog_builtins()  # Add the verilog builtins explicitly!

Mixed language (VHDL and Verilog, or Verilog and VHDL)

Traditional procedure (until v4.6.0):

# Default class (VHDL first)
from vunit import VUnit
VU = VUnit.from_argv()
VU.add_verilog_builtins()
# Verilog class (Verilog first)
from vunit.verilog import VUnit
VU = VUnit.from_argv()
VU.add_vhdl_builtins()

Recommended procedure with v4.7.0 (current master):

# VHDL first
from vunit import VUnit
VU = VUnit.from_argv(compile_builtins=False)  # Stop using the builtins ahead of time.
VU.add_vhdl_builtins()  # Add the VHDL builtins explicitly!
VU.add_verilog_builtins()
# Verilog first
from vunit import VUnit
VU = VUnit.from_argv(compile_builtins=False)  # Ensure that VHDL builtins are not added ahead of time.
VU.add_verilog_builtins()  # Add the verilog builtins explicitly!
VU.add_vhdl_builtins()

Upcoming procedure with v5:

# VHDL first
from vunit import VUnit
VU = VUnit.from_argv()  # Do not use compile_builtins.
VU.add_vhdl_builtins()  # Add the VHDL builtins explicitly!
VU.add_verilog_builtins()
# Verilog first
from vunit import VUnit  # Use the default class instead of vunit.verilog!
VU = VUnit.from_argv()  # Do not use compile_builtins
VU.add_verilog_builtins()  # Add the verilog builtins explicitly!
VU.add_vhdl_builtins()
@umarcor umarcor changed the title [Breaking Change] Deprecation of 'compile_builtins' in v5 [Breaking Change] Deprecation of 'compile_builtins' and removal in v5 Nov 13, 2021
@eine eine pinned this issue Nov 13, 2021
@GlenNicholls
Copy link
Contributor

Quick question, what is the reason for this change? Is this to support the use-case where a user/team might want to pre-compile the builtins for their simulators to speed up test runs?

I have nothing against the change, just curious why it's being made.

@eine eine added this to the v5.0.0 milestone Feb 26, 2023
@umarcor
Copy link
Member Author

umarcor commented Feb 26, 2023

There are both technical and tactical reasons.

On the technical side, having separated commands/options to add VHDL and Verilog builtins (instead of overriding the same one) allows us to more easily share the features that are common, regardless of the language; or even using both in mixed-language desings. We avoid a VUnit class for Verilog. Note that verilog.py is removed in #764. That's something we discussed in 2019 (#559), but we did not implement yet because it is a breaking change and we did not have any other particular reason. I think the use case you ask about is unaffected by this change. In both solutions you can not compile the bultins and add them as an external precompiled resource.

On the tactical side, we want to better communicate VUnit's vision of the broader (open source) hardware verification ecosystem.
As you know, VUnit is composed by three main parts (see http://vunit.github.io/about.html#overview): the python-HDL runner interface, the Python management and reporting API, and HDL utility libraries. VUnit's approach is modular, so that each user can pick the features they need, and they can combine them with their own or with third-party code. Using resources from projects such as OSVVM or UVVM has always been a supported use case.
During the first ~5y after VUnit was released, there was no open source test management alternative comparable to VUnit for HDL development and CI. We hoped that OSVVM and UVVM would collaborate to better integrate the HDL utilities with VUnit's Python management and reporting API. Unfortunately, due to legit commercial interests, both projects decided to reinvent the wheels themselves, in order to keep their users captive through obscurity. In the process, they claimed/claim that VUnit is a monolith, and argue(d) they don't want their users to be exposed to VUnit's HDL features at all (ideally, they'd want users not to know they even exist). They did also complain about the usage of the term "methodology", which they argued with each other about. While I understand why they decided to do so, I don't share that (broken/fractured) vision of the community; and although I'm not brave enough to use "we" here, I believe it's a shared feeling among VUnit developers/maintainers. Therefore, we are doing an effort to better communicate:

  • To users, what's VUnit's vision, and how they can combine multiple frameworks/methodologies using VHDL and/or SV. By technically managing VUnit's HDL utilities the same way we manage OSVVM or VCs, we make an statement about not having first-class HDL features. We might eventually even submodule those, even though we have no technical reason to address that at the moment.
  • To OSVVM/UVVM developers, how they can let their fears aside and embrace open development and collaboration. Despite their efforts in the last 4-5y, VUnit is still the best management solution for CI. The community would be stronger if they focused on the stuff they do best, which is complex enough already. E.g. OSVVM's Coverage, VCs and the new CoSim solutions are pretty good.

Some relevant references in this regard:

@eine eine modified the milestones: v5.0.0, v5x, v5.1.0 Apr 19, 2023
umarcor added a commit to dbhi/vunit that referenced this issue Apr 23, 2023
umarcor added a commit to dbhi/vunit that referenced this issue Apr 23, 2023
mschiller-nrao added a commit to talonmyburgh/casper_dspdevel that referenced this issue May 26, 2023
…do 2020 Xsim, ghdl simulations, and quartus simulations

Squashed commit of the following:

commit f693ec9
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 14:29:03 2023 -0400

    Fixes for size of sepa data and fix for I=I Q=I problem.

commit a436eca
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 11:31:03 2023 -0400

    Fix for xsims and projects

commit 482b810
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 10:41:59 2023 -0400

    Removing types doc

commit 73d2e66
Merge: 5d5aa2d 4eb6392
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 10:34:01 2023 -0400

    Merge remote-tracking branch 'origin/main'

commit 5d5aa2d
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 10:31:23 2023 -0400

    Possible fix for vunit simulations in newer GHDL?

commit 4eb6392
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 08:09:10 2023 -0400

    Update .gitlab-ci.yml file

commit e154111
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 07:51:34 2023 -0400

    Update .gitlab-ci.yml file to get ghdl version

commit e868cac
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Fri May 26 07:41:45 2023 -0400

    fix type errors

commit 4071b36
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 12:48:31 2023 -0400

    Fix syntax errors in run.py

commit aaab566
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 12:45:02 2023 -0400

    Fix to load numpy for all test benches in vunit ghdl

commit 880f2da
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 12:39:29 2023 -0400

    more python fixes

commit f94c4dd
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 12:14:01 2023 -0400

    Updating for vunit 5.0+ as per VUnit/vunit#777

commit a9c15ff
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 11:36:29 2023 -0400

    Removed parts of fixed/float package that confuses GHDL

commit b214ab5
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 11:00:40 2023 -0400

    Try 1241234123 to fix python

commit 1ad5e1c
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 10:53:48 2023 -0400

    MOre python issues...

commit 507f926
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 10:47:14 2023 -0400

    Implemented version 4.7.0 changes as per VUnit/vunit#777

commit 352461f
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 10:41:39 2023 -0400

    Ugh more typos

commit 89ae7d6
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 10:36:32 2023 -0400

    Fix to include new fixed point files to work around vhdl 2008 compatability in Xsim

commit d07430c
Author: Matthew Schiller <mschille@nrao.edu>
Date:   Thu May 25 10:25:41 2023 -0400

    Changing to vunit docker and runtime installing numpy and pytest
mschiller-nrao added a commit to talonmyburgh/casper_dspdevel that referenced this issue May 31, 2023
mschiller-nrao added a commit to talonmyburgh/casper_dspdevel that referenced this issue May 31, 2023
hcommin added a commit to enclustra/en_cl_fix that referenced this issue Aug 30, 2023
LukasVik added a commit to tsfpga/tsfpga that referenced this issue Nov 30, 2023
VUnit 5.0.0 is now the maintrack, and fixes for VUnit/vunit#777 are merged to master.
Hence we do not need this workaround anymore.

The only point of the "workaround" was to skip a deprecation warning printout.
It should still work for users of older VUnit versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants