Ok, another workaround needed for Quartus and Modelsim FPGA function library stupid bugs...
Here is what I have:
`ifdef Cyclone_II
localparam FPGA_FAMILY_altera_string_bug = "Cyclone II";
`elsif Cyclone_III
localparam FPGA_FAMILY_altera_string_bug = "Cyclone III";
`elsif Cyclone_IV_E
localparam FPGA_FAMILY_altera_string_bug = "Cyclone IV E";
`elsif Cyclone_IV_GX
localparam FPGA_FAMILY_altera_string_bug = "Cyclone IV GX";
`elsif Cyclone_10_LP
localparam FPGA_FAMILY_altera_string_bug = "Cyclone 10 LP";
`elsif Arria_II_GX
localparam FPGA_FAMILY_altera_string_bug = "Arria II GX";
`else
localparam FPGA_FAMILY_altera_string_bug = "MAX 10";
`endif
Because of the way the altera PLL accepts strings in it's parameters, I need to select one of the above parameters. However, I do have a source 'FPGA_FAMILY' parameter string coming into this module. Altera/Modelsim wont properly accept it even if it have the correct name inside the brackets. It needs me to set one of the above.
Is there a way to select one of those localparams based on my 'FPGA_FAMILY' parameter string or a `define?
NO:
localparam FPGA_FAMILY_altera_string_bug = FPGA_FAMILY ;
or
localparam string FPGA_FAMILY_altera_string_bug = FPGA_FAMILY ;
Will not work. This is the stupid altera megafunction string bug.
Only:
localparam FPGA_FAMILY_altera_string_bug = "Cyclone III";
will work. Even this will not work:
localparam string FPGA_FAMILY_altera_string_bug = "Cyclone III";
It is so F'ed up...
If you think this is bad, wait until we have to deal with Cyclone V's PLL which has numeric specifications with a scale in the parameters as strings. And that one is nothing like Lattice ECP5's PLL which requires numeric specifications inserted into the /* comments */ inside the PLL function call to properly compile. I don't have a clue how to deal with that BS.