olofk / fusesoc

Package manager and build abstraction tool for FPGA/ASIC development
BSD 2-Clause "Simplified" License
1.17k stars 242 forks source link

Modelsim with Cocotb [new flow] #676

Open sebinho opened 6 months ago

sebinho commented 6 months ago

Hi @olofk,

I have been successfully using fusesoc with Modelsim and cocotb for a while now. I wanted to update my core files to reflect the latest changes in edalize for cocotb support. But it does not seem to work with Modelsim. Here is my example core file.

CAPI=2:
name: test:i2c:0
description: test lib for I2C

filesets:
    vhdl_files:
        files:
            - hdl/i2c_slave.vhd
        file_type: vhdlSource-2008

    sim:
        files:
            - sim/i2c_slave_tb.py:              {file_type : user, copyto : .}

targets:

    sim:
        filesets: [vhdl_files, sim]
        toplevel: i2c_slave
        flow: sim
        flow_options:
            tool: modelsim
            cocotb_module: i2c_slave_tb

I get the following error on the command line:

> fusesoc run --target=sim test:i2c:0:0
INFO: Preparing test:i2c:0:0
ERROR: Setup failed : Could not find tool 'modelsim'

Do you know what I am doing wrong? Thanks for your help

sebinho commented 6 months ago

From what I could gather, there isn't yet a modelsim.py description in the edalize/tools folder. I suppose this is due to the migration from tool to flow approach. I will see if I can make the required changes.

sebinho commented 6 months ago

I am not very familiar with the internals of edalize, so it might take more time than I anticipated. @olofk any idea how much work it would be for you to add Modelsim support in the new flow approach?