Altera_Forum
Honored Contributor
15 years agosopc builder custom component and passing parameters to VHDL package
I have written a custom SOPC builder component in VHDL.
Right now I have SOPC builder auto-generating a package that contains custom type definitions that are used throughout my custom SOPC builder component. These type definitions are based on the settings input by the user in the SOPC builder GUI. This package is then included in each of the VHDL files of my custom component using the construct: library work; use work.custom_package.all; Now, the problem with this formulation is that I can only have one instance of the component in my sopc system. Does anyone have a workaround for this, where I can generate multiple unique package files, each one associated with a particular instantiation of my custom VHDL component? In a perfect world, I might be able to use VHDL 2008 constructs which allow for passing custom types as generic parameters on a component. Quartus and SOPC do not support this. Another intractable solution would be to remove all the custom types which are used all throughout my custom component and use generic parameters and std_logic_vectors types all the way through the project. At this point the component is too complex to try and remove all of the custom types and replace them with standard types (whose bitwidths, etc would be set via generics). A third undesirable workaround would involve auto-generating every single VHDL file used in my component and passing the name-decorated version of my custom package to a VHDL generation script which could then generate a customized, name-decorated version of each VHDL file needed for my component. This is kind of a nasty and inelegant way of doing what I want. What I would like to be able to do is have two instances of my custom component in my sopc system. Let's call them Custom1 and Custom2. My custom_component_hw.tcl script could then generate two unique VHDL packages associated with each instantiation. It would generate Custom1_Package.vhd and Custom2_Package.vhd. Is there a way to associate Custom1_Package.vhd with one instance of all of my custom VHDL source files and associate Custom2_Package.vhd with a second instance of them. I would prefer to not have to write a complex code generator script to allow for this.