Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant have multiple Instances of Custom VHDL core #2107

Open
Haron123 opened this issue Oct 26, 2024 · 1 comment
Open

Cant have multiple Instances of Custom VHDL core #2107

Haron123 opened this issue Oct 26, 2024 · 1 comment

Comments

@Haron123
Copy link

The Error Message i get is

own_periphs/uart/UART_1.v:1: ERROR: Re-definition of module `$abstract\uart_clk_div_17_1'!

When i try to instantiate multiple of the same cores, in the Target file i defined them like this:

self.uart_logging = CustomUart(self.platform, platform.request("uart_logging"), sys_clk_freq, 115200)
self.irq.add("uart_logging", use_loc_if_exists=True)

self.uart_ice40 = CustomUart(self.platform, platform.request("uart_ice40"), sys_clk_freq, 115200)
self.irq.add("uart_ice40", use_loc_if_exists=True)

The VHDL To Verilog conversion looks like this

# Convert to Verilog
self.vhd2v_converter = VHD2VConverter(platform,
	top_entity = "UART",
	build_dir = os.path.abspath(os.path.dirname(__file__)),
	params = self.parameters,
	force_convert = True,
	add_instance = True,
	work_package = "uart",
)

self.sources_path = os.path.abspath(os.path.dirname(__file__)) + "/comp/";

self.sources = [
	# uart.vhd
	"uart.vhd",

	# comp
	"uart_debouncer.vhd",
	"uart_parity.vhd",
	"uart_rx.vhd",
	"uart_tx.vhd",
	"uart_clk_div.vhd",
]

self.vhd2v_converter.add_sources(self.sources_path, *self.sources)

Does anyone know what could cause it?

Debug Attempts:

I know that it works when i only use one VHDL File, so it seems to be an issue with converting multiple VHDL Files. I looked into the VHD2V Code and apparently it only renames the TOP Entity, i didnt manage to change the code to rename it when theres multiple subentities.

Thanks in advance for any attempts to help.

@Haron123
Copy link
Author

Haron123 commented Nov 2, 2024

Im still stuck on this, does anybody know what could cause it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant