<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.2">Jekyll</generator><link href="https://svunit.org/feed.xml" rel="self" type="application/atom+xml" /><link href="https://svunit.org/" rel="alternate" type="text/html" /><updated>2024-05-06T21:55:45+00:00</updated><id>https://svunit.org/feed.xml</id><title type="html">SVUnit</title><subtitle>A unit testing framework for SystemVerilog</subtitle><author><name>Tudor Timi</name></author><entry><title type="html">Version 3.38.0 Released</title><link href="https://svunit.org/2024/05/06/version-3.38.0-released.html" rel="alternate" type="text/html" title="Version 3.38.0 Released" /><published>2024-05-06T21:21:00+00:00</published><updated>2024-05-06T21:21:00+00:00</updated><id>https://svunit.org/2024/05/06/version-3.38.0-released</id><content type="html" xml:base="https://svunit.org/2024/05/06/version-3.38.0-released.html">&lt;p&gt;I’m happy to announce the release of &lt;a href=&quot;https://github.com/svunit/svunit/releases/tag/v3.38.0&quot;&gt;version 3.38.0&lt;/a&gt;.
You can find the full (but fairly modest) changelog at the previous link.
I’ve also created a &lt;a href=&quot;https://github.com/svunit/svunit/discussions/309&quot;&gt;GitHub discussion&lt;/a&gt; for it.
I’m still not sure about how to best use discussions
(though GitHub does provide a list of &lt;a href=&quot;https://docs.github.com/en/discussions/guides/best-practices-for-community-conversations-on-github&quot;&gt;best practices&lt;/a&gt; for them),
but I kind of like the idea of keeping conversations and issues separate.&lt;/p&gt;

&lt;p&gt;One of the main things I wanted to get into this release was a fix related to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--filter&lt;/code&gt; option.
Even when filtering out all tests from a unit test module,
SVUnit would still print messages related to these modules (&lt;a href=&quot;https://github.com/svunit/svunit/issues/207&quot;&gt;svunit/svunit#207&lt;/a&gt;).
For example, assuming that we ran &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;runSVUnit --filter &apos;interesting_ut.*&apos;&lt;/code&gt;,
we would get something like:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;INFO:  [0][some_filtered_out_ut]: RUNNING
INFO:  [0][some_other_filtered_out_ut]: RUNNING
INFO:  [0][interesting_ut]: RUNNING
... tests from interesting_ut ...
INFO:  [0][some_filtered_out_ut]: PASSED (0 of 0 tests passing)
INFO:  [0][some_other_filtered_out_ut]: PASSED (0 of 0 tests passing)
INFO:  [0][interesting_ut]: PASSED (5 of 5 tests passing)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With many unit tests,
a lot of extraneous log output was printed,
which made it difficult to find the real tests.
The fix for this was long overdue,
but since it wasn’t trivial to implement,
I kept putting it off.&lt;/p&gt;

&lt;p&gt;Before tackling the main fix,
I wanted to work on something easier,
but somehow connected to it.
Inspired by &lt;a href=&quot;https://google.github.io/googletest/advanced.html#listing-test-names&quot;&gt;GoogleTest&lt;/a&gt;,
I added a new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--list-tests&lt;/code&gt; option to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;runSVUnit&lt;/code&gt;,
which is a good companion to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--filter&lt;/code&gt; option.
This new option just lists test names without actually running them (&lt;a href=&quot;https://github.com/svunit/svunit/pull/299&quot;&gt;svunit/svunit#299&lt;/a&gt;).
Implementing it was a good way to get familiar with the code related to test execution that I inherited.
The pull request is not the prettiest,
because it contains a lot of duplication,
but this was something to be handled later.&lt;/p&gt;

&lt;p&gt;I did some major renovations,
by splitting the declaration of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;`SVTESTs&lt;/code&gt; from their execution (&lt;a href=&quot;https://github.com/svunit/svunit/pull/301&quot;&gt;svunit/svunit#301&lt;/a&gt;).
The need for this became apparent while implementing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--list-tests&lt;/code&gt;,
where we really just want to get the tests that are declared.
I didn’t do this in the same pull request,
in order to split the change to behavior (adding &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;--list-tests&lt;/code&gt;)
from the change to structure (moving code out of the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;`SVTEST&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;`SVTEST_END&lt;/code&gt; macros).
This is good advice I got from &lt;a href=&quot;https://tidyfirst.substack.com/p/structure-and-behavior-prs&quot;&gt;this article by Kent Beck&lt;/a&gt;.
Also, the test suite for verifying SVUnit itself was invaluable
in making sure that the code still worked as before.
A happy side effect of this change is
that it’s now possible to add arbitrary code between &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;`SVTESTs&lt;/code&gt;.
This is extremely useful for grouping tests and auxiliary code together:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class some_fake;
  // ...
endclass

`SVTEST(some_test)
  some_fake dependency;
  class_under_test uut = new(dependency);
  // ...
`SVTEST_END
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I’m kind of proud of a small pull request I did
which refactored some code related to listing tests (&lt;a href=&quot;https://github.com/svunit/svunit/pull/303&quot;&gt;svunit/svunit#303&lt;/a&gt;)
and which I feel has educational value.
First, I think it’s necessary to highlight that &lt;a href=&quot;https://refactoring.com/&quot;&gt;refactoring&lt;/a&gt; means
“altering [code’s] internal structure without changing its external behavior”.
I mention this,
because the term is very often used wrongly within our industry to refer to any kind of “major” change,
especially to those that also sneak in some tweaks to behavior.
Each commit in this pull request makes a small, purely structural change to the code,
that could be validated by simple inspection,
though the project’s test suite again helped a lot to ensure that nothing broke.&lt;/p&gt;

&lt;p&gt;In the end,
I built up the courage to fix what I mentioned at the beginning of the post.
SVUnit no longer prints &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;RUNNING&lt;/code&gt; for modules that don’t contain any selected tests (&lt;a href=&quot;https://github.com/svunit/svunit/pull/304&quot;&gt;svunit/svunit#304&lt;/a&gt;).
At this point,
fixing this was a breeze,
because I applied another piece of advice from Kent Beck,
on how to deal with difficult changes:
“make the change easy, then make the easy change”.&lt;/p&gt;

&lt;p&gt;I’d like to add that SVUnit now also has support for the Vivado simulator.
I was very positively surprised by how good the tool is,
especially considering that AMD offers it for free.
If I could figure out the legal and technical aspects of how to do it,
I would gladly use it in the GitHub workflow, alongside Verilator,
to continuously test the project. Ideas are welcome.&lt;/p&gt;

&lt;p&gt;Speaking of testing,
I couldn’t run the test suite on VCS, Riviera or DSim.
If you have access to any of these tools,
I would be very grateful if you could check whether this release works on it and report back.&lt;/p&gt;

&lt;p&gt;If you try out this release and find any bugs,
please report them on the project’s &lt;a href=&quot;https://github.com/svunit/svunit/issues&quot;&gt;GitHub Issues section&lt;/a&gt;.&lt;/p&gt;</content><author><name>Tudor Timi</name></author><summary type="html">I’m happy to announce the release of version 3.38.0. You can find the full (but fairly modest) changelog at the previous link. I’ve also created a GitHub discussion for it. I’m still not sure about how to best use discussions (though GitHub does provide a list of best practices for them), but I kind of like the idea of keeping conversations and issues separate.</summary></entry><entry><title type="html">Introducing the SVUnit Blog</title><link href="https://svunit.org/2024/04/28/introducing-the-svunit-blog.html" rel="alternate" type="text/html" title="Introducing the SVUnit Blog" /><published>2024-04-28T17:56:00+00:00</published><updated>2024-04-28T17:56:00+00:00</updated><id>https://svunit.org/2024/04/28/introducing-the-svunit-blog</id><content type="html" xml:base="https://svunit.org/2024/04/28/introducing-the-svunit-blog.html">&lt;p&gt;Every now and then,
I find myself wanting to do various announcements related to SVUnit.
I’ve been using LinkedIn and Twitter,
but these aren’t really the ideal platforms for this.
A blog is much better.&lt;/p&gt;

&lt;p&gt;Without further ado, I would like to introduce the SVUnit blog.&lt;/p&gt;

&lt;p&gt;I’ll use the blog primarily to announce new releases.
If a new release adds a really cool new feature,
I’d like to highlight it and maybe show an example of how to use it.&lt;/p&gt;

&lt;p&gt;I’d also like to maybe write about plans for future additions,
be they new features, bug fixes or internal cleanups.
It would also be nice to occasionally share some insight into what’s being worked on at that moment.&lt;/p&gt;

&lt;p&gt;Finally,
I’m also thinking about using the blog to request feedback about various things,
like usage of existing features,
what simulators and operating system are most used,
prototypes for new features,
etc.
Since I don’t have access to all SystemVerilog simulators,
I might also ask for help with testing the project on the ones I can’t run myself.&lt;/p&gt;

&lt;p&gt;Stay tuned for the first real post!&lt;/p&gt;</content><author><name>Tudor Timi</name></author><summary type="html">Every now and then, I find myself wanting to do various announcements related to SVUnit. I’ve been using LinkedIn and Twitter, but these aren’t really the ideal platforms for this. A blog is much better.</summary></entry></feed>