Tricky,
Beauty is in the eye of the beholder I suppose. In some sense that is what I'm doing. The defaults for say altsynram from altera_mf_components.vhd are:
component altsyncram
generic (
address_aclr_a : string := "UNUSED";
address_aclr_b : string := "NONE";
address_reg_b : string := "CLOCK1";
byte_size : natural := 8;
byteena_aclr_a : string := "UNUSED";
byteena_aclr_b : string := "NONE";
byteena_reg_b : string := "CLOCK1";
clock_enable_core_a : string := "USE_INPUT_CLKEN";
clock_enable_core_b : string := "USE_INPUT_CLKEN";
clock_enable_input_a : string := "NORMAL";
clock_enable_input_b : string := "NORMAL";
clock_enable_output_a : string := "NORMAL";
clock_enable_output_b : string := "NORMAL";
intended_device_family : string := "unused";
ecc_pipeline_stage_enabled : string := "FALSE";
enable_ecc : string := "FALSE";c
implement_in_les : string := "OFF";
indata_aclr_a : string := "UNUSED";
indata_aclr_b : string := "NONE";
indata_reg_b : string := "CLOCK1";
init_file : string := "UNUSED";
init_file_layout : string := "PORT_A";
maximum_depth : natural := 0;
numwords_a : natural := 0;
numwords_b : natural := 0;
operation_mode : string := "BIDIR_DUAL_PORT";
outdata_aclr_a : string := "NONE";
outdata_aclr_b : string := "NONE";
outdata_reg_a : string := "UNREGISTERED";
outdata_reg_b : string := "UNREGISTERED";
power_up_uninitialized : string := "FALSE";
ram_block_type : string := "AUTO";
rdcontrol_aclr_b : string := "NONE";
rdcontrol_reg_b : string := "CLOCK1";
read_during_write_mode_mixed_ports : string := "DONT_CARE";
read_during_write_mode_port_a : string := "NEW_DATA_NO_NBE_READ";
read_during_write_mode_port_b : string := "NEW_DATA_NO_NBE_READ";
stratixiv_m144k_allow_dual_clocks : string := "ON";
width_a : natural;
width_b : natural := 1;
width_byteena_a : natural := 1;
width_byteena_b : natural := 1;
width_eccstatus : natural := 3;
widthad_a : natural;
widthad_b : natural := 1;
wrcontrol_aclr_a : string := "UNUSED";
wrcontrol_aclr_b : string := "NONE";
wrcontrol_wraddress_reg_b : string := "CLOCK1";
lpm_hint : string := "UNUSED";
lpm_type : string := "altsyncram"
);
port(
aclr0 : in std_logic := '0';
aclr1 : in std_logic := '0';
address_a : in std_logic_vector(widthad_a-1 downto 0);
address_b : in std_logic_vector(widthad_b-1 downto 0) := (others => '1');
addressstall_a : in std_logic := '0';
addressstall_b : in std_logic := '0';
byteena_a : in std_logic_vector(width_byteena_a-1 downto 0) := (others => '1');
byteena_b : in std_logic_vector(width_byteena_b-1 downto 0) := (others => '1');
clock0 : in std_logic := '1';
clock1 : in std_logic := '1';
clocken0 : in std_logic := '1';
clocken1 : in std_logic := '1';
clocken2 : in std_logic := '1';
clocken3 : in std_logic := '1';
data_a : in std_logic_vector(width_a-1 downto 0) := (others => '1');
data_b : in std_logic_vector(width_b-1 downto 0) := (others => '1');
eccstatus : out std_logic_vector(width_eccstatus-1 downto 0);
q_a : out std_logic_vector(width_a-1 downto 0);
q_b : out std_logic_vector(width_b-1 downto 0);
rden_a : in std_logic := '1';
rden_b : in std_logic := '1';
wren_a : in std_logic := '0';
wren_b : in std_logic := '0'
);
end component;
The code generated by the Wizard sets generics that differ from the default plus a few others. In my case:
altsyncram_component : altsyncram
GENERIC MAP (
address_reg_b => "CLOCK0",
clock_enable_input_a => "BYPASS",
clock_enable_input_b => "BYPASS",
clock_enable_output_a => "BYPASS",
clock_enable_output_b => "BYPASS",
indata_reg_b => "CLOCK0",
intended_device_family => "MAX 10",
lpm_type => "altsyncram",
numwords_a => 512,
numwords_b => 512,
operation_mode => "BIDIR_DUAL_PORT",
outdata_aclr_a => "NONE",
outdata_aclr_b => "NONE",
outdata_reg_a => "UNREGISTERED",
outdata_reg_b => "UNREGISTERED",
power_up_uninitialized => "FALSE",
read_during_write_mode_mixed_ports => "DONT_CARE",
read_during_write_mode_port_a => "NEW_DATA_WITH_NBE_READ",
read_during_write_mode_port_b => "NEW_DATA_WITH_NBE_READ",
widthad_a => 9,
widthad_b => 9,
width_a => 32,
width_b => 32,
width_byteena_a => 1,
width_byteena_b => 1,
wrcontrol_wraddress_reg_b => "CLOCK0"
)
PORT MAP (
address_a => std_logic_vector(address_a),
address_b => std_logic_vector(address_b),
clock0 => clock,
data_a => data_a,
data_b => data_b,
rden_a => rden_a,
rden_b => rden_b,
wren_a => wren_a,
wren_b => wren_b,
q_a => sub_wire0,
q_b => sub_wire1
);
I would find directly instantiating either one in my code (especially multiple times) to be quite ugly compared to:
timeslot_table1 : timeslot_table
generic map (
ADDR_BITS_A => TS_ADDR_BITS,
ADDR_BITS_B => TS_ADDR_BITS,
WIDTH_A => 32,
WIDTH_B => 32
)
PORT MAP (
address_a => indexa,
address_b => addrb,
clock => CLK,
data_a => dina,
data_b => (others => '0'),
rden_a => RE_a,
rden_b => RE_b,
wren_a => WE_a,
wren_b => '0',
q_a => douta,
q_b => doutb
);
It also lets me do mapping of ports to my preferred type (eg addresses are unsigned instead of std_logic_vector in this case).
Your point is well taken though. To each his own.