Commit 9a3f56b5 authored by Maciej Lipinski's avatar Maciej Lipinski

Importing altera to the new repo: adding altera files from the old repo to the new repo

parents aa1a8ab3 c784dd47
# /
/*.mpf
/*.bak
/*.state
/*.wlf
/*.summary
/*.rpt
/*.done
/*.pin
/*.sof
/*.smsg
/*.dpf
/*.rbf
/incremental_db
/*.ddb
/PLLJ_PLLSPE_INFO.txt
SRCS_VHDL = platform_specific.vhd \
alt_clock_divider.vhd \
../genrams/genram_pkg.vhd \
../genrams/altera/generic_dpram.vhd \
../genrams/altera/generic_spram.vhd \
../genrams/altera/generic_sync_fifo.vhd \
../genrams/altera/generic_async_fifo.vhd \
../generic_ssram_dualport_singleclock.vhd
VPATH=../genrams/altera ../genrams
WORK = work
include ../../scripts/modules.mk
files= ["platform_specific.vhd",
"alt_clock_divider.vhd"];
This diff is collapsed.
-------------------------------------------------------------------------------
-- Title : Generic platform-independent 4-input clock mux
-- Project : White Rabbit Switch
-------------------------------------------------------------------------------
-- File : generic_clock_mux.vhd
-- Author : Tomasz Wlostowski
-- Company : CERN BE-Co-HT
-- Created : 2010-06-21
-- Last update: 2010-06-21
-- Platform : FPGA-generic
-- Standard : VHDL'87
-------------------------------------------------------------------------------
-- Description: 4 input clock multiplexer - a wrapper for ALTCLKCTRL component.
-------------------------------------------------------------------------------
-- Copyright (c) 2010 Tomasz Wlostowski
-------------------------------------------------------------------------------
-- Revisions :
-- Date Version Author Description
-- 2010-06-21 1.0 twlostow Created
-------------------------------------------------------------------------------
LIBRARY cycloneiii;
USE cycloneiii.all;
--synthesis_resources = clkctrl 1 reg 3
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY clkmux2_altera_altclkctrl_0fi IS
PORT
(
clkselect : IN STD_LOGIC_VECTOR (1 DOWNTO 0) := (OTHERS => '0');
ena : IN STD_LOGIC := '1';
inclk : IN STD_LOGIC_VECTOR (3 DOWNTO 0) := (OTHERS => '0');
outclk : OUT STD_LOGIC
);
END clkmux2_altera_altclkctrl_0fi;
ARCHITECTURE RTL OF clkmux2_altera_altclkctrl_0fi IS
ATTRIBUTE synthesis_clearbox : natural;
ATTRIBUTE synthesis_clearbox OF RTL : ARCHITECTURE IS 2;
ATTRIBUTE ALTERA_ATTRIBUTE : string;
SIGNAL ena_reg : STD_LOGIC
-- synopsys translate_off
:= '1'
-- synopsys translate_on
;
ATTRIBUTE ALTERA_ATTRIBUTE OF ena_reg : SIGNAL IS "POWER_UP_LEVEL=HIGH";
SIGNAL wire_ena_reg_w_lg_q6w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL select_reg : STD_LOGIC_VECTOR(1 DOWNTO 0)
-- synopsys translate_off
:= (OTHERS => '0')
-- synopsys translate_on
;
ATTRIBUTE ALTERA_ATTRIBUTE OF select_reg : SIGNAL IS "POWER_UP_LEVEL=LOW";
SIGNAL wire_select_reg_w_q_range12w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_select_reg_w_q_range17w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_clkctrl1_w_lg_outclk5w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_clkctrl1_clkselect : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL wire_vcc : STD_LOGIC;
SIGNAL wire_clkctrl1_outclk : STD_LOGIC;
SIGNAL wire_w_lg_w_select_enable_wire_range15w20w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_w_lg_w_clkselect_wire_range13w14w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_w_lg_w_clkselect_wire_range18w19w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL clkselect_wire : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL inclk_wire : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL select_enable_wire : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL wire_w_clkselect_wire_range13w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_w_clkselect_wire_range3w : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL wire_w_clkselect_wire_range18w : STD_LOGIC_VECTOR (0 DOWNTO 0);
SIGNAL wire_w_select_enable_wire_range15w : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT cycloneiii_clkctrl
GENERIC
(
clock_type : STRING;
ena_register_mode : STRING := "falling edge";
lpm_type : STRING := "cycloneiii_clkctrl"
);
PORT
(
clkselect : IN STD_LOGIC_VECTOR(1 DOWNTO 0);
ena : IN STD_LOGIC;
inclk : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
outclk : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
wire_vcc <= '1';
wire_w_lg_w_select_enable_wire_range15w20w(0) <= wire_w_select_enable_wire_range15w(0) OR wire_w_lg_w_clkselect_wire_range18w19w(0);
wire_w_lg_w_clkselect_wire_range13w14w(0) <= wire_w_clkselect_wire_range13w(0) XOR wire_select_reg_w_q_range12w(0);
wire_w_lg_w_clkselect_wire_range18w19w(0) <= wire_w_clkselect_wire_range18w(0) XOR wire_select_reg_w_q_range17w(0);
clkselect_wire <= ( clkselect);
inclk_wire <= ( inclk);
outclk <= (wire_clkctrl1_outclk AND ena_reg);
select_enable_wire <= ( wire_w_lg_w_select_enable_wire_range15w20w & wire_w_lg_w_clkselect_wire_range13w14w);
wire_w_clkselect_wire_range13w(0) <= clkselect_wire(0);
wire_w_clkselect_wire_range3w <= clkselect_wire(1 DOWNTO 0);
wire_w_clkselect_wire_range18w(0) <= clkselect_wire(1);
wire_w_select_enable_wire_range15w(0) <= select_enable_wire(0);
PROCESS (wire_clkctrl1_outclk)
BEGIN
IF (wire_clkctrl1_outclk = '0' AND wire_clkctrl1_outclk'event) THEN ena_reg <= (ena AND (NOT select_enable_wire(1)));
END IF;
END PROCESS;
PROCESS (wire_clkctrl1_outclk)
BEGIN
IF (wire_clkctrl1_outclk = '0' AND wire_clkctrl1_outclk'event) THEN
IF (ena_reg = '0') THEN select_reg <= wire_w_clkselect_wire_range3w;
END IF;
END IF;
END PROCESS;
wire_select_reg_w_q_range12w(0) <= select_reg(0);
wire_select_reg_w_q_range17w(0) <= select_reg(1);
wire_clkctrl1_w_lg_outclk5w(0) <= NOT wire_clkctrl1_outclk;
wire_clkctrl1_clkselect <= ( select_reg);
clkctrl1 : cycloneiii_clkctrl
GENERIC MAP (
clock_type => "Global Clock"
)
PORT MAP (
clkselect => wire_clkctrl1_clkselect,
ena => wire_vcc,
inclk => inclk_wire,
outclk => wire_clkctrl1_outclk
);
END RTL; --clkmux2_altera_altclkctrl_0fi
--VALID FILE
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY clkmux2_altera IS
PORT
(
clkselect : IN STD_LOGIC := '0';
inclk0x : IN STD_LOGIC ;
inclk1x : IN STD_LOGIC ;
outclk : OUT STD_LOGIC
);
END clkmux2_altera;
ARCHITECTURE RTL OF clkmux2_altera IS
ATTRIBUTE synthesis_clearbox: natural;
ATTRIBUTE synthesis_clearbox OF RTL: ARCHITECTURE IS 2;
ATTRIBUTE clearbox_macroname: string;
ATTRIBUTE clearbox_macroname OF RTL: ARCHITECTURE IS "altclkctrl";
ATTRIBUTE clearbox_defparam: string;
ATTRIBUTE clearbox_defparam OF RTL: ARCHITECTURE IS "ena_register_mode=falling edge;intended_device_family=Cyclone III;use_glitch_free_switch_over_implementation=ON;clock_type=Global Clock;";
SIGNAL sub_wire0 : STD_LOGIC ;
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC ;
SIGNAL sub_wire3 : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL sub_wire4 : STD_LOGIC ;
SIGNAL sub_wire5_bv : BIT_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire5 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire6 : STD_LOGIC ;
SIGNAL sub_wire7 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire8_bv : BIT_VECTOR (0 DOWNTO 0);
SIGNAL sub_wire8 : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT clkmux2_altera_altclkctrl_0fi
PORT (
ena : IN STD_LOGIC ;
outclk : OUT STD_LOGIC ;
inclk : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
clkselect : IN STD_LOGIC_VECTOR (1 DOWNTO 0)
);
END COMPONENT;
BEGIN
sub_wire1 <= '1';
sub_wire5_bv(1 DOWNTO 0) <= "00";
sub_wire5 <= To_stdlogicvector(sub_wire5_bv);
sub_wire8_bv(0 DOWNTO 0) <= "0";
sub_wire8 <= To_stdlogicvector(sub_wire8_bv);
sub_wire4 <= inclk1x;
outclk <= sub_wire0;
sub_wire2 <= inclk0x;
sub_wire3 <= sub_wire5(1 DOWNTO 0) & sub_wire4 & sub_wire2;
sub_wire6 <= clkselect;
sub_wire7 <= sub_wire8(0 DOWNTO 0) & sub_wire6;
clkmux2_altera_altclkctrl_0fi_component : clkmux2_altera_altclkctrl_0fi
PORT MAP (
ena => sub_wire1,
inclk => sub_wire3,
clkselect => sub_wire7,
outclk => sub_wire0
);
END RTL;
library cycloneiii;
use cycloneiii.all;
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.platform_specific.all;
entity generic_clock_mux3 is
port (
-- clock select
clk_sel_i : in std_logic_vector(1 downto 0);
-- clock inputs
inclk0_i : in std_logic;
inclk1_i : in std_logic;
inclk2_i : in std_logic;
-- clock MUX output
outclk_o : out std_logic
);
end generic_clock_mux3;
architecture rtl of generic_clock_mux3 is
component clkmux2_altera
port (
clkselect : IN STD_LOGIC := '0';
inclk0x : IN STD_LOGIC;
inclk1x : IN STD_LOGIC;
outclk : OUT STD_LOGIC);
end component;
signal clk_01_muxed : std_logic;
begin
mux01: clkmux2_altera
port map (
clkselect => clk_sel_i(1),
inclk0x => inclk0_i,
inclk1x => inclk1_i,
outclk => outclk_o);
end rtl;
library ieee;
use ieee.std_logic_1164.all;
library lpm;
use lpm.all;
library work;
use work.platform_specific.all;
entity generic_pipelined_multiplier is
generic(
g_width_a : natural;
g_width_b : natural;
g_width_out : natural;
g_sign_mode : string := "signed"
);
port (
clk_i : in std_logic;
a_i : in std_logic_vector(g_width_a -1 downto 0);
b_i : in std_logic_vector(g_width_b -1 downto 0);
q_o : out std_logic_vector(g_width_out-1 downto 0)
);
end generic_pipelined_multiplier;
architecture SYN of generic_pipelined_multiplier is
signal sub_wire0 : std_logic_vector (g_width_out-1 downto 0);
component lpm_mult
generic (
lpm_hint : string;
lpm_pipeline : natural;
lpm_representation : string;
lpm_type : string;
lpm_widtha : natural;
lpm_widthb : natural;
lpm_widthp : natural
);
port (
dataa : in std_logic_vector (g_width_a-1 downto 0);
datab : in std_logic_vector (g_width_b-1 downto 0);
clock : in std_logic;
result : out std_logic_vector (g_width_out-1 downto 0)
);
end component;
begin
q_o <= sub_wire0(g_width_out-1 downto 0);
lpm_mult_component : lpm_mult
generic map (
lpm_hint => "DEDICATED_MULTIPLIER_CIRCUITRY=YES,MAXIMIZE_SPEED=9",
lpm_pipeline => 2,
lpm_representation => "SIGNED",
lpm_type => "LPM_MULT",
lpm_widtha => g_width_a,
lpm_widthb => g_width_b,
lpm_widthp => g_width_out
)
port map (
dataa => a_i,
datab => b_i,
clock => clk_i,
result => sub_wire0
);
end SYN;
-- megafunction wizard: %RAM: 2-PORT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altsyncram
-- ============================================================
-- File Name: aaa.vhd
-- Megafunction Name(s):
-- altsyncram
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 9.0 Build 132 02/25/2009 SJ Full Version
-- ************************************************************
--Copyright (C) 1991-2009 Altera Corporation
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, Altera MegaCore Function License
--Agreement, or other applicable license agreement, including,
--without limitation, that your use is for the sole purpose of
--programming logic devices manufactured by Altera and sold by
--Altera or its authorized distributors. Please refer to the
--applicable agreement for further details.
library ieee;
use ieee.std_logic_1164.all;
library altera_mf;
use altera_mf.all;
entity generic_ssram_dualport_singleclock is
generic (
g_width : natural := 8;
g_addr_bits : natural := 10;
g_size : natural := 1024;
g_init_file : string := "UNUSED");
port
(
data_i : in std_logic_vector (g_width-1 downto 0);
clk_i : in std_logic;
rd_addr_i : in std_logic_vector (g_addr_bits-1 downto 0);
wr_addr_i : in std_logic_vector (g_addr_bits-1 downto 0);
wr_en_i : in std_logic := '1';
q_o : out std_logic_vector (g_width-1 downto 0)
);
end generic_ssram_dualport_singleclock;
architecture SYN of generic_ssram_dualport_singleclock is
signal sub_wire0 : std_logic_vector (g_width-1 downto 0);
component altsyncram
generic (
address_aclr_b : string;
address_reg_b : string;
clock_enable_input_a : string;
clock_enable_input_b : string;
clock_enable_output_b : string;
intended_device_family : string;
lpm_type : string;
numwords_a : natural;
numwords_b : natural;
operation_mode : string;
outdata_aclr_b : string;
outdata_reg_b : string;
power_up_uninitialized : string;
read_during_write_mode_mixed_ports : string;
widthad_a : natural;
widthad_b : natural;
width_a : natural;
width_b : natural;
INIT_FILE : string ;
width_byteena_a : natural
);
port (
wren_a : in std_logic;
clock0 : in std_logic;
address_a : in std_logic_vector (g_addr_bits-1 downto 0);
address_b : in std_logic_vector (g_addr_bits-1 downto 0);
q_b : out std_logic_vector (g_width-1 downto 0);
data_a : in std_logic_vector (g_width-1 downto 0)
);
end component;
begin
q_o <= sub_wire0(g_width-1 downto 0);
altsyncram_component : altsyncram
generic map (
address_aclr_b => "NONE",
address_reg_b => "CLOCK0",
clock_enable_input_a => "BYPASS",
clock_enable_input_b => "BYPASS",
clock_enable_output_b => "BYPASS",
intended_device_family => "Cyclone III",
lpm_type => "altsyncram",
numwords_a => g_size,
numwords_b => g_size,
operation_mode => "DUAL_PORT",
outdata_aclr_b => "NONE",
outdata_reg_b => "UNREGISTERED",
power_up_uninitialized => "FALSE",
read_during_write_mode_mixed_ports => "OLD_DATA",
widthad_a => g_addr_bits,
widthad_b => g_addr_bits,
width_a => g_width,
width_b => g_width,
width_byteena_a => 1,
INIT_FILE => g_init_file
)
port map (
wren_a => wr_en_i,
clock0 => clk_i,
address_a => wr_addr_i,
address_b => rd_addr_i,
data_a => data_i,
q_b => sub_wire0
);
end SYN;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library lpm;
use lpm.all;
-------------------------------------------------------------------------------
package platform_specific is
component alt_clock_divider
port (
inclk0 : in std_logic := '0';
c0 : out std_logic;
c1 : out std_logic;
locked : out std_logic);
end component;
component generic_pipelined_multiplier
generic (
g_width_a : natural;
g_width_b : natural;
g_width_out : natural;
g_sign_mode : string);
port (
clk_i : in std_logic;
a_i : in std_logic_vector(g_width_a -1 downto 0);
b_i : in std_logic_vector(g_width_b -1 downto 0);
q_o : out std_logic_vector(g_width_out-1 downto 0));
end component;
end platform_specific;
-------------------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment