Skip to content

Convert VHDL package to Verilog or SV #168

@jabate-anova

Description

@jabate-anova

I have VHDL package files in my current directory which I'd like to convert to Verilog or SV using hdlConvertor. Is this possible?

As in the notebook example, I'm able to use visit_HdlContext(d) to display a VHDL package:

from hdlConvertor import HdlConvertor
from hdlConvertorAst.to.vhdl.vhdl2008 import ToVhdl2008

TEST_DIR = os.path.join("./")
filenames = [os.path.join(TEST_DIR, "axis_pkg.vhd"), ]
include_dirs = []
c = HdlConvertor()
d = c.parse(filenames, Language.VHDL, include_dirs, hierarchyOnly=False, debug=True)
to_vhdl = ToVhdl2008(sys.stdout) 
to_vhdl.visit_HdlContext(d) 

I see that the hdlConvertorAst.translate module may be able to help me, but I'm not sure how to proceed. If I import VHDL to verilog (from hdlConvertorAst.translate import vhdl_to_verilog), how could I use vhdl_to_verilog.link_module_dec_def(context) with my parsed VHDL?

Any help is appreciated, thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions