--\begin{algorithm} --\small ---------------------- -- wine_example.vhd ---------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use work.nondeterminism.all; use work.channel.all; entity wine_example is end wine_example; architecture behavior of wine_example is type wine_list is (cabernet, merlot, zinfandel, chardonnay, sauvignon_blanc, pinot_noir, riesling, bubbly); signal wine_drunk:wine_list; signal WineryShop:channel:=init_channel; signal ShopPatron:channel:=init_channel; signal bottle:std_logic_vector(2 downto 0):="000"; signal shelf:std_logic_vector(2 downto 0); signal bag:std_logic_vector(2 downto 0); begin winery:process begin bottle <= selection(8,3); wait for delay(5,10); send(WineryShop,bottle); end process winery; shop:process begin receive(WineryShop,shelf); send(ShopPatron,shelf); end process shop; patron:process begin receive(ShopPatron,bag); wine_drunk <= wine_list'val(conv_integer(bag)); end process patron; end behavior; --\end{algorithm}