1
votes

During mixing VDHL and Verilog I came across a problem with case sensitivity.

The parameter "APB_ADDR" is written in upper case and the wire "apb_addr" in lower case. Since Verilog is case sensitive it can differ between the two expressions.

module verilog_module #(
...
parameter APB_ADDR              = 32,
...
) (
...
input   wire    [APB_ADDR-1:0]  apb_addr,
input   wire                    apb_sel,
input   wire                    apb_enable,
input   wire                    apb_write
....
);

Now I want to instantiate the module in VDHL:

inst0: entity work.verilog_module 
GENERIC MAP (
    APB_ADDR => APB_ADDR_WIDTH
)
PORT MAP(
    ...
    apb_addr => apb_addr,
    ...
);

Synthesis fails. The generic "apb_addr" is not know. VHDL has no case sensitivity.

How can I access the generic APB_ADDR? I don't want to change the IP core written in Verilog.

1
It's a name clash. Rename either the generic or the port - in the IP core. As the address bus is an address bus, its name is appropriate. But the generic is a width, so its name is inappropriate and confusing anyway. So I'd rename it APB_ADDR_WIDTH. - user_1818839
So, there is no other solution than modifying the IP core? - Timm
You could ignore the generic altogether. As far as I can see, it's redundant. Derive its value from the apb_addr port attributes, and hope that whoever wrote the parts you want to leave alone, kept the generic and bus correctly in step. - user_1818839

1 Answers

4
votes

If you are unable to change the IP core, another option is to create a wrapper (in Verilog) that instanciates the core, sets the APB_ADDR parameter, and passes apb_addr and the other signals between the core and your VHDL entity.