-- -- VHDL Skeleton Generated from Production Based Synthesis Package (PBS) -- -- Copyright (c) 1991,1992 University of California, Santa Barbara. -- All rights reserved. -- library work; use work.mouse1_pak.all; entity mouse1 is port ( -- *********** port insert begin clock, xc, xd, reset : in BIT; xp : out INTEGER range 0 to 255 -- *********** port insert end ); end; architecture BEHAVIOR of mouse1 is signal PBS_CURRENT_STATE : INTEGER range 0 to 7; -- *********** architecture_decl insert begin signal x : INTEGER range 0 to 255; -- *********** architecture_decl insert end begin -- *********** architecture insert begin xp <= x; -- *********** architecture insert end PBS_MACHINE : process variable PBS_TOKEN : INTEGER range 0 to 3; begin -- *********** process_front insert begin wait until clock'event and clock = '1'; PBS_TOKEN := 0; if (reset = '0') then if (xc = '1' and xd = '0') then PBS_TOKEN := A; elsif (xc = '1' and xd = '1') then PBS_TOKEN := B; elsif (xc = '0' and xd = '1') then PBS_TOKEN := C; elsif (xc = '0' and xd = '0') then PBS_TOKEN := D; end if; -- *********** process_front insert end case PBS_CURRENT_STATE is when S2 => if (PBS_TOKEN = D) then x <= x + 1; -- (from PBS, line 34) end if; when S4 => if (PBS_TOKEN = A) then x <= x - 1; -- (from PBS, line 35) end if; when others => null; end case; PBS_CURRENT_STATE <= PBS_TRANSITION(PBS_STATE_ASSIGN(PBS_CURRENT_STATE))(PBS_TOKEN); -- *********** process_end insert begin else PBS_CURRENT_STATE <= S0; x <= 0; end if; -- *********** process_end insert end end process; end BEHAVIOR;