package EVENT_PACKAGE is type EVENT is (increment,restart); type INTARRAY is array (POSITIVE range <>) of INTEGER; function ONLYONE(input:INTARRAY) return INTEGER; subtype RESOLVEDINT is ONLYONE INTEGER; end EVENT_PACKAGE; package body EVENT_PACKAGE is function ONLYONE(input:INTARRAY) return INTEGER is begin -- return input(input'low); return input(input'high); end ONLYONE; end EVENT_PACKAGE; use work.EVENT_PACKAGE.all; entity COUNTER is port(inputevent:EVENT); end COUNTER; architecture EVENTDRIVEN of COUNTER is signal count:RESOLVEDINT register :=0; begin COUNTER_BLOCK:block(inputevent=increment) begin count<= guarded count+1 after 5ns; end block; INTERRUPT_BLOCK:block(inputevent=restart) begin count<= guarded 0; end block; end EVENTDRIVEN; use work.EVENT_PACKAGE.all; entity vED is end vED; architecture SIMPLE of vED is signal ev:EVENT; component COUNTER port(inputevent:EVENT); end component; for iC:COUNTER use entity work.COUNTER(EVENTDRIVEN); begin iC:COUNTER port map(ev); vP:process begin ev<= increment, restart after 40 ns, increment after 50ns, restart after 120ns; wait; end process; end SIMPLE;