SBA IP cores‎ > ‎

SBA decoder

The SBA decoder is an main IP core, the function of this core is enable (logic "1") the strobe (enable/chip select)  signals based upon the value of the address bus.
For archive that, the SBA decoder use the constants defined in SBA config.

Interface declaration:

  1. entity ProjectName_SBAdecoder  is
  2. port(
  3.    STB_I: in std_logic;                                     -- Global Address Enabler
  4.    ADR_I: in ADDR_type;                                     -- Address input Bus
  5.    STB_O: out std_logic_vector(Stb_width-1 downto 0)        -- Strobe Chips selector
  6. );
  7. end ProjectName_SBAdecoder;

The signal STB_O will have a bit in "1" determinate by the value of ADR_I, the others bits will be "0". The port STB_I works as a global enabler and it is asserted by the SBA controller when it gives a valid address during a bus cycle. 

Demo of Architecture implementation:

  1. architecture Counter_SBAdecoder_Arch of Counter_SBAdecoder is
  2. Signal STBi : std_logic_vector(STB_O'range);
  3. begin
  4.  
  5. ADDRProc:process (ADR_I)
  6.   Variable ADRi : integer;
  7.  
  8.   function stb(val:natural) return std_logic_vector is
  9.   variable ret : unsigned(Stb_width-1 downto 0);
  10.   begin
  11.     ret:=(0 => '1', others=>'0');
  12.     return std_logic_vector((ret sll (val)));
  13.   end;
  14.  
  15. begin
  16.   ADRi := to_integer(unsigned(ADR_I));
  17.   case ADRi is
  18.      When D7S_S   => STBi <= stb(STB_D7SNX2);
  19.      When D7S_DP  => STBi <= stb(STB_D7SNX2);
  20.      When GPIO    => STBi <= stb(STB_GPIO);
  21.      When OTHERS  => STBi <= (others =>'0');
  22.   end case;
  23.  
  24. end process;
  25.  
  26.   STB_O <= STBi When STB_I='1else (others=>'0');
  27.  
  28. end Counter_SBAdecoder_Arch;

For the above example, the SBA decoder gives the following results:

 ADR_I value STB line value STB_O bit enabled:
 D7S_S 0 STB_D7SNX2 0 00000001
 D7S_DP 1 STB_D7SNX2 0 00000001
 GPIO 2 STB_GPIO 1 00000010

Then when the SBA controller put an address of x"0000" or x"0001" the SBA decoder enables the bit 0 of the STB_O signal. If the address is x"0002" the SBA decoder enables the bit 1 of the STB_O signal.
Comments