nickg / nvc

VHDL compiler and simulator
https://www.nickg.me.uk/nvc/
GNU General Public License v3.0
635 stars 80 forks source link

Crash writing waveforms #524

Closed amb5l closed 2 years ago

amb5l commented 2 years ago

Windows/MSYS2, NVC commit 71d5882

Enabling waveform output during simulation causes an exception:

==========

Note: writing FST waveform data to tb_np6532_poc_128k_digilent_nexys_video.fst Warning: cannot represent type REAL in FST format

D:/devtools/Xilinx/Vivado/2022.1/data/vhdl/src/unisims/primitive/MMCME2_ADV.vhd:699 | 699 | signal CLKFBOUT_MULT_F_RND : real := real(real2int((CLKFBOUT_MULT_F + 0.0625) * 8.0))/ 8.0; | ^^^^^^^^^^^^^^^^^^^

Caught exception c0000005 (EXCEPTION_ACCESS_VIOLATION) [address=000000000000000f, ip=00007ff6645d75f9]

[00007ff6645467a4] [00007ffcaca263c1] UnhandledExceptionFilter+0x1f1 [00007ffcaf24b06c] memset+0x2ec [00007ffcaf233f76] _C_specific_handler+0x96 [00007ffcaf248fcf] _chkstk+0x12f [00007ffcaf1d5e9a] RtlRestoreContext+0x8aa [00007ffcaf247fde] KiUserExceptionDispatcher+0x2e [00007ff6645d75f9] test_net_event+0x39e9 [00007ff6645d7f15] test_net_event+0x4305 [00007ff6645d7f63] test_net_event+0x4353 [00007ff6645d7f63] test_net_event+0x4353 [00007ff6645d7f63] test_net_event+0x4353 [00007ff6645d0402] [00007ff6645db00b] nvc_current_delta+0x169b [00007ff6645d4725] test_net_event+0xb15 [00007ff66454290f] [00007ff664622e72] vhpi_put_data+0x23982 [00007ff6645413ae] [00007ff6645414e6] [00007ffcae8d54e0] BaseThreadInitThunk+0x10 [00007ffcaf1a485b] RtlUserThreadStart+0x2b

==========

To reproduce this, use the latest commit from https://github.com/amb5l/tyto2 and run the following in build/np6532_poc_128k_digilent_nexys_video:

make nvc_elaborate nvc --std=08 -M 32m -r tb_np6532_poc_128k_digilent_nexys_video --wave

nickg commented 2 years ago

I've fixed the crash and also added FST dumping for real-valued signals.