You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
Sorry, I am seeing this issue just now, there are may people asking the same and the response is:
In some cases it is possible but it generic case it is not. It also depends on what you are expecting.
There are construct in VHDL which does not have equivalent in SV.
And there many builtin functions/data types. Translation of many elements does need full implementation of VHDL typesystem, builtins and std library. All this is ridiculous amount of work.
I did several translations of commercial projects. I recommend this:
Use hdlConvertor to parse VHDL AST, and hdlConvertor/hdlConvertorAst to print verilog. There are several translation helpers in
hdlConvertorAst.translate but they are not complete and you will need to implement things which are used in your code.
This is the same question I was about to ask. I can't find any examples that produce valid verilog starting from even trivial VHDL. Can we produce a working python example from any of the 'cases' that are possible? Just as a starting point? And maybe a trivial working example that uses hdlConvertorAst.translat.vhdl_to_verilog?
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: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 usevhdl_to_verilog.link_module_dec_def(context)
with my parsed VHDL?Any help is appreciated, thanks!
The text was updated successfully, but these errors were encountered: