wishbone_types.vhdl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. package wishbone_types is
  4. --
  5. -- Main CPU bus. 32-bit address, 64-bit data
  6. --
  7. constant wishbone_addr_bits : integer := 32;
  8. constant wishbone_data_bits : integer := 64;
  9. constant wishbone_sel_bits : integer := wishbone_data_bits/8;
  10. subtype wishbone_addr_type is std_ulogic_vector(wishbone_addr_bits-1 downto 0);
  11. subtype wishbone_data_type is std_ulogic_vector(wishbone_data_bits-1 downto 0);
  12. subtype wishbone_sel_type is std_ulogic_vector(wishbone_sel_bits-1 downto 0);
  13. type wishbone_master_out is record
  14. adr : wishbone_addr_type;
  15. dat : wishbone_data_type;
  16. sel : wishbone_sel_type;
  17. cyc : std_ulogic;
  18. stb : std_ulogic;
  19. we : std_ulogic;
  20. end record;
  21. constant wishbone_master_out_init : wishbone_master_out := (adr => (others => '0'), dat => (others => '0'), cyc => '0', stb => '0', sel => (others => '0'), we => '0');
  22. type wishbone_slave_out is record
  23. dat : wishbone_data_type;
  24. ack : std_ulogic;
  25. stall : std_ulogic;
  26. end record;
  27. constant wishbone_slave_out_init : wishbone_slave_out := (ack => '0', stall => '0', others => (others => '0'));
  28. type wishbone_master_out_vector is array (natural range <>) of wishbone_master_out;
  29. type wishbone_slave_out_vector is array (natural range <>) of wishbone_slave_out;
  30. --
  31. -- IO Bus to a device, 30-bit address, 32-bits data
  32. --
  33. type wb_io_master_out is record
  34. adr : std_ulogic_vector(29 downto 0);
  35. dat : std_ulogic_vector(31 downto 0);
  36. sel : std_ulogic_vector(3 downto 0);
  37. cyc : std_ulogic;
  38. stb : std_ulogic;
  39. we : std_ulogic;
  40. end record;
  41. type wb_io_slave_out is record
  42. dat : std_ulogic_vector(31 downto 0);
  43. ack : std_ulogic;
  44. stall : std_ulogic;
  45. end record;
  46. constant wb_io_slave_out_init : wb_io_slave_out := (ack => '0', stall => '0', others => (others => '0'));
  47. end package wishbone_types;