t-crest / patmos

Patmos is a time-predictable VLIW processor, and the processor for the T-CREST project
http://patmos.compute.dtu.dk
BSD 2-Clause "Simplified" License
134 stars 72 forks source link

Patmos emulator fails to build with Verilator >= 4.212 #106

Open michael-platzer opened 2 years ago

michael-platzer commented 2 years ago

Patmos emulator fails to build with recent versions of Verilator (tested with 4.212 and 4.214). misc/build.sh patmos produces following error:

g++  -I.  -MMD -I/usr/share/verilator/include -I/usr/share/verilator/include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow     -Wno-undefined-bool-conversion -O1 -DTOP_TYPE=VPatmos -DVL_USER_FINISH -include VPatmos.h  -DVL_THREADED -std=c++17  -c -o VPatmos__Trace__4__Slow.o VPatmos__Trace__4__Slow.cpp
echo "" > VPatmos__ALL.verilator_deplist.tmp
../Patmos-harness.cpp: In member function ‘void Emulator::emu_uart(int, int)’:
../Patmos-harness.cpp:191:12: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Cmd’
  191 |     if (c->Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Cmd == 0x1
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:192:16: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Addr’
  192 |         && (c->Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Addr & 0xff) == 0x04) {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:193:28: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Data’
  193 |       unsigned char d = c->Patmos__DOT__UartCmp__DOT__uart__DOT__uartOcpEmu_Data;
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:201:25: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__tx_baud_tick’
  201 |     bool baud_tick = c->Patmos__DOT__UartCmp__DOT__uart__DOT__tx_baud_tick;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:216:16: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__rx_state’
  216 |             c->Patmos__DOT__UartCmp__DOT__uart__DOT__rx_state = 0x3; // rx_stop_bit
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:217:16: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__rx_baud_tick’
  217 |             c->Patmos__DOT__UartCmp__DOT__uart__DOT__rx_baud_tick = 1;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:218:16: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__rxd_reg2’
  218 |             c->Patmos__DOT__UartCmp__DOT__uart__DOT__rxd_reg2 = 1;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../Patmos-harness.cpp:219:16: error: ‘class VPatmos’ has no member named ‘Patmos__DOT__UartCmp__DOT__uart__DOT__rx_buff’
  219 |             c->Patmos__DOT__UartCmp__DOT__uart__DOT__rx_buff = d;
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-undefined-bool-conversion’ may have been intended to silence earlier diagnostics

Downgrading to Verilator 4.200 fixes the problem.

schoeberl commented 2 years ago

Mmh, this looks to me like a naming convention changed. We are accessing Verilator generated signals (C variables). If it is only the UART we might do something in a not so good style.