OpenCores
URL https://opencores.org/ocsvn/acxbrd/acxbrd/trunk

Subversion Repositories acxbrd

[/] [acxbrd/] [tags/] [arelease/] [confppa.vhd] - Diff between revs 2 and 3

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 3
--
--
--      confppa.vhd
--      confppa.vhd
--
--
--      configuration ACEX from ROM in PPA mode
--      configuration ACEX from ROM in PPA mode
--      Pinout for BB KFL board
--      Pinout for BB KFL board
--      
--      
--      resources on MAX7032
--      resources on MAX7032
--
--
--              32 LCs !!!
--              32 LCs !!!
--
--
--      timing for ACEX:
--      timing for ACEX:
--              nConfig low                                                     min 2 us
--              nConfig low                                                     min 2 us
--              nConfig high to nStatus high            max 4 us
--              nConfig high to nStatus high            max 4 us
--              nConfig high to nWS rising edge         max 5 us
--              nConfig high to nWS rising edge         max 5 us
--              nWS pulse width                                         min 200 ns
--              nWS pulse width                                         min 200 ns
--              nStatus high to first rising DCLK       min 1 us
--              nStatus high to first rising DCLK       min 1 us
--              DCLK clk                                                        max 33.3 MHz
--              DCLK clk                                                        max 33.3 MHz
--
--
--      for simpler config wait tbusy+trdy2ws+tws2b befor next byte
--      for simpler config wait tbusy+trdy2ws+tws2b befor next byte
--              1.6 us + 50 ns + 50 ns
--              1.6 us + 50 ns + 50 ns
--
--
--
--
--      todo:
--      todo:
--
--
--
--
--      2001-10-26      creation
--      2001-10-26      creation
--      2002-01-11      changed clock div to 32 for 7.3 MHz
--      2002-01-11      changed clock div to 32 for 7.3 MHz
--
--
 
 
 
 
library ieee ;
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_1164.all ;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_unsigned.all;
 
 
entity confppa is
entity confppa is
 
 
port (
port (
        clk             : in std_logic;
        clk             : in std_logic;
        nreset  : in std_logic;
        nreset  : in std_logic;
 
 
        a               : out std_logic_vector(16 downto 0);     -- FLASH adr
        a               : out std_logic_vector(16 downto 0);     -- FLASH adr
        noe_in  : in std_logic;                                                 -- input from ACEX
        noe_in  : in std_logic;                                                 -- input from ACEX
        nce_in  : in std_logic;                                                 -- input from ACEX
        nce_in  : in std_logic;                                                 -- input from ACEX
        noe             : out std_logic;                                                -- output to FLASH
        noe             : out std_logic;                                                -- output to FLASH
        nce             : out std_logic;                                                -- output to FLASH
        nce             : out std_logic;                                                -- output to FLASH
        d0in    : in std_logic;                                                 -- D0 from FLASH
        d0in    : in std_logic;                                                 -- D0 from FLASH
        d0out   : out std_logic;                                                -- reseved DATA0 to ACEX
        d0out   : out std_logic;                                                -- reseved DATA0 to ACEX
 
 
        nconf   : out std_logic;                                                -- ACEX nConfig
        nconf   : out std_logic;                                                -- ACEX nConfig
        nstatus : in std_logic;                                                 -- ACEX nStatus                 -- not used
        nstatus : in std_logic;                                                 -- ACEX nStatus                 -- not used
        conf_done       : in std_logic;                                         -- ACEX conf_done
        conf_done       : in std_logic;                                         -- ACEX conf_done
 
 
        csacx   : out std_logic;                                                -- ACEX CS ???
        csacx   : out std_logic;                                                -- ACEX CS ???
        nws             : out std_logic;                                                -- ACEX nWS
        nws             : out std_logic;                                                -- ACEX nWS
        nbsy    : in std_logic;                                                 -- ACEX RDYnBSY                 -- not used
        nbsy    : in std_logic;                                                 -- ACEX RDYnBSY                 -- not used
 
 
        resacx  : out std_logic                                                 -- ACEX reset line
        resacx  : out std_logic                                                 -- ACEX reset line
 
 
);
);
end confppa ;
end confppa ;
 
 
architecture rtl of confppa is
architecture rtl of confppa is
 
 
        signal slowclk          : std_logic;
        signal slowclk          : std_logic;
        signal div                      : std_logic_vector(6 downto 0);
        signal div                      : std_logic_vector(6 downto 0);
 
 
        signal state            : std_logic_vector(4 downto 0);
        signal state            : std_logic_vector(4 downto 0);
 
 
        signal ar                       : std_logic_vector(16 downto 0); -- adress register
        signal ar                       : std_logic_vector(16 downto 0); -- adress register
 
 
