(Leave this as-is, it’s a trap!)

To delete this thread, and all replies to it, you must be either the original author or a designated moderator.

Problems + workarounds with the current (2019-04-23) mega65-core



I have tried building the mega65-core today (2019-04-23) and I've ran into some problems while running "make" in mega65-core "develpment" branch, commit 29b952e.

TL;DR I had to fix some build errors manually, mostly files not being in expected paths. I had to comment out the uart monitor support as I didn't know how to fix it, but finally got the bitstream file built and working. As a result, I can't use monitor_load, but can still program the board with fpgajtag.

My target is nexys4ddr.

Here are the problems I ran into:

1st failure:


Makefile:419: =============================================================
Makefile:419: ~~~~~~~~~~~~~~~~> Making: src/utilities/vfpgatest.prg
Ophis/bin/ophis -4 src/utilities/vfpgatest.a65 -l src/utilities/vfpgatest.list -m src/utilities/ -o src/utilities/vfpgatest.prg
src/utilities/vfpgatest.a65:417: Could not read ../../assets/vfpga-bitstream.bin
1 error
make: *** [src/utilities/vfpgatest.prg] Error 1


Indeed, I don't have that file in mega65-core/assets directory. These are the contents of that directory:


I've copied alphatest.bin to vfpga-bitstream.bin as it was the only file with the same extension. Not sure if that makes any sense in the long run, but it allowed the build to proceed.

2nd failure:


( cd src/verilog ; ../../iverilog/driver/iverilog -tvhdl -o ../../src/vhdl/uart_monitor.vhdl.tmp monitor_*.v asym_ram_sdp.v 6502_*.v UART_TX_CTRL.v uart_rx.v )
sh: /home/user/mega65-core/iverilog/lib/ivl/ivlpp: No such file or directory
sh: /home/user/mega65-core/iverilog/lib/ivl/ivl: No such file or directory
make: *** [src/vhdl/uart_monitor.vhdl.tmp] Error 127


There is no "lib" directory in mega65-core/iverilog. I see there are ivl and ivlpp binaries with paths mega65-core/iverilog/ivl and mega65-core/iverilog/ivlpp/ivlpp

So I manually symlinked the files to existing ones:

mkdir -p /home/user/mega65-core/iverilog/lib/ivl
ln -s /home/user/mega65-core/iverilog/ivlpp/ivlpp /home/user/mega65-core/iverilog/lib/ivl/ivlpp
ln -s /home/user/mega65-core/iverilog/ivl /home/user/mega65-core/iverilog/lib/ivl/ivl

Next error:


[user@localhost mega65-core]$ make
( cd src/verilog ; ../../iverilog/driver/iverilog -tvhdl -o ../../src/vhdl/uart_monitor.vhdl.tmp monitor_*.v asym_ram_sdp.v 6502_*.v UART_TX_CTRL.v uart_rx.v )
ERROR: Unable to read config file: /home/user/mega65-core/iverilog/lib/ivl/vhdl.conf


Again, seems to be looking for the vhdl.conf file in the wrong directory. Fixed with

ln -s /home/user/mega65-core/iverilog/tgt-vhdl/vhdl.conf /home/user/mega65-core/iverilog/lib/ivl/vhdl.conf

I think the build process expects iverilog to be manually installed in (with configure/make/make install), and doesn't work as expected when it's just compiled in the submodule dir. Manually symlinking stuff seems to work.

Then I got stuck at:


( cd src/verilog ; ../../iverilog/driver/iverilog -tvhdl -o ../../src/vhdl/uart_monitor.vhdl.tmp monitor_*.v asym_ram_sdp.v 6502_*.v UART_TX_CTRL.v uart_rx.v )
monitor_top.v:176: error: Unknown module type: monitormem
2 error(s) during elaboration.
*** These modules were missing:
monitormem referenced 1 times.
make: *** [src/vhdl/uart_monitor.vhdl.tmp] Error 2


And here I ran out of ideas. I don't know what the monitormem module type is and what should provide support for it. The only files where it is referenced at all are that monitor_top.v and the main Makefile. Maybe I need a different version of iverilog? I don't see a mention of monitormem there even in the master branch.

Not knowing what to do, I just commented out that monitormem line in monitor_top.v:176

After that I got more complaints about non-existing files, fixed with

ln -s /home/user/mega65-core/iverilog/tgt-vhdl/vhdl.conf /home/user/mega65-core/iverilog/lib/ivl/vhdl.conf
ln -s /home/user/mega65-core/iverilog/tgt-vhdl/vhdl.tgt /home/user/mega65-core/iverilog/lib/ivl/vhdl.tgt

Next, ran into this:


make[1]: Entering directory `/home/user/mega65-core/src/mega65-fdisk'
cc -o asciih asciih.c
asciih.c: In function ‘main’:
asciih.c:6:3: error: ‘for’ loop initial declarations are only allowed in C99 mode


I guess it's because I'm running this on Centos 7.6 which comes with gcc4.

Added -std=c99 to mega65-core/src/mega65-fdisk/Makefile:45

With that the build process continued and finally started building stuff with Vivado.

Next, I got some errors like nexys4.vhdl not having declared miso_2 input, but all I really needed was the nexys4ddr target so from then on I went with

make bin/nexys4ddr.mcs

and finally it built!

uploaded it to nexys4 with fpgajtag and it worked.

Would be nice to have the monitor working though since I'm more interested in software development. I'm only a beginner at hardware programming and contributing to the hardware design is beyond my ability at this point.


Your friendly neighbourhood moderators: Deft, gardners, Ralph Egas