SBA IP cores‎ > ‎

SBA config

The SBA Config file contains the config package where resides the configuration values for the entire system. This file is user editable and have four basic sections:
  • System configuration
  • Address Map
  • Strobe Lines
  • System Type definitions
System configuration
Contains the information about the frequency of the main clock, the size of the buses, the number of strobe (enable/chip select) lines and the debug mode of the system:

  1. -- System configuration
  2.   Constant debug     : integer := 1;    -- '1' for Debug reports
  3.   Constant Adr_width : integer := 16;   -- Width of address bus
  4.   Constant Dat_width : integer := 16;   -- Width of data bus
  5.   Constant Stb_width : integer := 8;    -- number of strobe signals (chip select)
  6.   Constant sysfreq   : integer := 50e6; -- Main system clock frequency

In the above example, the system is being configured for have a system clock of 50MHz, this value is important because many IP cores uses this data to make the pre-synthesis calculus and adjust their internal structure. An UART for example, can calculate the internal divider necessary to archive the configured baud.

Address Map
An IP core added to the system can be accessed by the SBA controller through an address range. The SBA config have a map where the address constants values are defined. Later in the SBA controller, the designer can make reference to these constants to access the IP cores.

  1. -- Address Map
  2.   Constant D7S_DI     : integer := 0;
  3.   Constant D7S_DP     : integer := 1;
  4.   Constant GPIO       : integer := 2;

In the code example there are two IP cores added to the system, the first is an Seven segment display (D7S), it need two address to access two registers, the digit and the decimal point. And the last is a parallel GPIO, it only need one address in the map.

Strobe Lines
Each addressable IP core must have an strobe (enable/chip select) signal, when the controller try to access the IP core, the corresponding strobe signal is set (logic "1") and the IP core is enable to accepts the bus cycle (read or write). In this section the SBA config enumerates and assigns the bit lines of a system strobe signal which is coming out from the SBA decoder.

  1. --Strobe Lines
  2.   Constant STB_D7SNX2 : integer := 0;
  3.   Constant STB_GPIO   : integer := 1;

System Type definitions
Here the SBA config define the address and data subtypes used in the system:

  1. -- System Type definitions
  2.   Subtype ADDR_type is std_logic_vector(Adr_width-1 downto 0);
  3.   Subtype DATA_type is std_logic_vector(Dat_width-1 downto 0);

This section is fixed and must not be modified by the user/designer.

Miguel Risco Castillo,
Jun 12, 2015, 3:53 PM