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

Subversion Repositories wb_vga

[/] [wb_vga/] [tags/] [a01/] [technology.vhd] - Diff between revs 3 and 8

Only display areas with differences | Details | Blame | View Log

Rev 3 Rev 8
--
--
--  Technology mapping library. ALTERA edition.
--  Technology mapping library. ALTERA edition.
--
--
--  (c) Copyright Andras Tantos <andras_tantos@yahoo.com> 2001/03/31
--  (c) Copyright Andras Tantos <andras_tantos@yahoo.com> 2001/03/31
--  This code is distributed under the terms and conditions of the GNU General Public Lince.
--  This code is distributed under the terms and conditions of the GNU General Public Lince.
--
--
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
library exemplar;
library exemplar;
use exemplar.exemplar_1164.all;
use exemplar.exemplar_1164.all;
 
 
package technology is
package technology is
        function add_one(inp : std_logic_vector) return std_logic_vector;
        function add_one(inp : std_logic_vector) return std_logic_vector;
        function is_zero(inp : std_logic_vector) return boolean;
        function is_zero(inp : std_logic_vector) return boolean;
    function sl(l: std_logic_vector; r: integer) return std_logic_vector;
    function sl(l: std_logic_vector; r: integer) return std_logic_vector;
--      procedure inc(data : inout std_logic_vector);
--      procedure inc(data : inout std_logic_vector);
    function "+"(op_l, op_r: std_logic_vector) return std_logic_vector;
    function "+"(op_l, op_r: std_logic_vector) return std_logic_vector;
 
 
        component d_ff is
        component d_ff is
                port (  d  :  in STD_LOGIC;
                port (  d  :  in STD_LOGIC;
                                clk:  in STD_LOGIC;
                                clk:  in STD_LOGIC;
                        ena:  in STD_LOGIC := '1';
                        ena:  in STD_LOGIC := '1';
                        clr:  in STD_LOGIC := '0';
                        clr:  in STD_LOGIC := '0';
                        pre:  in STD_LOGIC := '0';
                        pre:  in STD_LOGIC := '0';
                                q  :  out STD_LOGIC
                                q  :  out STD_LOGIC
                );
                );
        end component;
        end component;
        component fifo is
        component fifo is
                generic (fifo_width : positive;
                generic (fifo_width : positive;
                                 used_width : positive;
                                 used_width : positive;
                                 fifo_depth : positive
                                 fifo_depth : positive
                );
                );
                port (d_in : in std_logic_vector(fifo_width-1 downto 0);
                port (d_in : in std_logic_vector(fifo_width-1 downto 0);
                          clk : in std_logic;
                          clk : in std_logic;
                          wr : in std_logic;
                          wr : in std_logic;
                          rd : in std_logic;
                          rd : in std_logic;
                          a_clr : in std_logic := '0';
                          a_clr : in std_logic := '0';
                          s_clr : in std_logic := '0';
                          s_clr : in std_logic := '0';
                          d_out : out std_logic_vector(fifo_width-1 downto 0);
                          d_out : out std_logic_vector(fifo_width-1 downto 0);
                          used : out std_logic_vector(used_width-1 downto 0);
                          used : out std_logic_vector(used_width-1 downto 0);
                          full : out std_logic;
                          full : out std_logic;
                          empty : out std_logic
                          empty : out std_logic
                );
                );
        end component;
        end component;