-- 
-- 
--      special encoding to use as output!
--      special encoding to use as output!
--
--
constant start                  :std_logic_vector(4 downto 0) := "00110";
constant start                  :std_logic_vector(4 downto 0) := "00110";
constant wait_nCfg_2us  :std_logic_vector(4 downto 0) := "10110";
constant wait_nCfg_2us  :std_logic_vector(4 downto 0) := "10110";
constant wait_5us               :std_logic_vector(4 downto 0) := "01111";
constant wait_5us               :std_logic_vector(4 downto 0) := "01111";
constant wslow                  :std_logic_vector(4 downto 0) := "01101";
constant wslow                  :std_logic_vector(4 downto 0) := "01101";
constant wshigh                 :std_logic_vector(4 downto 0) := "11111";
constant wshigh                 :std_logic_vector(4 downto 0) := "11111";
constant resacex                :std_logic_vector(4 downto 0) := "00111";
constant resacex                :std_logic_vector(4 downto 0) := "00111";
constant running                :std_logic_vector(4 downto 0) := "00011";
constant running                :std_logic_vector(4 downto 0) := "00011";
 
 
begin
begin
 
 
--
--
--      divide clock to max 250 kHz (4us for nstatus)
--      divide clock to max 250 kHz (4us for nstatus)
--
--
process(clk, nreset)
process(clk, nreset)
begin
begin
 
 
        if nreset='0' then
        if nreset='0' then
                div <= (others => '0');
                div <= (others => '0');
        else
        else
                if rising_edge(clk) then
                if rising_edge(clk) then
                        div <= div + 1;
                        div <= div + 1;
                end if;
                end if;
        end if;
        end if;
end process;
end process;
 
 
--      slowclk <= div(6);              for 24 MHz
--      slowclk <= div(6);              for 24 MHz
        slowclk <= div(4);              -- for 7.3 MHz
        slowclk <= div(4);              -- for 7.3 MHz
 
 
        nconf <= state(0);
        nconf <= state(0);
        nws <= state(1);
        nws <= state(1);
        resacx <= state(2);
        resacx <= state(2);
        csacx <= state(3);
        csacx <= state(3);
 
 
 
 
--
--
--      state machine
--      state machine
--
--
process(slowclk, nreset)
process(slowclk, nreset)
 
 
begin
begin
 
 
        if nreset='0' then
        if nreset='0' then
 
 
                state <= start;
                state <= start;
                ar <= (others => '0');
                ar <= (others => '0');
 
 
        else
        else
                if rising_edge(slowclk) then
                if rising_edge(slowclk) then
 
 
                        case state is
                        case state is
 
 
                                when start =>
                                when start =>
                                        ar <= (others => '0');
                                        ar <= (others => '0');
                                        state <= wait_nCfg_2us;
                                        state <= wait_nCfg_2us;
 
 
                                when wait_nCfg_2us =>
                                when wait_nCfg_2us =>
                                        state <= wait_5us;
                                        state <= wait_5us;
 
 
                                when wait_5us =>
                                when wait_5us =>
                                        state <= wslow;
                                        state <= wslow;
 
 
                                when wslow =>
                                when wslow =>
                                        state <= wshigh;
                                        state <= wshigh;
 
 
                                when wshigh =>
                                when wshigh =>
                                        ar <= ar + 1;
                                        ar <= ar + 1;
                                        if conf_done='1' then
                                        if conf_done='1' then
                                                state <= resacex;
                                                state <= resacex;
                                        else
                                        else
                                                state <= wslow;
                                                state <= wslow;
                                        end if;
                                        end if;
 
 
                                when resacex =>
                                when resacex =>
                                        state <= running;
                                        state <= running;
 
 
                                when running =>
                                when running =>
 
 
                                when others =>
                                when others =>
 
 
                        end case;
                        end case;
                end if;
                end if;
        end if;
        end if;
 
 
end process;
end process;
 
 
process (state(2), ar, d0in, noe_in, nce_in)
process (state(2), ar, d0in, noe_in, nce_in)
begin
begin
 
 
        if state(2)='0' then             -- is resacx
        if state(2)='0' then             -- is resacx
                a <= (others => 'Z');
                a <= (others => 'Z');
                d0out <= '1';
                d0out <= '1';
                noe <= noe_in;
                noe <= noe_in;
                nce <= nce_in;
                nce <= nce_in;
        else
        else
                a <= ar;
                a <= ar;
                d0out <= d0in;
                d0out <= d0in;
                noe <= '0';
                noe <= '0';
                nce <= '0';
                nce <= '0';
        end if;
        end if;
 
 
end process;
end process;
 
 
 
 
end rtl;
end rtl;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.