I’ve got several .sv files that need to be put into a single library (probably a .so or .a file), for example a directory that has the following .sv files:
control.sv hotstate.sv microcode.sv next_address.sv stack.sv
switch.sv test_gen.sv timer.sv variable.sv
The hotstate.sv file is the toplevel file here as it instantiates modules from all the others.
I tried to compile with the following verilator command line:
$ verilator –protect-lib hotstate -Wno-fatal –cc -Mdir
obj_dir_hotstate/ control.sv microcode.sv next_address.sv stack.sv
timer.sv variable.sv switch.sv hotstate.sv
However, the files that are created in obj_dir_hotstate don’t seem to include anything but output for control.sv, here’s the file listing:
hotstate.cpp hotstate.sv Vcontrol_classes.mk Vcontrol.cpp Vcontrol.h
Vcontrol__idmap.xml Vcontrol.mk Vcontrol__pch.h
Vcontrol_PScpt0__DepSet_h0d9d8c4c__0.cpp
Vcontrol_PScpt0__DepSet_h0d9d8c4c__0__Slow.cpp
Vcontrol_PScpt0__DepSet_h7c3873b2__0.cpp
Vcontrol_PScpt0__DepSet_h7c3873b2__0__Slow.cpp Vcontrol_PScpt0.h
Vcontrol_PScpt0__Slow.cpp Vcontrol_PSvGIS.cpp Vcontrol_PSvGIS.h
Vcontrol__ver.d Vcontrol__verFiles.dat
Do I need to run verilator separately for each .sv file in the directory to generate a .a file for each of them and then someone (not quite sure how at this point) all those .a files get gathered into a single libhotstate.so ? (seems cumbersome)
I’m trying to use the veriltor example from verilator/examples/make_protect_lib as an example for doing this, but that example only contains one toplevel file (top.v) and one file that serves to create a libverilated_secret.a file.