Forum Discussion
Altera_Forum
Honored Contributor
10 years agoTricky
I don't quite follow. I'm assuming the node name needs to be set to address the bits since the interface does not have a wire symbol. https://www.alteraforum.com/forum/attachment.php?attachmentid=12011 What would I name CntModout to access q[0] for example. Do I have to do something in the symbol file? Thanks...Roger50310 LIBRARY ieee; USE ieee.std_logic_1164.all; LIBRARY lpm; USE lpm.all; ENTITY CntMod4 IS PORT ( clock : IN STD_LOGIC ; cnt_en : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (2 DOWNTO 0) ); END CntMod4; ARCHITECTURE SYN OF cntmod4 IS SIGNAL sub_wire0 : STD_LOGIC_VECTOR (2 DOWNTO 0); COMPONENT lpm_counter GENERIC ( lpm_direction : STRING; lpm_modulus : NATURAL; lpm_port_updown : STRING; lpm_type : STRING; lpm_width : NATURAL ); PORT ( clock : IN STD_LOGIC ; cnt_en : IN STD_LOGIC ; q : OUT STD_LOGIC_VECTOR (2 DOWNTO 0) ); END COMPONENT; BEGIN q <= sub_wire0(2 DOWNTO 0); LPM_COUNTER_component : LPM_COUNTER GENERIC MAP ( lpm_direction => "UP", lpm_modulus => 4, lpm_port_updown => "PORT_UNUSED", lpm_type => "LPM_COUNTER", lpm_width => 3 ) PORT MAP ( clock => clock, cnt_en => cnt_en, q => sub_wire0 ); END SYN;