test-verilog FileNotFoundError

29 views
Skip to first unread message

David Peng

unread,
Apr 25, 2023, 8:40:57 AM4/25/23
to pymtl-users
Hi, Yanghui/Peitian,

I encountered FileNotFoundError when I added --test-verilog to pytest of SortUnitFRTL. Before adding --test-verilog, the test runs successfully with vcd file generated.

I followed all steps in tutorial 5745 to this point, except that I didn't write sort_sim to combine FL/CL/RTL in one. Actually I didn't understand why I need this sort_sim. I just used function test_sort_frtl_random which instantiated model of SortUnitFRTL with random stimulus.

My command is:

% pytest ../test/sort_test.py -k sort_frtl_random -s --dump-vcd --test-verilog



And the error is:

s = <pymtl3.passes.backends.verilog.import_.VerilogVerilatorImportConfigs.VerilogVerilatorImportConfigs object at 0x102a4dcc8>


    def _get_c_src_files( s ):

      top_module = s.translated_top_module

      vl_mk_dir = s.vl_mk_dir

      vl_class_mk = f"{vl_mk_dir}/V{top_module}_classes.mk"

    

      # Add C wrapper

      o0 = []

      o1 = copy.copy(s.c_srcs) + [ s.get_c_wrapper_path() ]

    

      # Add files listed in class makefile

>     with open(vl_class_mk) as class_mk:

E     FileNotFoundError: [Errno 2] No such file or directory: 'obj_dir_SortUnitFRTL__nbits_8/VSortUnitFRTL__nbits_8_classes.mk'


../../../.pyenv/versions/3.7.16/lib/python3.7/site-packages/pymtl3/passes/backends/verilog/import_/VerilogVerilatorImportConfigs.py:392: FileNotFoundError


I checked obj_dir_SortUnitFRTL__nbits_8, there is *classes.mk file with slightly different name:

build % ls -l obj_dir_SortUnitFRTL__nbits_8 

total 208

-rw-r--r--  1 davidpeng  staff   5878 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8.cpp

-rw-r--r--  1 davidpeng  staff   3264 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8.h

-rw-r--r--  1 davidpeng  staff   1613 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8.mk

-rw-r--r--  1 davidpeng  staff    914 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__Syms.cpp

-rw-r--r--  1 davidpeng  staff   1277 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__Syms.h

-rw-r--r--  1 davidpeng  staff   5252 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__Trace__0.cpp

-rw-r--r--  1 davidpeng  staff   8700 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__Trace__0__Slow.cpp

-rw-r--r--  1 davidpeng  staff   2165 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root.h

-rw-r--r--  1 davidpeng  staff  14216 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root__DepSet_h8a592a66__0.cpp

-rw-r--r--  1 davidpeng  staff  12381 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root__DepSet_h8a592a66__0__Slow.cpp

-rw-r--r--  1 davidpeng  staff   1166 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root__DepSet_ha098f7dc__0.cpp

-rw-r--r--  1 davidpeng  staff   1053 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root__DepSet_ha098f7dc__0__Slow.cpp

-rw-r--r--  1 davidpeng  staff    878 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8___024root__Slow.cpp

-rw-r--r--  1 davidpeng  staff   1265 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__ver.d

-rw-r--r--  1 davidpeng  staff   2866 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8__verFiles.dat

-rw-r--r--  1 davidpeng  staff   1902 Apr 25 15:51 VSortUnitFRTL___05Fnbits_8_classes.mk


I used tutorial's example python codes to generate SortUnitFlatRTL__nbits_8__pickled.v successfully. Seems everything good.


My sort_test is attached. Any suggestions?


Thanks,


David




sort_test.py

Christopher Batten

unread,
Apr 25, 2023, 11:56:28 AM4/25/23
to David Peng, pymtl-users


Hmmm ... that 05f in the file name looks very strange? That should not be in the filename. What OS an Python version are you using?

It obviously looks like you have Verilator installed correctly so that is good ...

Best,
Chris

--
You received this message because you are subscribed to the Google Groups "pymtl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymtl-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/b4387c3f-c229-4852-b920-65d2c16977a0n%40googlegroups.com.
<sort_test.py>

Peitian Pan

unread,
Apr 25, 2023, 3:43:25 PM4/25/23
to pymtl-users
Hi David,

It could be a Verilator version mismatch issue.. As a temporary workaround, can you try installing Verilator <= 4.026 and see if that works? We added support to newer versions of verilator in a feature branch of pymtl3 but it's not yet released.. We will release that soon though.


Peitian

David Peng

unread,
Apr 26, 2023, 10:13:15 AM4/26/23
to Peitian Pan, pymtl-users
Hi, Peitian,

Yes, that's the root cause.

I installed Verilator v4.026 and the issue was gone. When will you please to release this feature?

Thanks,

David

--
You received this message because you are subscribed to a topic in the Google Groups "pymtl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pymtl-users/gIoRkOLhWsM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pymtl-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/49b6e174-95c7-44eb-96fa-bbfb5fd8278en%40googlegroups.com.

Christopher Batten

unread,
Apr 26, 2023, 11:37:02 AM4/26/23
to David Peng, Peitian Pan, pymtl-users
Hi David,

We will probably do an update this summer with some new features and support for the most recent version of Verilator ...

Best,
Chris

You received this message because you are subscribed to the Google Groups "pymtl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pymtl-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pymtl-users/CAGk8AqD1MVPDLUu__gMBDoWn1G_nbrYyqYeeqXJuD%2B9n1%2BwCKg%40mail.gmail.com.

David Peng

unread,
Apr 26, 2023, 9:18:12 PM4/26/23
to pymtl-users
Hi, Dear Chris,

Do you have a mailer to announce release?

Thanks,
David

Christopher Batten

unread,
Apr 26, 2023, 9:31:41 PM4/26/23
to David Peng, pymtl-users
We will probably post on this list but you can of course still use PyMTL with the older version of verilator. We have been using the older version in our teaching and research and it works fine. -c

Sent from my iPhone

On Apr 26, 2023, at 9:18 PM, David Peng <davi...@gmail.com> wrote:


Reply all
Reply to author
Forward
0 new messages