Commit d7fbcbef authored by Lucas Russo's avatar Lucas Russo

Merge branch 'fmc-adc-devel' into dsp-devel

Conflicts:
	embedded-sw/fmc/fmc516/fmc516.c
	hdl/Manifest.py
	hdl/modules/custom_wishbone/Manifest.py
	hdl/modules/dbe_wishbone/dbe_wishbone_pkg.vhd
	hdl/syn/dbe_bpm_fmc516/make_output
parents 5b9bbcaa cb12b43a
......@@ -75,17 +75,19 @@ void fmc516_init_regs(unsigned int id)
fmc516_clk_sel(id, 1);
fmc516_led0(id, 1);
// Adjsut the delays of all channels. Don't change these values
// unless you really have to! Put this in a generic structure!
fmc516_adj_delay(id, FMC516_ISLA216_ADC0, 5, 14, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC1, 5, 19, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC2, 5, 21, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC3, 5, 14, commit);
// Adjust the delays of all channels. Don't change these values
// unless you really have to!
fmc516_adj_delay(id, FMC516_ISLA216_ADC0, 5, 24, commit);
//fmc516_adj_delay(id, FMC516_ISLA216_ADC0, 5, 15, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC1, 5, 14, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC2, 5, 15, commit);
//fmc516_adj_delay(id, FMC516_ISLA216_ADC3, 5, 25, commit);
fmc516_adj_delay(id, FMC516_ISLA216_ADC3, 5, 28, commit);
// Delay the falling edge of all channels
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC0, 0, 0, 0, 0);
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC1, 0, 0, 1, 0);
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC2, 0, 0, 1, 0);
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC1, 0, 0, 0, 0);
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC2, 0, 0, 0, 0);
fmc516_fe_rg_dly(id, FMC516_ISLA216_ADC3, 0, 0, 0, 0);
}
......@@ -147,6 +149,7 @@ void fmc516_adj_delay(unsigned int id, int ch, int clk_dly, int data_dly, int co
break;
default:
dbg_print("> Unsupported FMC516 ADC channel\n");
fmc_ch_handler = (uint32_t *) &fmc516[id]->CH0_FN_DLY;
}
......@@ -253,6 +256,7 @@ void fmc516_fe_rg_dly(unsigned int id, int ch, int fe_dly_d1, int fe_dly_d2,
break;
default:
dbg_print("> Unsupported FMC516 ADC channel\n");
fmc_ch_handler = (uint32_t *) &fmc516[id]->CH0_CS_DLY;
}
......
#fetchto = "ip_cores"
modules = { "local": [
"modules/custom_wishbone",
"modules/custom_common",
#"modules/rffe_top",
"modules/ethmac",
"modules/dbe_wishbone",
"modules/dbe_common",
"modules/rffe_top",
"modules/fabric",
"modules/fmc_adc_common",
"ip_cores/general-cores",
"ip_cores/etherbone-core",
"ip_cores/dsp-cores",
"platform/virtex6/chipscope"]
# "git" : [
# ]
......
#modules = { "local" : ["coregen"] };
files = [ "wb_fmc516.vhd", "xwb_fmc516.vhd", "fmc516_adc_clk.vhd",
"fmc516_adc_data.vhd", "fmc516_adc_buf.vhd", "fmc516_adc_iface.vhd",
"wbgen/wb_fmc516_regs_pkg.vhd", "wbgen/wb_fmc516_regs.vhd",
"fmc516_pkg.vhd"
];
------------------------------------------------------------------------------
-- Title : Wishbone FMC516 ADC Interface
------------------------------------------------------------------------------
-- Author : Lucas Maziero Russo
-- Company : CNPEM LNLS-DIG
-- Created : 2012-17-10
-- Platform : FPGA-generic
-------------------------------------------------------------------------------
-- Description: ADC differential buffers for clock and data
-------------------------------------------------------------------------------
-- Copyright (c) 2012 CNPEM
-- Licensed under GNU Lesser General Public License (LGPL) v3.0
-------------------------------------------------------------------------------
-- Revisions :
-- Date Version Author Description
-- 2012-03-12 1.0 lucas.russo Created
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library unisim;
use unisim.vcomponents.all;
library work;
use work.fmc516_pkg.all;
entity fmc516_adc_buf is
port
(
-----------------------------
-- External ports
-----------------------------
-- ADC clocks. One clock per ADC channel
adc_clk0_p_i : in std_logic;
adc_clk0_n_i : in std_logic;
adc_clk1_p_i : in std_logic;
adc_clk1_n_i : in std_logic;
adc_clk2_p_i : in std_logic;
adc_clk2_n_i : in std_logic;
adc_clk3_p_i : in std_logic;
adc_clk3_n_i : in std_logic;
-- DDR ADC data channels.
adc_data_ch0_p_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch0_n_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch1_p_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch1_n_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch2_p_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch2_n_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch3_p_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch3_n_i : in std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_clk0_o : out std_logic;
adc_clk1_o : out std_logic;
adc_clk2_o : out std_logic;
adc_clk3_o : out std_logic;
adc_data_ch0_o : out std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch1_o : out std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch2_o : out std_logic_vector(c_num_adc_bits/2 - 1 downto 0);
adc_data_ch3_o : out std_logic_vector(c_num_adc_bits/2 - 1 downto 0)
);
end fmc516_adc_buf;
architecture rtl of fmc516_adc_buf is
begin
-----------------------------
-- ADC clock signal datapath
-----------------------------
--cmp_ibufgds_adc_clk0 : ibufgds
-- An IBUGDS intructs the mapper to use the glabal clock nets
--(GCLK pins). Therefore, it gives an error for the following
-- clock topology components, like: BUFIO, BUFR and IODELAY
cmp_ibufds_adc_clk0 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_clk0_p_i,
ib => adc_clk0_n_i,
o => adc_clk0_o
);
cmp_ibufds_adc_clk1 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_clk1_p_i,
ib => adc_clk1_n_i,
o => adc_clk1_o
);
cmp_ibufds_adc_clk2 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_clk2_p_i,
ib => adc_clk2_n_i,
o => adc_clk2_o
);
cmp_ibufds_adc_clk3 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_clk3_p_i,
ib => adc_clk3_n_i,
o => adc_clk3_o
);
-----------------------------
-- ADC data signal datapath
-----------------------------
gen_adc_data_buf_ch0 : for i in 0 to (c_num_adc_bits/2)-1 generate
-- Diferential Clock Buffers for adc input
cmp_ibufds_adc_data_ch0 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_data_ch0_p_i(i),
ib => adc_data_ch0_n_i(i),
o => adc_data_ch0_o(i)
);
cmp_ibufds_adc_data_ch1 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_data_ch1_p_i(i),
ib => adc_data_ch1_n_i(i),
o => adc_data_ch1_o(i)
);
cmp_ibufds_adc_data_ch2 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_data_ch2_p_i(i),
ib => adc_data_ch2_n_i(i),
o => adc_data_ch2_o(i)
);
cmp_ibufds_adc_data_ch3 : ibufds
generic map(
IOSTANDARD => "LVDS_25",
DIFF_TERM => TRUE
)
port map(
i => adc_data_ch3_p_i(i),
ib => adc_data_ch3_n_i(i),
o => adc_data_ch3_o(i)
);
end generate;
end rtl;
modules = { "local" : ["reset_synch"] };
files = [ "custom_common_pkg.vhd" ];
files = [ "dbe_common_pkg.vhd" ];
library ieee;
use ieee.std_logic_1164.all;
package custom_common_pkg is
package dbe_common_pkg is
--------------------------------------------------------------------
-- Components
--------------------------------------------------------------------
component reset_synch
port
port
(
clk_i : in std_logic;
arst_n_i : in std_logic;
rst_n_o : out std_logic
);
end component;
end custom_common_pkg;
end dbe_common_pkg;
files = [ "custom_wishbone_pkg.vhd" ];
files = [ "dbe_wishbone_pkg.vhd" ];
modules = { "local" : [
"wb_stream",
"wb_fmc150",
"wb_fmc516",
"wb_ethmac_adapter",
"wb_dbe_periph",
# "wb_fmc_iface"
"wb_fmc130m_4ch",
"wb_ethmac_adapter",
"wb_ethmac",
"wb_dbe_periph",
"wb_rs232_syscon"
] };
......@@ -3,7 +3,7 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.custom_wishbone_pkg.all;
use work.dbe_wishbone_pkg.all;
use work.wishbone_pkg.all;
entity wb_dbe_periph is
......
......@@ -3,7 +3,7 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.custom_wishbone_pkg.all;
use work.dbe_wishbone_pkg.all;
use work.wishbone_pkg.all;
entity xwb_dbe_periph is
......
......@@ -10,8 +10,8 @@ library work;
use work.genram_pkg.all;
use work.gencores_pkg.all;
use work.wishbone_pkg.all;
use work.custom_wishbone_pkg.all;
use work.custom_common_pkg.all;
use work.dbe_wishbone_pkg.all;
use work.dbe_common_pkg.all;
------------------------------------------------------------------------------
-- Entity section
......
......@@ -10,8 +10,8 @@ library work;
use work.genram_pkg.all;
use work.gencores_pkg.all;
use work.wishbone_pkg.all;
use work.custom_wishbone_pkg.all;
use work.custom_common_pkg.all;
use work.dbe_wishbone_pkg.all;
use work.dbe_common_pkg.all;
------------------------------------------------------------------------------
-- Entity section
......
......@@ -8,7 +8,7 @@ use ieee.numeric_std.all;
library work;
use work.wishbone_pkg.all;
use work.custom_wishbone_pkg.all;
use work.dbe_wishbone_pkg.all;
------------------------------------------------------------------------------
-- Entity section
......
......@@ -8,7 +8,7 @@ use ieee.numeric_std.all;
library work;
use work.wishbone_pkg.all;
use work.custom_wishbone_pkg.all;
use work.dbe_wishbone_pkg.all;
------------------------------------------------------------------------------
-- Entity section
......
files = [ "wb_fmc130m_4ch.vhd",
"xwb_fmc130m_4ch.vhd",
"wbgen/fmc_130m_4ch_regs_pkg.vhd",
"wbgen/fmc_130m_4ch_regs.vhd"
];
This diff is collapsed.
#!/bin/bash
wbgen2 -V fmc_130m_4ch_regs.vhd -H record -p fmc_130m_4ch_regs_pkg.vhd -K ../../../../sim/regs/wb_fmc130m_4ch_regs.vh -s struct -C fmc130m_4ch_regs.h -f html -D doc/fmc130m_4ch_regs_wb.html fmc_130m_4ch_regs.wb
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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