⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 epcs_controller.vhd

📁 nois 2cpu 硬件实现编程
💻 VHD
📖 第 1 页 / 共 2 页
字号:
      end if;      if std_logic'(data_rd_strobe) = '1' then         -- On data read, clear the RRDY bit.        RRDY <= std_logic'('0');      end if;      if std_logic'(status_wr_strobe) = '1' then         -- On status write, clear all status bits (ignore the data).        EOP <= std_logic'('0');        RRDY <= std_logic'('0');        ROE <= std_logic'('0');        TOE <= std_logic'('0');      end if;      if std_logic'(slowclock) = '1' then         if (std_logic_vector'("000000000000000000000000000") & (state)) = std_logic_vector'("00000000000000000000000000010001") then           transmitting <= std_logic'('0');          RRDY <= std_logic'('1');          rx_holding_reg <= shift_reg;          SCLK_reg <= std_logic'('0');          if std_logic'(RRDY) = '1' then             ROE <= std_logic'('1');          end if;        elsif (std_logic_vector'("000000000000000000000000000") & (state)) /= std_logic_vector'("00000000000000000000000000000000") then           if std_logic'(transmitting) = '1' then             SCLK_reg <= NOT SCLK_reg;          end if;        end if;        if ((((std_logic_vector'("0000000000000000000000000000000") & (A_TOSTDLOGICVECTOR(SCLK_reg))) XOR std_logic_vector'("00000000000000000000000000000000")) XOR std_logic_vector'("00000000000000000000000000000000"))) /= std_logic_vector'("00000000000000000000000000000000") then           if (std_logic_vector'("00000000000000000000000000000001")) /= std_logic_vector'("00000000000000000000000000000000") then             shift_reg <= Std_Logic_Vector'(shift_reg(6 DOWNTO 0) & A_ToStdLogicVector(MISO_reg));          end if;        else          MISO_reg <= MISO;        end if;      end if;    end if;  end process;end europa;--synthesis translate_offlibrary altera;use altera.altera_europa_support_lib.all;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity tornado_epcs_controller_atom is         port (              -- inputs:                 signal dclkin : IN STD_LOGIC;                 signal oe : IN STD_LOGIC;                 signal scein : IN STD_LOGIC;                 signal sdoin : IN STD_LOGIC;              -- outputs:                 signal data0out : OUT STD_LOGIC              );end entity tornado_epcs_controller_atom;architecture europa of tornado_epcs_controller_atom is              signal internal_data0out :  STD_LOGIC;begin    internal_data0out <= ((sdoin OR scein) OR dclkin) OR oe;  --vhdl renameroo for output signals  data0out <= internal_data0out;end europa;--synthesis translate_on--synthesis read_comments_as_HDL on--library altera;--use altera.altera_europa_support_lib.all;----library ieee;--use ieee.std_logic_1164.all;--use ieee.std_logic_arith.all;--use ieee.std_logic_unsigned.all;----entity tornado_epcs_controller_atom is --        port (--              --                 signal dclkin : IN STD_LOGIC;--                 signal oe : IN STD_LOGIC;--                 signal scein : IN STD_LOGIC;--                 signal sdoin : IN STD_LOGIC;----              --                 signal data0out : OUT STD_LOGIC--              );--end entity tornado_epcs_controller_atom;------architecture europa of tornado_epcs_controller_atom is--  component tornado_spiblock is--PORT (--    signal data0out : OUT STD_LOGIC;--        signal oe : IN STD_LOGIC;--        signal sdoin : IN STD_LOGIC;--        signal scein : IN STD_LOGIC;--        signal dclkin : IN STD_LOGIC--      );--  end component tornado_spiblock;--                signal internal_data0out :  STD_LOGIC;----begin----  the_tornado_spiblock : tornado_spiblock--    port map(--            data0out => internal_data0out,--            dclkin => dclkin,--            oe => oe,--            scein => scein,--            sdoin => sdoin--    );----  --  data0out <= internal_data0out;--end europa;----synthesis read_comments_as_HDL off-- turn off superfluous VHDL processor warnings -- altera message_level Level1 -- altera message_off 10034 10035 10036 10037 10230 10240 10030 -- turn off superfluous VHDL processor warnings -- altera message_level Level1 -- altera message_off 10034 10035 10036 10037 10230 10240 10030 library altera;use altera.altera_europa_support_lib.all;library altera_mf;use altera_mf.all;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;library lpm;use lpm.all;entity epcs_controller is         port (              -- inputs:                 signal address : IN STD_LOGIC_VECTOR (8 DOWNTO 0);                 signal chipselect : IN STD_LOGIC;                 signal clk : IN STD_LOGIC;                 signal read_n : IN STD_LOGIC;                 signal reset_n : IN STD_LOGIC;                 signal write_n : IN STD_LOGIC;                 signal writedata : IN STD_LOGIC_VECTOR (31 DOWNTO 0);              -- outputs:                 signal dataavailable : OUT STD_LOGIC;                 signal endofpacket : OUT STD_LOGIC;                 signal irq : OUT STD_LOGIC;                 signal readdata : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);                 signal readyfordata : OUT STD_LOGIC              );end entity epcs_controller;architecture europa of epcs_controller iscomponent epcs_controller_sub is            port (                 -- inputs:                    signal MISO : IN STD_LOGIC;                    signal clk : IN STD_LOGIC;                    signal data_from_cpu : IN STD_LOGIC_VECTOR (15 DOWNTO 0);                    signal epcs_select : IN STD_LOGIC;                    signal mem_addr : IN STD_LOGIC_VECTOR (2 DOWNTO 0);                    signal read_n : IN STD_LOGIC;                    signal reset_n : IN STD_LOGIC;                    signal write_n : IN STD_LOGIC;                 -- outputs:                    signal MOSI : OUT STD_LOGIC;                    signal SCLK : OUT STD_LOGIC;                    signal SS_n : OUT STD_LOGIC;                    signal data_to_cpu : OUT STD_LOGIC_VECTOR (15 DOWNTO 0);                    signal dataavailable : OUT STD_LOGIC;                    signal endofpacket : OUT STD_LOGIC;                    signal irq : OUT STD_LOGIC;                    signal readyfordata : OUT STD_LOGIC                 );end component epcs_controller_sub;component tornado_epcs_controller_atom is            port (                 -- inputs:                    signal dclkin : IN STD_LOGIC;                    signal oe : IN STD_LOGIC;                    signal scein : IN STD_LOGIC;                    signal sdoin : IN STD_LOGIC;                 -- outputs:                    signal data0out : OUT STD_LOGIC                 );end component tornado_epcs_controller_atom;--synthesis translate_off  component altsyncram isGENERIC (      byte_size : NATURAL;        init_file : STRING;        lpm_type : STRING;        numwords_a : NATURAL;        operation_mode : STRING;        outdata_reg_a : STRING;        read_during_write_mode_mixed_ports : STRING;        width_a : NATURAL;        widthad_a : NATURAL      );    PORT (    signal q_a : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);        signal address_a : IN STD_LOGIC_VECTOR (6 DOWNTO 0);        signal clock0 : IN STD_LOGIC      );  end component altsyncram;--synthesis translate_on--synthesis read_comments_as_HDL on--  component altsyncram is--GENERIC (--      byte_size : NATURAL;--        init_file : STRING;--        lpm_type : STRING;--        numwords_a : NATURAL;--        operation_mode : STRING;--        outdata_reg_a : STRING;--        read_during_write_mode_mixed_ports : STRING;--        width_a : NATURAL;--        widthad_a : NATURAL--      );--    PORT (--    signal q_a : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);--        signal address_a : IN STD_LOGIC_VECTOR (6 DOWNTO 0);--        signal clock0 : IN STD_LOGIC--      );--  end component altsyncram;--synthesis read_comments_as_HDL off                signal MISO :  STD_LOGIC;                signal MOSI :  STD_LOGIC;                signal SCLK :  STD_LOGIC;                signal SS_n :  STD_LOGIC;                signal data_from_cpu :  STD_LOGIC_VECTOR (15 DOWNTO 0);                signal data_to_cpu :  STD_LOGIC_VECTOR (15 DOWNTO 0);                signal epcs_select :  STD_LOGIC;                signal internal_dataavailable :  STD_LOGIC;                signal internal_endofpacket :  STD_LOGIC;                signal internal_irq :  STD_LOGIC;                signal internal_readyfordata :  STD_LOGIC;                signal mem_addr :  STD_LOGIC_VECTOR (2 DOWNTO 0);                signal module_input :  STD_LOGIC;                signal rom_readdata :  STD_LOGIC_VECTOR (31 DOWNTO 0);begin  --the_epcs_controller_sub, which is an e_instance  the_epcs_controller_sub : epcs_controller_sub    port map(      MOSI => MOSI,      SCLK => SCLK,      SS_n => SS_n,      data_to_cpu => data_to_cpu,      dataavailable => internal_dataavailable,      endofpacket => internal_endofpacket,      irq => internal_irq,      readyfordata => internal_readyfordata,      MISO => MISO,      clk => clk,      data_from_cpu => data_from_cpu,      epcs_select => epcs_select,      mem_addr => mem_addr,      read_n => read_n,      reset_n => reset_n,      write_n => write_n    );  --epcs_control_port, which is an e_avalon_slave  --the_tornado_epcs_controller_atom, which is an e_instance  the_tornado_epcs_controller_atom : tornado_epcs_controller_atom    port map(      data0out => MISO,      dclkin => SCLK,      oe => module_input,      scein => SS_n,      sdoin => MOSI    );  module_input <= std_logic'('0');  epcs_select <= chipselect AND (address(7));  mem_addr <= address (2 DOWNTO 0);  data_from_cpu <= writedata (15 DOWNTO 0);  readdata <= A_WE_StdLogicVector((std_logic'(epcs_select) = '1'), (std_logic_vector'("0000000000000000") & (data_to_cpu)), rom_readdata);  --vhdl renameroo for output signals  dataavailable <= internal_dataavailable;  --vhdl renameroo for output signals  endofpacket <= internal_endofpacket;  --vhdl renameroo for output signals  irq <= internal_irq;  --vhdl renameroo for output signals  readyfordata <= internal_readyfordata;--synthesis translate_off    the_boot_copier_rom : altsyncram      generic map(        byte_size => 8,        init_file => "epcs_controller_boot_rom.hex",        lpm_type => "altsyncram",        numwords_a => 128,        operation_mode => "ROM",        outdata_reg_a => "UNREGISTERED",        read_during_write_mode_mixed_ports => "DONT_CARE",        width_a => 32,        widthad_a => 7      )      port map(                address_a => address(6 DOWNTO 0),                clock0 => clk,                q_a => rom_readdata      );--synthesis translate_on--synthesis read_comments_as_HDL on--    the_boot_copier_rom : altsyncram--      generic map(--        byte_size => 8,--        init_file => "epcs_controller_boot_rom.hex",--        lpm_type => "altsyncram",--        numwords_a => 128,--        operation_mode => "ROM",--        outdata_reg_a => "UNREGISTERED",--        read_during_write_mode_mixed_ports => "DONT_CARE",--        width_a => 32,--        widthad_a => 7--      )--      port map(--                address_a => address(6 DOWNTO 0),--                clock0 => clk,--                q_a => rom_readdata--      );----synthesis read_comments_as_HDL offend europa;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -