Altera_Forum
Honored Contributor
16 years agoIO-Port switching using VHDL
Hello,
i have a VHDL-Project (Quartus II 9.1) wich has 96 Outputs. Every Output can be switched on/off by several entities. Every Entity wich can switch one or more Ports has a process like this: PROCESS (reset_I, clk_I) VARIABLE Port_unsigned : unsigned(7 DOWNTO 0); BEGIN IF reset_I = '1' THEN DIO_Set_O <= (OTHERS => '0'); DIO_Reset_O <= (OTHERS => '0'); ELSIF rising_edge(clk_I) THEN IF clear_config_I = '1' THEN DIO_Set_O <= (OTHERS => '0'); DIO_Reset_O <= (OTHERS => '0'); ELSE FOR i IN 1 TO nbr_of_Ports LOOP Port_unsigned := unsigned(Port_nbrs_I(i)); IF Port_values_I(i) = '1' THEN DIO_Set_O(CONV_INTEGER(Port_unsigned)) <= '1'; DIO_Reset_O(CONV_INTEGER(Port_unsigned)) <= '0'; ELSE DIO_Set_O(CONV_INTEGER(Port_unsigned)) <= '0'; DIO_Reset_O(CONV_INTEGER(Port_unsigned)) <= '1'; END IF; END LOOP; END IF; END IF; END PROCESS; Port_nbrs is the numer of the Port 1...96 to switch. nbr_of_IOs is 96 nbr_of_ports depends on the entity. Some entities have only on Port to switch, others have 2 or more. All the DIO_Set and DIO_Reset Outputs of all entities who have the process above are connected to a OR with 96 x# entites inputs and 96 outputs. After that they are connected to 96 Flip-Flops (SR), so that every entitiy can switch every Port on / off. Is there a better way to do the port-switching? I have to minimize the area of my design... Thanks in advance Paddy