ZipCPU / zbasic

A bare bones, basic, ZipCPU system designed for both testing and quick integration into new systems
43 stars 6 forks source link

Verilator error while running make in rtl directory #9

Closed GreenMan-1 closed 2 years ago

GreenMan-1 commented 2 years ago

I was getting an error while running the verilator by the make that -Wno-TIMESCALEMOD is not a valid attribute. So I changed it to -Wno-lint, So the Makefile in RTL line number 53 was changed from VFLAGS = -Wall -Wno-TIMESCALEMOD --MMD -O3 --trace -Mdir $(VDIRFB) $(AUTOVDIRS) -cc to VFLAGS = -Wall -Wno-lint --MMD -O3 --trace -Mdir $(VDIRFB) $(AUTOVDIRS) -cc

After this change make completed successfully in the RTL directory

So is this OK??

ZipCPU commented 2 years ago

That's weird. I can't build without -Wno-TIMESCALEMOD. Also, I very much need the lint capabilities of Verilator. It would be better to remove -Wno-TIMESCALEMOD than to use -Wno-lint.

Which Verilator version are you using? What error were you getting?

Dan

GreenMan-1 commented 2 years ago

Hi Dan, I used Verilator version 3.916. If i dont use -Wno-lint . i am getting lint warning as mentioned below:

verilator -Wall --MMD -O3 --trace -Mdir ./obj_dir -y cpu -y wbubus -y sdspi -y rtc -y wbuart -cc main.v
%Warning-WIDTH: cpu/dcache.v:201: Input port connection 'i_addr' expects 25 bits on the pin connection, but pin connection's SEL generates 23 bits.
%Warning-WIDTH: Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.
%Error: Exiting due to 1 warning(s)
%Error: Command Failed /usr/local/bin/verilator_bin -Wall --MMD -O3 --trace -Mdir ./obj_dir -y cpu -y wbubus -y sdspi -y rtc -y wbuart -cc main.v
make: *** [Makefile:79: obj_dir/Vmain.h] Error 10
make: *** Deleting file 'obj_dir/Vmain.h'

Due to this lint error, the make didn't complete, but the lint warning was not so serious so i added -Wno-lint

and also if I use -Wno-TIMESCALEMOD I am getting the following error:

verilator -Wall -Wno-TIMESCALEMOD --MMD -O3 --trace -Mdir ./obj_dir -y cpu -y wbubus -y sdspi -y rtc -y wbuart -cc main.v
%Error: Unknown warning specified: -Wno-TIMESCALEMOD
%Error: Command Failed /usr/local/bin/verilator_bin -Wall -Wno-TIMESCALEMOD --MMD -O3 --trace -Mdir ./obj_dir -y cpu -y wbubus -y sdspi -y rtc -y wbuart -cc main.v
make: *** [Makefile:79: obj_dir/Vmain.h] Error 10
ZipCPU commented 2 years ago

Ok, got it. This is partially a version mismatch issue. Older versions of Verilator insist on TIMESCALEMOD. I'm currently working with a development version built off of 4.223, so that's responsible for at least part of the difference. If -Wno-lint works for you, then that could be a partial solution at least. I (personally) require -Wall simply because it helps me find bugs.

Dan

GreenMan-1 commented 2 years ago

Okay Thank you, Dan