question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modelsim 32-bit invalid ELF header

See original GitHub issue

Just updated my local cocotb installation from git and ran into an issue:

System:

Adder example ouput:

make results.xml
make[1]: Entering directory `/home/cocotb/examples/adder/tests'
set -o pipefail; MODULE=test_adder TESTCASE= TOPLEVEL="work.adder" \
GPI_EXTRA= TOPLEVEL_LANG=verilog \
/data/tools/intelFPGA_pro/20.3/modelsim_ase/linux/vsim -c  -do sim_build/runsim.do  2>&1 | tee sim_build/sim.log
Reading pref.tcl

# 2020.3

# do sim_build/runsim.do
# Model Technology ModelSim - Intel FPGA Edition vmap 2020.3 Lib Mapping Utility 2020.07 Jul 22 2020
# vmap -c 
# ** Warning: vmap will not overwrite local modelsim.ini.
# Model Technology ModelSim - Intel FPGA Edition vmap 2020.3 Lib Mapping Utility 2020.07 Jul 22 2020
# vmap work sim_build/work 
# Modifying modelsim.ini
# Model Technology ModelSim - Intel FPGA Edition vlog 2020.3 Compiler 2020.07 Jul 22 2020
# Start time: 16:34:55 on Feb 05,2021
# vlog -work work "+define+COCOTB_SIM" -sv -timescale 1ns/1ps -mfcu "+acc" /home/cocotb/examples/adder/tests/../hdl/adder.sv 
# -- Compiling module adder
# 
# Top level modules:
#   adder
# End time: 16:34:55 on Feb 05,2021, Elapsed time: 0:00:00
# Errors: 0, Warnings: 0
# vsim -onfinish exit -pli "/home/cocotb/cocotb/libs/libcocotbvpi_modelsim.so" sim_build/work.adder 
# Start time: 16:34:55 on Feb 05,2021
# Loading sv_std.std
# Loading sim_build/work.adder
# Loading /home/cocotb/cocotb/libs/libcocotbvpi_modelsim.so
#      -.--ns ERROR    cocotb.gpi                         ..s/cocotb_utils.cpp:69   in utils_dyn_open                  Unable to open lib /home/.conda/envs/py3_32/lib/libpython3.7m.a: /home/.conda/envs/py3_32/lib/libpython3.7m.a: invalid ELF header
#      -.--ns INFO     cocotb.gpi                         ../gpi/GpiCommon.cpp:105  in gpi_print_registered_impl       VPI registered
# End time: 16:34:55 on Feb 05,2021, Elapsed time: 0:00:00
# Errors: 0, Warnings: 0
ERROR: results.xml was not written by the simulation!
make[1]: *** [results.xml] Error 1
make[1]: Leaving directory `/home/cocotb/examples/adder/tests'
make: *** [sim] Error 2

Also tried some older cocotb version (which gives the same error as in the log above): 331b879e39c587e94837f73eb05f73c04ec20c6e

This is the most recent cocotb version that runs adder example on modelsim without issues: 50418e54f000316257404134a57557ffb877e2c8

Any suggestions? Thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
elgorwicommented, Feb 7, 2021

Thanks for the patch @ktbarrett. Just tried it and everything seems to be working on my system.

1reaction
themperekcommented, Feb 7, 2021

Could you try out this change in cocotb/_vendor/find_libpython/init.py? ktbarrett/find_libpython@95c37b3

For me, it seems to work with this change.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linux/ModelSim: can't access Tools > Edit preferences
This file does actually exist, and is as expected (a 32-bit .so), so the error is presumably a tcl failure of some sort...
Read more >
Error: invalid ELF file, only 32bits files are supported
Error: invalid ELF file, only 32bits files are supported embedded:startup.tcl:486: Error: ** Programming Failed **.
Read more >
Loading a ELF file to Microblaze mem on ModelSim
There is no file association for the ELF file in Modelsim. If the simulation is run with an ELF file there has to...
Read more >
ModelSim SE User's Manual
Using 64-bit ModelSim with 32-bit PLI/VPI/DPI Applications . ... work/systemc.so: ELF file data encoding not little-endian.
Read more >
Lattice Software Known Issues (v3.1)
Functional simulation result incorrect in Lattice Logic Simulator 50. ORCA Series 3 shows in the Device Selector Dialog by error 51. ModelSim fails...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found