Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to Instantiate a VHDL entity in verilog module ?

Status
Not open for further replies.

blooz

Advanced Member level 2
Joined
Dec 29, 2010
Messages
560
Helped
121
Reputation
242
Reaction score
116
Trophy points
1,343
Location
India
Activity points
4,985
How can we instantiate a VHDL entity inside a verilog module .I am using Active HDL..
 

You just have to instanciate module header that would be semantically the same as VHDL entity. When the VHDL module is added to project and you want to use it inside Verilog module, you simply imagine that VHDL component is written in Verilog and use it as if it actually is.
 

And pray that there is no array in your VHDL code because verilog don't yet support array on inputs and outputs.
 

Yes Alexium is right, just treat your VHDL enitity declaration as if it is a verilog module declaration. and do the same instantiation as in for verilog modules.
 

High there

If the VHDL component has generics, Does the generic mapping work inside a verilog module

simply MyFile.vhd is a generic VHDL entity instantiated inside MyTop.v ... Does the generic mapping of MyFile.vhd inside MyTop.v work ?


thanks in advance
 

If the VHDL component has generics, Does the generic mapping work inside a verilog module

yes it works. I'm using this in a current project.

Just assign the generics as if they were parameters in a Verilog module.
 

Some tools, e.g. ModelSim are restricted to old #( ) parameter style instead of newer defparam syntax.
 

Some tools, e.g. ModelSim are restricted to old #( ) parameter style instead of newer defparam syntax.

You have that backwards....

defparam was defined in Verilog-95 they added #( ) syntax in Verilog-2001. You can still use or abuse defparam in Verilog-2001.

I started using #( ) syntax when the Xilinx tools started supporting it (after lots of complaining by me an a lot of other engineers)

-alan
 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
You see that I'm not primarly using Verilog, I suppose you are right, thanks for clarifying things.

I wonder however, why ModelSim didn't accept defparam in mixed language projects, so that I needed to change existing code.
 

Thanks! In fact defparam is still supported in Modelsim, which is necessary at least as a legacy measure. But for some reason, not in mixed language designs, when instantiating VHDL components in Verilog text.
 

Thanks people, it really works for Xilinx ISE. Still have problems with modelsim !
Is there any workarounds for modelsim mixed language projects ?
I'm still not much experienced in verilog, I used only VHDL for 3 years.

Thanks in advance
 

Does your Modelsim license include mixed language simulation?
 

yes the #() works in modelsim. I've been using this syntax over many modelsim versions: 6.6e (may be an even earlier version, but that's the oldest I have installed) up to 10.1b.

Have you tried a simple test case? Something like a VHDL register with a generic width and instantiate it in a Verilog top level?

-alan
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top