end technology;
end technology;
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
library exemplar;
library exemplar;
use exemplar.exemplar_1164.all;
use exemplar.exemplar_1164.all;
 
 
package body technology is
package body technology is
    function "+"(op_l, op_r: std_logic_vector) return std_logic_vector is
    function "+"(op_l, op_r: std_logic_vector) return std_logic_vector is
        begin
        begin
                return exemplar_1164."+"(op_l, op_r);
                return exemplar_1164."+"(op_l, op_r);
        end;
        end;
 
 
        function add_one(inp : std_logic_vector) return std_logic_vector is
        function add_one(inp : std_logic_vector) return std_logic_vector is
                variable one: std_logic_vector(inp'RANGE) := (others => '0');
                variable one: std_logic_vector(inp'RANGE) := (others => '0');
        begin
        begin
                one(0) := '1';
                one(0) := '1';
                return exemplar_1164."+"(inp,one);
                return exemplar_1164."+"(inp,one);
        end;
        end;
 
 
        function is_zero(inp : std_logic_vector) return boolean is
        function is_zero(inp : std_logic_vector) return boolean is
                variable zero: std_logic_vector(inp'RANGE) := (others => '0');
                variable zero: std_logic_vector(inp'RANGE) := (others => '0');
        begin
        begin
                return (inp = zero);
                return (inp = zero);
        end;
        end;
 
 
    function sl(l: std_logic_vector; r: integer) return std_logic_vector is
    function sl(l: std_logic_vector; r: integer) return std_logic_vector is
    begin
    begin
        return exemplar_1164.sl(l,r);
        return exemplar_1164.sl(l,r);
    end;
    end;
--      procedure inc(data : inout std_logic_vector) is
--      procedure inc(data : inout std_logic_vector) is
--      begin
--      begin
--              data := addone(data);
--              data := addone(data);
--      end;
--      end;
end package body technology;
end package body technology;
 
 
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
 
 
library exemplar;
library exemplar;
use exemplar.exemplar_1164.all;
use exemplar.exemplar_1164.all;
 
 
library lpm;
library lpm;
use lpm.all;
use lpm.all;
 
 
entity fifo is
entity fifo is
        generic (fifo_width : positive;
        generic (fifo_width : positive;
                         used_width : positive;
                         used_width : positive;
                         fifo_depth : positive
                         fifo_depth : positive
        );
        );
        port (d_in : in std_logic_vector(fifo_width-1 downto 0);
        port (d_in : in std_logic_vector(fifo_width-1 downto 0);
                  clk : in std_logic;
                  clk : in std_logic;
                  wr : in std_logic;
                  wr : in std_logic;
                  rd : in std_logic;
                  rd : in std_logic;
                  a_clr : in std_logic := '0';
                  a_clr : in std_logic := '0';
                  s_clr : in std_logic := '0';
                  s_clr : in std_logic := '0';
                  d_out : out std_logic_vector(fifo_width-1 downto 0);
                  d_out : out std_logic_vector(fifo_width-1 downto 0);
                  used : out std_logic_vector(used_width-1 downto 0);
                  used : out std_logic_vector(used_width-1 downto 0);
                  full : out std_logic;
                  full : out std_logic;
                  empty : out std_logic
                  empty : out std_logic
        );
        );
end fifo;
end fifo;
 
 
architecture altera of fifo is
architecture altera of fifo is
        component lpm_fifo
        component lpm_fifo
                generic (LPM_WIDTH : positive;
                generic (LPM_WIDTH : positive;
                                 LPM_WIDTHU : positive;
                                 LPM_WIDTHU : positive;
                                 LPM_NUMWORDS : positive;
                                 LPM_NUMWORDS : positive;
                                 LPM_SHOWAHEAD : string := "OFF";
                                 LPM_SHOWAHEAD : string := "OFF";
                                 LPM_TYPE : string := "LPM_FIFO";
                                 LPM_TYPE : string := "LPM_FIFO";
                                 LPM_HINT : string := "UNUSED");
                                 LPM_HINT : string := "UNUSED");
                port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
                port (DATA : in std_logic_vector(LPM_WIDTH-1 downto 0);
                          CLOCK : in std_logic;
                          CLOCK : in std_logic;
                          WRREQ : in std_logic;
                          WRREQ : in std_logic;
                          RDREQ : in std_logic;
                          RDREQ : in std_logic;
                          ACLR : in std_logic;
                          ACLR : in std_logic;
                          SCLR : in std_logic;
                          SCLR : in std_logic;
                          Q : out std_logic_vector(LPM_WIDTH-1 downto 0);
                          Q : out std_logic_vector(LPM_WIDTH-1 downto 0);
                          USEDW : out std_logic_vector(LPM_WIDTHU-1 downto 0);
                          USEDW : out std_logic_vector(LPM_WIDTHU-1 downto 0);
                          FULL : out std_logic;
                          FULL : out std_logic;
                          EMPTY : out std_logic);
                          EMPTY : out std_logic);
        end component;
        end component;
begin
begin
        altera_fifo: lpm_fifo
        altera_fifo: lpm_fifo
                generic map (
                generic map (
                        LPM_WIDTH => fifo_width,
                        LPM_WIDTH => fifo_width,
                        LPM_WIDTHU => used_width,
                        LPM_WIDTHU => used_width,
                        LPM_NUMWORDS => fifo_depth,
                        LPM_NUMWORDS => fifo_depth,
                        LPM_SHOWAHEAD => "OFF",
                        LPM_SHOWAHEAD => "OFF",
                        LPM_TYPE => "LPM_FIFO",
                        LPM_TYPE => "LPM_FIFO",
                        LPM_HINT => "UNUSED"
                        LPM_HINT => "UNUSED"
                )
                )
                port map (
                port map (
                        DATA => d_in,
                        DATA => d_in,
                        CLOCK => clk,
                        CLOCK => clk,
                        WRREQ => wr,
                        WRREQ => wr,
                        RDREQ => rd,
                        RDREQ => rd,
                        ACLR => a_clr,
                        ACLR => a_clr,
                        SCLR => s_clr,
                        SCLR => s_clr,
                        Q => d_out,
                        Q => d_out,
                        USEDW => used,
                        USEDW => used,
                        FULL => full,
                        FULL => full,
                        EMPTY => empty
                        EMPTY => empty
                );
                );
end altera;
end altera;
 
 
 
 
library IEEE;
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_1164.all;
 
 
library altera_exemplar;
library altera_exemplar;
use altera_exemplar.all;
use altera_exemplar.all;
 
 
entity d_ff is
entity d_ff is
        port (  d  :  in STD_LOGIC;
        port (  d  :  in STD_LOGIC;
                        clk:  in STD_LOGIC;
                        clk:  in STD_LOGIC;
                ena:  in STD_LOGIC := '1';
                ena:  in STD_LOGIC := '1';
                clr:  in STD_LOGIC := '0';
                clr:  in STD_LOGIC := '0';
                pre:  in STD_LOGIC := '0';
                pre:  in STD_LOGIC := '0';
                        q  :  out STD_LOGIC
                        q  :  out STD_LOGIC
        );
        );
end d_ff;
end d_ff;
 
 
architecture altera of d_ff is
architecture altera of d_ff is
        component dffe
        component dffe
        port (  D  :  in STD_LOGIC;
        port (  D  :  in STD_LOGIC;
                        CLK:  in STD_LOGIC;
                        CLK:  in STD_LOGIC;
                ENA:  in STD_LOGIC;
                ENA:  in STD_LOGIC;
                CLRN: in STD_LOGIC;
                CLRN: in STD_LOGIC;
                PRN:  in STD_LOGIC;
                PRN:  in STD_LOGIC;
                        Q  :  out STD_LOGIC);
                        Q  :  out STD_LOGIC);
        end component;
        end component;
        signal clrn,prn: std_logic;
        signal clrn,prn: std_logic;
begin
begin
        clrn <= not clr;
        clrn <= not clr;
        prn <= not pre;
        prn <= not pre;
        ff: dffe port map (
        ff: dffe port map (
                D => d,
                D => d,
                CLK => clk,
                CLK => clk,
                ENA => ena,
                ENA => ena,
                CLRN => clrn,
                CLRN => clrn,
                PRN => prn,
                PRN => prn,
                Q => q
                Q => q
        );
        );
end altera;
end altera;
 
 
-- Sythetizer library. Contains STD_LOGIC arithmetics
-- Sythetizer library. Contains STD_LOGIC arithmetics
 
 
 
 

powered by: WebSVN 2.1.0

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