What compiler are you using?
If it's a C compiler, how about compiling each module separately and then linking them?
E.g.:
$ cc -c file1.c
$ cc -c file2.c
$ cc -o output file1.o file2.o
What compiler are you using?
If it's a C compiler, how about compiling each module separately and then linking them?
E.g.:
$ cc -c file1.c
$ cc -c file2.c
$ cc -o output file1.o file2.o
Given that I mentioned Vivado, it's actually Verilog.
I've not used Vivado, but in all the other synthesis tools I've used a "syn_keep" directive ensures that something doesn't get optimised away. e.g.
wire iWantToSeeThis /* synthesis syn_keep */;
If it's not exactly that in Vivado, I'm sure there's a functional equivalent under another name.
A quick search seems to suggest (here (https://www.xilinx.com/support/answers/54699.html)) that in Vivado it's:
(* dont_touch = "true" *) <signal_name>;