AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
transactor_cfg.vhd
1 -- Some registers to store the config information for the ipbus controller
2 --
3 -- Typically used to allow ucontroller to set the mac / ip address
4 --
5 -- Dave Newbold, January 2012
6 
7 library ieee;
8 use ieee.std_logic_1164.all;
9 use ieee.numeric_std.all;
10 
11 library work;
12 
13 entity transactor_cfg is
14  port(
15  clk: in std_logic; -- IPbus clock
16  rst: in std_logic; -- Sync reset
17  we: in std_logic; -- local bus write enable
18  addr: in std_logic_vector(1 downto 0); -- local bus address
19  din: in std_logic_vector(31 downto 0); -- local bus data in
20  dout: out std_logic_vector(31 downto 0); -- local bus data out
21  vec_in: in std_logic_vector(127 downto 0);
22  vec_out: out std_logic_vector(127 downto 0)
23  );
24 
25 end transactor_cfg;
26 
27 architecture rtl of transactor_cfg is
28 
29  signal s: integer;
30 
31 begin
32 
33  s <= to_integer(unsigned(addr));
34 
35  process(clk)
36  begin
37  if rising_edge(clk) then
38  if rst = '1' then
39  vec_out <= (others => '0');
40  elsif we = '1' then
41  vec_out(31 + s * 32 downto s * 32) <= din;
42  end if;
43  end if;
44  end process;
45 
46  dout <= vec_in(31 + s * 32 downto s * 32);
47 
48 end rtl;